[PATCH] mtd omap2 driver fix IOERR

Toan Pham tpham3783 at gmail.com
Mon Mar 4 13:03:20 EST 2013


Hi all,

I am running the omap2 nand driver on kernel 2.6.39 and i am having a
problem formatting JFFS2 filesystem.  Normal flash erase by issuing
"flash_erase /dev/mtd4 0 0" would work fine.  However, nand erase with
JFFS2 formatting by issuing "flash_erase -j /dev/mtd4 0 0"  would fail with
IO errors.  Below is the description of the error generated from
mtd-utils-1.4.9 or mtd-utils-1.5.0.

localhost# flash_erase -j /dev/mtd4 0 0

Erasing 128 Kibyte @ 1f920000 -- 99 % complete libmtd: error!: MEMERASE64
ioctl failed for eraseblock 4041 (mtd4)
        error 5 (Input/output error)
flash_erase: error!: /dev/mtd4: MTD Erase failure
             error 5 (Input/output error)
Erasing 128 Kibyte @ 1f940000 -- 99 % complete libmtd: error!: MEMERASE64
ioctl failed for eraseblock 4042 (mtd4)
        error 5 (Input/output error)
flash_erase: error!: /dev/mtd4: MTD Erase failure
             error 5 (Input/output error)
etc......

Attached is a bug fix to properly use Jiffies tick timer.  Previous code
was buggy b/c it did not account for scheduler tick (HZ) to be less than
50HZ.  When kernel config HZ tick is set below 50HZ, the omap driver does
not wait at all after executing a status request command, because:

timeo += (HZ * 20) / 1000;

evaluates to zero.  Again, this bug should only surface when HZ is set
below 50Hz.


thank you,

Toan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20130304/32d7114f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nand_omap2_IOERR.patch
Type: application/octet-stream
Size: 502 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20130304/32d7114f/attachment-0001.obj>


More information about the linux-mtd mailing list