MTD utils v1.5.0: MEMERASE64 ioctl failed error

Shah, Minal minal.shah at ti.com
Tue Oct 15 01:32:23 PDT 2013


Hi Brian,
Thanks a lot for the explanation; I understood the reason for failure.

> So why do you want to erase bad blocks?
The reason why I want to erase bad blocks is because they actually don't seem to be bad. 
Block0 itself is shown as bad.
I have few partitions (like MLO and u-boot env) of size equal to 1 erase block. The block is marked as bad and hence I cannot write anything to this partition. 
One of the solutions is to increase that partition size to 2 blocks so even if 1 block is bad then it will atleast be able to write to the other block of the same partition. But I don't think I should do this while the block is not really bad (what if all the blocks for some reason are marked as bad while they are actually not).

This question came in my mind from the fact that "nand scrub" command is allowed from u-boot which allows to also completely erase all the bad blocks; so why not from the kernel level.

Regards,
Minal

-----Original Message-----
From: Brian Norris [mailto:computersforpeace at gmail.com] 
Sent: Saturday, October 12, 2013 3:55 AM
To: Shah, Minal
Cc: Mike Frysinger; Mukherjee, Somnath; linux-mtd at lists.infradead.org; Gupta, Pekon; Parikh, Urmil
Subject: Re: MTD utils v1.5.0: MEMERASE64 ioctl failed error

Hi Minal,

On Wed, Oct 09, 2013 at 05:05:11AM +0000, Shah, Minal wrote:
> I am using MTD utils version 1.5.0 for DRA7 (Vayu) platform.
> 
> I have bad blocks in some of my NAND partitions which I am not able to erase from linux kernel.

MTD does not allow erasing bad blocks. This is prohibited by NAND
datasheets. There are occasions where, for debugging purposes, one might
need to erase a "bad" block that is not actually bad, but MTD does not
provide an interface for doing this. An interface for doing so was
discussed a while back, but nothing was merged.

> Using "-N" option in flash_eraseall ideally should have allowed erasing the bad block but I land up in "MEMERASE64 ioctl failed" error. 

"-N" just means that the user-space tool (flash_erase) won't try to skip
bad blocks. But that doesn't circumvent the in-kernel protection that
prevents the erase from succeeding. So the "Input/output" error you see
is completely expected and currently unavoidable, unless you modify your
kernel to remove this protection.

[snip]

So why do you want to erase bad blocks?

Brian



More information about the linux-mtd mailing list