From: ezequiel.garcia@free-electrons.com (Ezequiel Garcia)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 00/14] Armada 370/XP NAND support
Date: Mon, 2 Dec 2013 07:33:06 -0300 [thread overview]
Message-ID: <20131202103305.GB2466@localhost> (raw)
In-Reply-To: <87bo12kcyt.fsf@natisbad.org>
Hi Arnaud,
First of all: thanks for such great testings!
On Sat, Nov 30, 2013 at 12:25:14AM +0100, Arnaud Ebalard wrote:
> Ezequiel Garcia <ezequiel.garcia@free-electrons.com> writes:
>
> >> Ezequiel, I am back in business to test a v2 ;-)
> >
> > Well, I'm not sure yet what's going on. Do you have any spare NAND partition
> > to run some destructive testings?
> >
> > In that case, please run:
> >
> > $ nandtest /dev/mtd{X}
>
> Here is the nandtest run:
>
> nandtest /dev/mtd4
> ECC corrections: 0
> ECC failures : 0
> Bad blocks : 8
> BBT blocks : 0
> Bad block at 0x06700000
> Bad block at 0x06720000
> Bad block at 0x06740000
> Bad block at 0x06760000
> Bad block at 0x06780000
> Bad block at 0x067a0000
> Bad block at 0x067c0000
> Bad block at 0x067e0000
>
> Finished pass 1 successfully
>
Hm, so something *is* working properly. Notice that mtd4 has its 8 last blocks
marked 'bad' becuase it holds the bad block table.
If you don't mind running a few more rounds, then it would be nice to do:
$ nandtest --passes {N}
So we run the test a few more times, just to be sure.
>
> Then, doing a simple read and copying back the data:
>
> root at mood:~# dd if=/dev/mtd4 of=/tmp/toto
> 212992+0 records in
> 212992+0 records out
> 109051904 bytes (109 MB) copied, 10.8671 s, 10.0 MB/s
>
> root at mood:~# flash_erase /dev/mtd4 0 0
>
> root at mood:~# nandwrite -p /dev/mtd4 /tmp/toto
> ...
> Writing data to block 795 at offset 0x6360000
> Writing data to block 796 at offset 0x6380000
> Writing data to block 797 at offset 0x63a0000
> Writing data to block 798 at offset 0x63c0000
> Writing data to block 799 at offset 0x63e0000
> Writing data to block 800 at offset 0x6400000
> [ 1509.210395] pxa3xx-nand d00d0000.nand: Ready time out!!!
> libmtd: error!: cannot write 2048 bytes to mtd4 (eraseblock 800, offset 0)
> error 5 (Input/output error)
[..]
> [ 1513.810387] pxa3xx-nand d00d0000.nand: Ready time out!!!
> libmtd: error!: cannot write 2048 bytes to mtd4 (eraseblock 823, offset 0)
> error 5 (Input/output error)
> Erasing failed write from 0x66e0000 to 0x66fffff
Hm.. so you get errors when writing to mtd4 blocks from 800 to 823.
Is that completely reproducible, IOW do you get always the error
on those blocks?
And what happens if you write directly to those blocks only?
(you can use nandwrite --offset)
> Writing data to block 824 at offset 0x6700000
> Bad block at 6700000, 1 block(s) from 6700000 will be skipped
> Writing data to block 825 at offset 0x6720000
> Bad block at 6720000, 1 block(s) from 6720000 will be skipped
> Writing data to block 826 at offset 0x6740000
> Bad block at 6740000, 1 block(s) from 6740000 will be skipped
> Writing data to block 827 at offset 0x6760000
> Bad block at 6760000, 1 block(s) from 6760000 will be skipped
> Writing data to block 828 at offset 0x6780000
> Bad block at 6780000, 1 block(s) from 6780000 will be skipped
> Writing data to block 829 at offset 0x67a0000
> Bad block at 67a0000, 1 block(s) from 67a0000 will be skipped
> Writing data to block 830 at offset 0x67c0000
> Bad block at 67c0000, 1 block(s) from 67c0000 will be skipped
> Writing data to block 831 at offset 0x67e0000
> Bad block at 67e0000, 1 block(s) from 67e0000 will be skipped
> Writing data to block 832 at offset 0x6800000
> libmtd: error!: bad eraseblock number 832, mtd4 has 832 eraseblocks
> nandwrite: error!: /dev/mtd4: MTD get bad block failed
> error 22 (Invalid argument)
> nandwrite: error!: Data was only partially written due to error
> error 22 (Invalid argument)
>
These 8 blocks (824-832) that has been skipped are the ones marked
as 'bad' because they hold the bad block table.
> This is the kind of errors I got last time but I think am starting to
> understand the root cause now. Tell me if I get it right: what is
> understood as bad blocks above (and in nandtest) is in fact the two bad
> block tables reported during boot:
>
> NAND device: Manufacturer ID: 0xad, Chip ID: 0xf1 (Hynix H27U1G8F2BTR-BC)
> NAND device: 128MiB, SLC, page size: 2048, OOB size: 64
> Bad block table found at page 65472, version 0x01
> Bad block table found at page 65408, version 0x01
>
Yes and no :-) The bad block table consists of 8 blocks at the end
of the flash device. These blocks are marked as 'reserved' and nandtest
or any other userspace writing/erasing tool will skip them.
Hence, the bad block table is what explains the skipping of the group
of blocks [824..832]. However, you're getting errors when writing
data to [800..823], and it's a "Ready timeout" condition. I'm not sure
exactly what's going on, but we can say that:
* Either the waiting time is not enough, or ...
* The commands (maybe some race) were badly issued so there's nothing
to wait at all.
To check the former, you only need to hack the driver like this, and
then re-try the nandwrite:
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 3d143fe..9bb7d35 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -39,7 +39,7 @@
#include <linux/platform_data/mtd-nand-pxa3xx.h>
#define NAND_DEV_READY_TIMEOUT 50
-#define CHIP_DELAY_TIMEOUT (2 * HZ/10)
+#define CHIP_DELAY_TIMEOUT (10 * HZ/10)
#define NAND_STOP_DELAY (2 * HZ/50)
#define PAGE_CHUNK_SIZE (2048)
It's just a test.
To check about the latter, I cannot think of anything but adding printk
all over the place and inspect the command sequence.
Brian: Do you have any better idea?
Thanks again for these tests and for your patience!
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
next prev parent reply other threads:[~2013-12-02 10:33 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 21:25 [PATCH v5 00/14] Armada 370/XP NAND support Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 01/14] mtd: nand: pxa3xx: Use a completion to signal device ready Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 02/14] mtd: nand: pxa3xx: Use waitfunc() to wait for the device to be ready Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 03/14] mtd: nand: pxa3xx: Add bad block handling Ezequiel Garcia
2013-11-14 22:12 ` Brian Norris
2013-11-14 22:37 ` Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 04/14] mtd: nand: pxa3xx: Add driver-specific ECC BCH support Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 05/14] mtd: nand: pxa3xx: Clear cmd buffer #3 (NDCB3) on command start Ezequiel Garcia
2013-11-14 22:18 ` Brian Norris
2013-11-14 21:25 ` [PATCH v5 06/14] mtd: nand: pxa3xx: Add helper function to set page address Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 07/14] mtd: nand: pxa3xx: Remove READ0 switch/case falltrough Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 08/14] mtd: nand: pxa3xx: Split prepare_command_pool() in two stages Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 09/14] mtd: nand: pxa3xx: Move the data buffer clean to prepare_start_command() Ezequiel Garcia
2013-11-14 22:25 ` Brian Norris
2013-11-14 22:45 ` Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 10/14] mtd: nand: pxa3xx: Fix SEQIN column address set Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 11/14] mtd: nand: pxa3xx: Add a read/write buffers markers Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 12/14] mtd: nand: pxa3xx: Introduce multiple page I/O support Ezequiel Garcia
2013-11-14 22:40 ` Brian Norris
2013-11-14 23:02 ` Ezequiel Garcia
2013-11-14 23:07 ` Brian Norris
2013-11-14 21:25 ` [PATCH v5 13/14] mtd: nand: pxa3xx: Add multiple chunk write support Ezequiel Garcia
2013-11-14 21:25 ` [PATCH v5 14/14] mtd: nand: pxa3xx: Add ECC BCH correctable errors detection Ezequiel Garcia
2013-11-14 23:04 ` [PATCH v5 00/14] Armada 370/XP NAND support Brian Norris
2013-11-14 23:05 ` Brian Norris
2013-11-14 23:15 ` Ezequiel Garcia
2013-11-14 23:17 ` Brian Norris
2013-11-15 7:59 ` Daniel Mack
2013-11-15 13:07 ` Ezequiel Garcia
2013-11-15 13:47 ` Daniel Mack
2013-11-15 14:27 ` Ezequiel Garcia
2013-11-15 14:30 ` Daniel Mack
2013-11-15 18:05 ` Brian Norris
2013-11-15 18:35 ` Ezequiel Garcia
2013-11-24 14:08 ` Arnaud Ebalard
2013-11-24 14:22 ` Thomas Petazzoni
2013-11-25 12:03 ` Ezequiel Garcia
2013-11-25 23:04 ` Arnaud Ebalard
2013-11-26 12:40 ` Ezequiel Garcia
2013-11-27 20:24 ` Arnaud Ebalard
2013-11-27 20:52 ` Arnaud Ebalard
2013-11-28 7:48 ` Ricard Wanderlof
2013-11-28 18:50 ` Ezequiel Garcia
2013-11-29 23:25 ` Arnaud Ebalard
2013-12-02 10:33 ` Ezequiel Garcia [this message]
2013-12-02 21:05 ` Arnaud Ebalard
2013-12-03 0:22 ` Ezequiel Garcia
2013-12-03 20:21 ` Arnaud Ebalard
2013-12-03 21:25 ` Arnaud Ebalard
2013-12-04 14:20 ` Ezequiel Garcia
2013-12-04 14:41 ` Ezequiel Garcia
2013-12-04 20:48 ` Arnaud Ebalard
2013-12-05 20:42 ` Arnaud Ebalard
2013-12-05 22:24 ` [PATCH v5 00/14] Armada 370/XP NAND supportg Ezequiel Garcia
2013-12-06 12:56 ` [PATCH v5 00/14] Armada 370/XP NAND support Ezequiel Garcia
2013-12-06 21:41 ` Arnaud Ebalard
2013-12-06 22:05 ` Ezequiel Garcia
2013-12-05 21:32 ` Brian Norris
2013-12-05 21:23 ` Brian Norris
2013-12-05 22:23 ` Ezequiel Garcia
2013-12-05 22:45 ` Brian Norris
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=20131202103305.GB2466@localhost \
--to=ezequiel.garcia@free-electrons.com \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).