Re: latest mtd changes broke collie

From: Ian Campbell
Date: Fri Nov 11 2005 - 02:01:56 EST


On Fri, 2005-11-11 at 01:16 +0100, Pavel Machek wrote:
> Hi!
>
> > >With these hacks, I'm able to mount flash at least read-only. On
> > >attempt to remount read-write, I get
> > >
> > >"Write error in obliterating obsoleted node at 0x00bc0000: -30
> > >...
> > >Erase at 0x00c00000 failed immediately: -EROFS. Is the sector locked?"
> > >
> > >Is it good news?
> >
> > I see the old sharp driver has a normally-not-defined AUTOUNLOCK symbol
> > that would enable some code to unlock blocks before writing/erasing
> > (which isn't recommended since the code doesn't know the policy on
> > whether the block is supposed to be locked). The tree previously in use
> > may have had something similar setup. It seems these flashes have all
> > blocks locked by default at power up.
>
> Is there some quick hack I can do in kernel to unlock it?

I use the following on my device:

mtd = do_map_probe(...);

if (!mtd) { ...err... }

mtd->owner = THIS_MODULE;

mtd->unlock(mtd,0,mtd->size);

> Is it possible to accidentally unlock "BIOS" area and brick the device?

Yep, but you could modify the parameters to unlock to no do so.
Depending on you partitioning scheme you might be able to use that to
figure out what to unlock...

Ian.

--
Ian Campbell

The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
-- Isaac Asimov

Attachment: signature.asc
Description: This is a digitally signed message part