mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
mtd: cfi_cmdset_0002: only check errors when ready in cfi_check_err_status()
commit 72914a8cff7e1d910c58e125e15a0da409e3135f upstream.
Cypress S26K{L|S}P{128|256|512}S datasheet says that the error bits in
the status register are only valid when the "device ready" bit 7 is set.
Add the check for the device ready bit in cfi_check_err_status() as that
function isn't always called with this bit set.
Fixes: 4844ef8030 ("mtd: cfi_cmdset_0002: Add support for polling status register")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
acc5e1a86a
commit
1883f6047d
1 changed files with 4 additions and 0 deletions
|
|
@ -136,6 +136,10 @@ static void cfi_check_err_status(struct map_info *map, struct flchip *chip,
|
|||
cfi->device_type, NULL);
|
||||
status = map_read(map, adr);
|
||||
|
||||
/* The error bits are invalid while the chip's busy */
|
||||
if (!map_word_bitsset(map, status, CMD(CFI_SR_DRB)))
|
||||
return;
|
||||
|
||||
if (map_word_bitsset(map, status, CMD(0x3a))) {
|
||||
unsigned long chipstatus = MERGESTATUS(status);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue