public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* NAND programming bug in Linux 2.6.8?
@ 2004-10-15 10:53 Mikael Starvik
  2004-10-15 11:13 ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Starvik @ 2004-10-15 10:53 UTC (permalink / raw)
  To: linux-mtd

In nand_base.c:nand_command() the following happens (stripped pseudo-code):

if (NAND_CMD_SEQIN) {
  if (column > OOB) {
    column -= OOB;
    use READ_OOB;
  }
  else if (column < 256)
    use READ0;
  else {
    column -= 256;
    use READ1;
  }
  send_command();
}
if (16bit)
  column >>= 1;
write_column();

The problem is that for a 16-bit device the READ1 command will be issued
even though the column address fits in 8 bits. Suggested patch below.

Comments?

/Mikael (not a member of this list)

Index: nand_base.c
===================================================================
RCS file: /usr/local/cvs/linux/os/lx25/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 nand_base.c
--- nand_base.c	16 Aug 2004 08:14:36 -0000	1.1.1.1
+++ nand_base.c	15 Oct 2004 10:46:16 -0000
@@ -506,8 +506,8 @@
 			/* OOB area */
 			column -= mtd->oobblock;
 			readcmd = NAND_CMD_READOOB;
-		} else if (column < 256) {
-			/* First 256 bytes --> READ0 */
+		} else if ((column < 256) || (this->options &
NAND_BUSWIDTH_16)) {
+			/* First 256 bytes/words --> READ0 */
 			readcmd = NAND_CMD_READ0;
 		} else {
 			column -= 256;

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <BFECAF9E178F144FAEF2BF4CE739C668018E2C8E@exmail1.se.axis.com>]

end of thread, other threads:[~2004-10-15 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-15 10:53 NAND programming bug in Linux 2.6.8? Mikael Starvik
2004-10-15 11:13 ` Thomas Gleixner
     [not found] <BFECAF9E178F144FAEF2BF4CE739C668018E2C8E@exmail1.se.axis.com>
2004-10-15 11:50 ` Mikael Starvik
2004-10-15 12:05   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox