Writes failures & cpu speed

Michael Moedt xemc at yahoo.com
Mon Jul 12 17:12:45 EDT 2004


Hi.

I'm running into an MTD problem that I'm not sure how to hunt down.
Has anyone seen this, or can you guide me as to what I should look
at?

Here's the details:
I'm using a Sharp LH7A400 SoC (that's an ARM9), w/ SDRAM, NAND flash
(64MiB of Toshiba NAND (512+16 byte pagesize, 16KiB block/erase
size).  I've partitioned it into four partitions, 1. bootloader, 2.
kernel, 3 and 4. JFFS2 filesystems. (#3 is my root, 8MiB)

I'm using kernel 2.6.6, with modifications to support my flash layout
and such things.  I'm also using the 2004-05-04 MTD snapshot.

When I configure the CPU in the bootloader to run at 100MHz, it seems
to work fine.  However, when I run it at 195MHz (it goes up to 200),
I can't successfully copy files to my JFFS2 filesystem.  Here's what
it looks like:

100MHZ:
# cd /root
# cp nandwrite nandwrite_2
# rm nandwrite_2
#

at 195MHz:
# cp nandwrite nandwrite_2
Write of 2260 bytes at 0x0010c000 failed. returned -5, retlen 0
Not marking the space at 0x0010c000 as dirty because the flash driver
returned o
Write of 2260 bytes at 0x0010c000 failed. returned -5, retlen 0
Not marking the space at 0x0010c000 as dirty because the flash driver
returned o
Write of 2263 bytes at 0x0010c000 failed. returned -5, retlen 0
Not marking the space at 0x0010c000 as dirty because the flash driver
returned o
Write of 2263 bytes at 0x0010c000 failed. returned -5, retlen 0
Not marking the space at 0x0010c000 as dirty because the flash driver
returned o
Write of 2263 bytes at 0x0010c000 failed. returned -5, retlen 0
Not marking the space at 0x0010c000 as dirty because the flash driver
returned o
Write of 2263 bytes at 0x0010c000 failed. returned -5, retlen 0
Not marking the space at 0x0010c000 as dirty because the flash driver
returned o
cp: Write Error: Input/output error
# rm nandwrite_2
# jffs2_flush_wbuf(): Write failed with -5
Write of 2554 bytes at 0x0010c034 failed. returned -5, retlen 0
Not marking the space at 0x0010c034 as dirty because the flash driver
returned o
Write of 2554 bytes at 0x00108034 failed. returned -5, retlen 460
Error writing new dnode: -5

#

and sometimes, it also results in a kernel Segfault:
# cp nandwrite nandwrite_2
Write of 2473 bytes at 0x00108c78 failed. returned -5, retlen 392
jffs2_flash_writev(): Non-contiguous write to 00109624
Unable to handle kernel NULL pointer dereference at virtual address
00000000
pgd = c02cc000
[00000000] *pgd=c0377011, *pte=00000000, *ppte=00000000
Internal error: Oops: 807 [#1]
...


I don't know why a faster CPU speed would cause something like this. 
Could there be some timing bug that I've found?
What does a return value of -5 mean?


Thanks in advance,
Mike





More information about the linux-mtd mailing list