mtd: cfi_cmdset_0002: fix delayed error detection on HyperFlash
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thu, 31 Oct 2019 20:39:39 +0000 (23:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:57 +0000 (08:22 +0100)
commit1a05d8ba219dc4246fba4fbcabc90fd82e306f86
tree8ba62c273e06897d7648459d2885c207ed0e00d4
parent1883f6047d8cf7907e8fd8558e5dcb92f6d5db5d
mtd: cfi_cmdset_0002: fix delayed error detection on HyperFlash

commit c15995695ea971253ea9507f6732c8cd35384e01 upstream.

The commit 4844ef80305d ("mtd: cfi_cmdset_0002: Add support for polling
status register") added checking for the status register error bits into
chip_good() to only return 1 if these bits are 0s.  Unfortunately, this
means that polling using chip_good() always reaches a timeout condition
when erase or program failure bits are set. Let's fully delegate the task
of determining the error conditions to cfi_check_err_status() and make
chip_good() only look for the Device Ready/Busy condition.

Fixes: 4844ef80305d ("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>
drivers/mtd/chips/cfi_cmdset_0002.c