All of lore.kernel.org
 help / color / mirror / Atom feed
* UBIFS on write-protected NAND
@ 2019-06-02 14:08 Leon Pollak
  2019-06-02 20:02 ` Richard Weinberger
  0 siblings, 1 reply; 7+ messages in thread
From: Leon Pollak @ 2019-06-02 14:08 UTC (permalink / raw)
  To: linux-mtd

I am sorry to disturb the list with the problem most probably already
solved ion later versions...

I am running Linux 2.6.32 from TI and my root FS is on NAND UBIFS.
Linux boots with command line:
root=ubi0:ubi_rootfs ro noinitrd ubi.mtd=4,2048 rootfstype=ubifs
Please, note the "ro" in the command line.
Also the HW write-protect line is always set to "protected" state.
UBIFS stays most of the time in write protected HW state (system
requirement) and RO mounted, except the very rare cases when some
update is required.

For this update purpose:
- HW write-protect is removed in SW;
- root FS is remounted to RW (mount -o remount,rw /);
- the change is performed;
- sync, sleep 3;
- mount -o,remount,ro / ;
- sleep 2, return HW write-protection;
- reboot.

For some unknown reason (may be you know?), sometimes something still
remains in journal and on the next boot we receive a bundle of error
messages with error codes -5 and -30. This happens despite the RO
state of the FS and effectively blocks all the system:
- after these errors detection, UBIFS switches to read-only state,
blocking any possible corrections/repairs.
- we can't remove HW protection to allow it to finish desired work as
it happens in the Linux boot, when initd is just starting.

Now, I suppose that this issue (that everything is RO and shouldn't be
tried to recover) is treated already in the new versions. My problem
is that I can't move to newer Linux because of TI HW.

So, my questions are:
1. Where in the code of UBI (UBIFS?) can I insert the HW write-protect
removal in order to allow the UBI/UBIFS to do its desired work?
2. When can I put write-protection back?

We already tested that when in this locked state, booting with NAND HW
unprotected repairs the problem. The issue is only where to do NAND
unlock/lock.

Many Thanks for any help.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-03 12:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-02 14:08 UBIFS on write-protected NAND Leon Pollak
2019-06-02 20:02 ` Richard Weinberger
2019-06-03  7:31   ` Leon Pollak
2019-06-03 11:11     ` Leon Pollak
2019-06-03 11:31       ` Richard Weinberger
2019-06-03 12:32     ` Steve deRosier
2019-06-03 12:58       ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.