[PATCHv2] MTD: Add UBI reboot notifier
Artem Bityutskiy
dedekind1 at gmail.com
Fri Feb 12 10:21:00 EST 2010
On Fri, 2010-02-12 at 14:45 +0100, Norbert van Bolhuis wrote:
> Artem Bityutskiy wrote:
> > FYI, I do not like this patch, because it is not solving the problem, it
> > just makes the problem less likely. I.e., you are still screwed if you
> > reboot while some other task is doing erasure. Indeed, the background
> > thread is not the only task which may do erases.
> >
> > I'm not going to revert this patch, but wanted to let you know that I
> > think it was my mistake to push it.
> >
>
> so, how to solve this properly ?
>
> probably the only way is the reboot notifier of the MTD chip driver
> (for NOR flash only cmdset_0001 has one).
Well. UBI itself does not have problems with half-erased eraseblocks. As
the comment to the patch says, this is for a strange platform where the
boot loader panics when it encounters a half-erased EB.
So the most proper fix is to fix the boot-loader. Remember, a power cut
can introduce half-erased EBs, and you cannot address this in SW.
For clean reboots, you would need to have a reboot notifier in the MTD
lever, not in UBI. This notifier should:
1. Finish the current erase operation.
2. Prevent further erase operations.
The UBI patch is not a good solution.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
More information about the linux-mtd
mailing list