Re: [RESEND PATCH 1/2] mtd: spi-nor: Clear WEL bit when erase or program errors occur

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, March 9, 2020 5:04:53 PM EET John Garry wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> On 09/03/2020 10:15, Tudor.Ambarus@xxxxxxxxxxxxx wrote:
> > From: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
> > 
> > When an Erase or Program error occurs on a spansion/cypress or a
> > micron flash, the WEL bit remains set to one and should be cleared
> > with a WRDI command in order to protect against inadvertent writes
> > that can possible corrupt the contents of the memory.
> > 
> > Winbond, macronix, gd, etc., do not support the E_ERR and P_ERR bits in
> > the
> > Status Register and always clear the WEL bit regardless of the outcome
> > of the erase or page program operation (ex w25q40bw, MX25L25635E).
> > 
> > Issue a WRDI command when erase or page program errors occur.
> > 
> > Reported-by: John Garry <john.garry@xxxxxxxxxx>
> 
> Previously I would get this unlock complaint:
> 
> root@ubuntu:/home/john# flash_lock -l /dev/mtd0
> root@ubuntu:/home/john# sudo mtd_debug erase /dev/mtd0 0xf80000 4096
> [  167.458647] spi-nor spi-PRP0001:00: Erase operation failed.
> [  167.464248] spi-nor spi-PRP0001:00: Attempted to modify a protected
> sector.
> MEMERASE: Input/output error
> root@ubuntu:/home/john# flash_lock -u /dev/mtd0
> flash_lock: error!: could not unlock device: /dev/mtd0
> 
>              error 5 (Input/output error)
> 
> Now, no such issue. Thanks
> 
> Tested-by: John Garry <john.garry@xxxxxxxxxx>
> 
> > Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
> > ---
> > 
> >   drivers/mtd/spi-nor/spi-nor.c | 22 ++++++++++++++++++++++
> >   1 file changed, 22 insertions(+)

Rebased and applied on top of spi-nor/next. Thanks.
ta


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux