Is it an atomic operation for writing a page in NAND flash

Liu Hui onlyflyer at gmail.com
Wed Jan 20 08:11:41 EST 2010


Richard,

Thank you for your confirmation and good idea.

I also think about your idea before, that is, when power failure
happens, generate an interrupt and blocks any other write requests in
interrupt handler. But this is a little complex.

Now, I think I can use ECC to check the partial write, if a write was
not finished, the ECC should be wrong, so we can detect this partial
write and discard this write. Do you think this is a good idea?

Thanks,
Hui

2010/1/20 Ricard Wanderlof <ricard.wanderlof at axis.com>:
>
> On Wed, 20 Jan 2010, Liu Hui wrote:
>
>> Hi guys,
>>
>> This is a question confused me for a long time. As I know, writing a
>> sector for a hard disk is atomic. That is to say, when we are writing
>> a sector to hard disk and power failure happen, the sector will be
>> written completely or not at all.
>>
>> For NAND flash, I didn't see the atomic guarantee in any material.
>> Could you please tell me if writing a page for NAND flash is atomic?
>> This is very important for a transaction based file system.
>
> It is my understanding that if you get a power failure while the nand flash
> chip is writing the page the page could get partly written.
>
> The only way around something like this would be to monitor the power line
> prior to the supply regulator, and not start a write if it can be detected
> that a power failure has occurred and there is not enough power to complete
> the write.
>
> /Ricard
> --
> Ricard Wolf Wanderlöf                           ricardw(at)axis.com
> Axis Communications AB, Lund, Sweden            www.axis.com
> Phone +46 46 272 2016                           Fax +46 46 13 61 30
>



-- 
Thanks & Best Regards
Liu Hui
--



More information about the linux-mtd mailing list