suspect UBIFS async operations causing issues during reboot

Richard Weinberger richard at nod.at
Wed Nov 26 00:30:17 PST 2014


Am 26.11.2014 um 09:17 schrieb Brian Norris:
> On Sun, Nov 09, 2014 at 09:10:03PM -0800, Scott Branden wrote:
>> On 14-11-09 02:20 AM, Richard Weinberger wrote:
>>> Well, I agree with David that anything we do in software will only hide the real problem
>>> or trim down the window.
>> Hi Richard,
>>
>> Currently the NAND does not shut down in a clean manner for a reboot
>> operation.  This is due to the asynchronous ubi_thread make flash
>> erase calls.  unmount is done properly in ubi already and cleanly
>> shuts down.  reboot is not done in a clean manner as there is no
>> reboot_notifier to handle the situation.
>>
>> This is not hiding a real problem.  It is just shutting down ubi
>> properly rather than pulling the power from it in the middle of
>> operations.
>>
>> In addition to this - a reboot_notifier needs to be added at the mtd
>> level to shut it down properly as well.
>>
>> This is not trimming down a window.  It is having the drivers shut
>> down properly so they do not look like a power failure to the NAND
>> device.
>>
>> There is no solution to the power failure - it will corrupt pages in
>> the middle of erasure.  And you do handle this in UBI/UBIFS.  But
>> why corrupt other erase pages unnecessarily when all that needs to
>> be done is shut down the drivers properly.  I don't know what you
>> are agreeing with David with?  It is not making a window smaller.
>> It is changing the functionality so that the UBI and MTD drivers are
>> shut down cleanly in reboot situations.  Right now, they are not
>> shut down at all in these situations.
> 
> I agree with Scott's statements. While it's fine to talk about how all
> layers (from bootloader to UBIFS) should be able to handle a power cut
> in the midst of an erase, that does *not* mean that we should
> intentionally deny the chance to shut down cleanly.
> 
> AFAICT, Scott's not trying to work around any unsound reset behaviors
> (in UBIFS or in his bootloader); he's just trying to shut things down
> gracefully, just as we would try to terminate processes, sync file
> systems, etc., rather than just cutting power on reboot.

If there is a solution which makes Artem and David happy, I'm perfectly fine. :)

Thanks,
//richard



More information about the linux-mtd mailing list