[PATCH 1/1] MTD: Unlocking all Intel flash that is locked on power up

Nicolas Pitre nico at cam.org
Tue Nov 13 14:02:22 EST 2007


On Tue, 13 Nov 2007, Jared Hulbert wrote:

> > Well, actually I just looked and the core already has the code to
> > auto-unlock flash when they have the MTD_STUPID_LOCK bit set.
> >
> > So... if one partition should _not_ be automatically unlocked, it just
> > has to put MTD_STUPID_LOCK in its flag_mask.  I'd have prefered if the
> > auto-unlock was explicitly enabled instead of its prevention, but
> > whatever.
> 
> Right, Justin is just extending that functionality which today only
> kicks in for one size of one chip family.

It probably should be enabled for all flash models which always power up 
locked.

> So to clarify the disagreement you feel the default behavior should be
> to have your writeable partitions default to locked, we feel the
> default behavior should be to have your writeable partitions default
> to unlocked.  Does that sum it up the core philshopical disagreement
> here?

Yes, although I don't feel so strongly about that remaining point.  I 
initially thought there was no way to prevent the auto-unlock besides 
marking the partition read-only as well.

> Actually there is a bit in struct cfi_pri_intelext.FeatureSupport&32
> that I _think_ tells us this is one of the flex lock parts that does
> the nonvolatile locking.  I'll have to confirm that.  That could be
> used in the function fixup_use_powerup_lock() in cfi_cmdset_0001.c to
> be more intelligent than just unlocking everything.  Would that be
> better?

Probably.  At least limiting the fixup only to the affected flash models 
(adding entries as necessary) is way better than the unconditional 
unlock for everything.


Nicolas



More information about the linux-mtd mailing list