Re: Re-entrancy of flash erase/write

Robert Kaiser
2002-02-25T17:19:24Z

On Mon, 25 Feb 2002, David Woodhouse wrote:

>
> rob@sysgo.de said:
> > [David, OK to apply this ?]
>
> I'd rather it was done in the map driver's set_vpp function itself.
> Sometimes you have more than one map driver, because you have different
> regions of flash - but they all share the same Vpp control. In which case
> you need to do the counting in the map driver anyway.

Agreed. I'll modify the dilnetpc driver then.

>
>
> > I looked into this a little further: it seems that the erase
> > functions in cfi_cmdset_000?.c and amd_flash.c temporarily release the
> > chip->mutex while VPP is on. Won't that allow other threads to get
> > hold of the mutex and fiddle with VPP, possibly turning it off ?
>
> I see the possibility, but surely that would only _actually_ happen if we
> started to support writes during erase suspend? Otherwise, the only thing
> that should happen during an erase is a _read_, which doesn't set and clear
> vpp.

What mechanism is there to avoid writes during erase suspend ? I have
seen the problem in situations where the JFFS2 GC thread was erasing
while another process (tar in my case) was writing to a *different
partition* in the same chip. (Maybe that is a hint ?) Introducing the
set_vpp counter reliably solved this.

Rob

----------------------------------------------------------------
Robert Kaiser email: rkaiser@sysgo.de
SYSGO RTS GmbH
Am Pfaffenstein 14
D-55270 Klein-Winternheim / Germany fax: (49) 6136 9948-10