[MTD] [NAND] fix subpage read for small page NAND

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Jul 30 10:59:01 EDT 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=96d8b647cfff90c8ff07863866aacdcd9d13cead
Commit:     96d8b647cfff90c8ff07863866aacdcd9d13cead
Parent:     6e86841d05f371b5b9b86ce76c02aaee83352298
Author:     Alexey Korolev <akorolev at infradead.org>
AuthorDate: Tue Jul 29 13:54:11 2008 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Wed Jul 30 11:59:24 2008 +0100

    [MTD] [NAND] fix subpage read for small page NAND
    
    Current implementation of subpage read feature for NAND has issues with
    small page devices. Small page NAND do not support RNDOUT command.
    So subpage feature is not applicable for them.
    
    This patch disables support of subpage for small page NAND.
    The code is verified on nandsim(SP NAND simulation) and on LP NAND
    devices.
    
    Thanks a lot to Artem for finding this issue.
    
    Signed-off-by: Alexey Korolev <akorolev at infradead.org>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 include/linux/mtd/nand.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 83f6787..81774e5 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -177,7 +177,9 @@ typedef enum {
 #define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING))
 #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))
 #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
-#define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT))
+/* Large page NAND with SOFT_ECC should support subpage reads */
+#define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT) \
+					&& (chip->page_shift > 9))
 
 /* Mask to zero out the chip options, which come from the id table */
 #define NAND_CHIPOPTIONS_MSK	(0x0000ffff & ~NAND_NO_AUTOINCR)



More information about the linux-mtd-cvs mailing list