]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: marvell: fix the IRQ handler complete() condition
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 3 Oct 2018 09:05:04 +0000 (11:05 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 8 Oct 2018 08:00:10 +0000 (10:00 +0200)
commit1a55eb0c60f63fe82f8abe417d28106cf26039e8
tree8ce9f97053b29be2798a8ec1f64d278ba183d3ee
parent171cf53aeaa66cb827be7339c5b2d991ff042717
mtd: rawnand: marvell: fix the IRQ handler complete() condition

With the current implementation, the complete() in the IRQ handler is
supposed to be called only if the register status has one or the other
RDY bit set. Other events might trigger an interrupt as well if
enabled, but should not end-up with a complete() call.

For this purpose, the code was checking if the other bits were set, in
this case complete() was not called. This is wrong as two events might
happen in a very tight time-frame and if the NDSR status read reports
two bits set (eg. RDY(0) and RDDREQ) at the same time, complete() was
not called.

This logic would lead to timeouts in marvell_nfc_wait_op() and has
been observed on PXA boards (NFCv1) in the Hamming write path.

Fixes: 8cfde04381f0 ("mtd: nand: add reworked Marvell NAND controller driver")
Cc: stable@vger.kernel.org
Reported-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Daniel Mack <daniel@zonque.org>
drivers/mtd/nand/raw/marvell_nand.c