OSDN Git Service

mtd: spi-nor: check FSR error bits for Micron memories
authorBean Huo (beanhuo) <beanhuo@micron.com>
Mon, 4 Dec 2017 12:34:47 +0000 (12:34 +0000)
committerCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Tue, 12 Dec 2017 23:36:00 +0000 (00:36 +0100)
commit20ccb993f29bd6ad17699dd0b349db086e3ca719
tree973615108d678dc46e483299d4ed856dc925c145
parent6d17969c8eb454116d906005a6c4752f4f560b26
mtd: spi-nor: check FSR error bits for Micron memories

For Micron spi nor device, when erase/program operation
fails, especially the failure results from intending to
modify protected space, spi-nor upper layers still get
the return which shows the operation succeeds. This is
because current spi_nor_fsr_ready() only uses FSR bit.7
(flag status register) to check device whether ready.
This patch fixes this issue by checking relevant error
bits in FSR.
The FSR is a powerful tool to investigate the status of
device, checking information regarding what the memory is
actually doing and detecting possible error conditions.

Signed-off-by: beanhuo <beanhuo@micron.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
drivers/mtd/spi-nor/spi-nor.c
include/linux/mtd/spi-nor.h