Re: How to cope with locked flash

Todd Poynor
2005-09-15T16:39:08Z

Konstantin Kletschke wrote:
> How do you people cope with flash devices that power up locked?
>
> I have intel K3 devices which are unlocked by flash_unlocke in the /etc/inittab
> while booting the system.
> However, if the fs was never mounted before the jffs2 hangs with this
> in an endless loop:
>
> jffs2_write_dirent in garbage_collect_dirent failed: -30
> Write of 43 bytes at 0x00363928 failed. returned -30, retlen 0
> Not marking the space at 0x00363928 as dirty because the flash driver returned retlen zero
>
> Is there any help to avoid this situation?

Sounds like your root fs is jffs2; if so I'd suggest using a read-only
partition for root (using fs such as cramfs), unlock writeable jffs2
partition from rc script, then mount jffs2. (It's probably a good thing
to allow access to system files while the writeable partition is being
erased/written anyhow, assuming there are multiple chips or the chips
handle concurrent reads/writes from different chip partitions.)

Some people hack the kernel to unlock writeable partitions during the
boot sequence. One of these days should look at adding flags to jffs2
to unlock the flash at mount time.

Hope that helps,

--
Todd