public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Alexey Korolev <akorolev@infradead.org>
To: dwmw2@infradead.org, dedekind@infradead.org
Cc: linux-mtd@lists.infradead.org
Subject: [PATCH] Bugfix subpage read for small page NAND.
Date: Tue, 29 Jul 2008 13:54:11 +0100 (BST)	[thread overview]
Message-ID: <alpine.LFD.1.10.0807291325580.23930@casper.infradead.org> (raw)

Hi,

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@infradead.org>
-----------
diff -Naurp 1/include/linux/mtd/nand.h 2/include/linux/mtd/nand.h
--- 1/include/linux/mtd/nand.h	2008-07-29 16:05:17.000000000 +0400
+++ 2/include/linux/mtd/nand.h	2008-07-29 15:38:34.000000000 +0400
@@ -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)
-----------

Thanks,
Alexey

             reply	other threads:[~2008-07-29 12:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-29 12:54 Alexey Korolev [this message]
2008-07-30  9:00 ` [PATCH] Bugfix subpage read for small page NAND Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0807291325580.23930@casper.infradead.org \
    --to=akorolev@infradead.org \
    --cc=dedekind@infradead.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox