[PATCH] mtd: cfi: Wait for Block Erase operation to finish

Paul Parsons lost.distance at yahoo.com
Thu Mar 1 12:53:54 EST 2012


--- On Thu, 1/3/12, Paul Parsons <lost.distance at yahoo.com> wrote:
> From: Paul Parsons <lost.distance at yahoo.com>
> Subject: Re: [PATCH] mtd: cfi: Wait for Block Erase operation to finish
> To: "Joakim Tjernlund" <joakim.tjernlund at transmode.se>
> Cc: linux-mtd at lists.infradead.org, dwmw2 at infradead.org, philipp.zabel at gmail.com
> Date: Thursday, 1 March, 2012, 17:38
> --- On Thu, 1/3/12, Paul Parsons
> <lost.distance at yahoo.com>
> wrote:
> > It seems to me that waiting for SR[7:6]=00 instead of
> just
> > SR.6=0 would:
> > 1. Have the same outcome.
> > 2. Be strictly within spec; SR[7:6] have been cleared
> > therefore the Erase
> > Resume command has been accepted.
> 
> Actually on second thoughts maybe not: if the erase has
> actually completed
> when we issue an Erase Resume command then SR.7 should read
> back as 1 and we
> end up looping forever. hmm...

OK, how about this:

1. Erase Suspend now checks SR.6, exactly as it *should* according to the
spec flowchart.

2. If SR.6=0 then the erase has already completed, and there is no need to set chip->erase_suspended or subsequently issue an Erase Resume command.

3. If an Erase Resume command is needed then we know that the erase has
not completed, therefore it should be safe to wait for SR[7:6]=00.



More information about the linux-mtd mailing list