[PATCH] mtd omap2 driver fix IOERR

Brian Norris computersforpeace at gmail.com
Sun Mar 10 03:14:34 EDT 2013


Hi Toan,

On Mon, Mar 4, 2013 at 10:03 AM, Toan Pham <tpham3783 at gmail.com> wrote:
> 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.

Your patch looks correct, but can you do a few things to make it
easier to accept into the kernel?

1) Look at the SubmittingPatches documentation, e.g.:

https://www.kernel.org/doc/Documentation/SubmittingPatches

For one, it is useful to provide the patch inline (not an attachment).
But if your mail client will mangle that, then an attachment is
probably OK.

2) Provide a "Signed-off-by" line. 'SubmittingPatches' describes what
this means, exactly.

3) Don't use spaces for indentation; use tabs. If you need other tips
on Linux kernel coding style, see:

https://www.kernel.org/doc/Documentation/CodingStyle

Thanks,
Brian



More information about the linux-mtd mailing list