mtd: rawnand: stm32_fmc2: avoid to lock the CPU bus
authorChristophe Kerello <christophe.kerello@st.com>
Mon, 16 Dec 2019 09:01:55 +0000 (10:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:48:17 +0000 (19:48 +0100)
commitddd9320a5ab5319ec0093bc0f8ca383ead670af7
tree9a4f62f4755ecf99cbbbc451ab8807d8a4633dae
parentdb8cd32198d9680599c528201623bbae15f3f06a
mtd: rawnand: stm32_fmc2: avoid to lock the CPU bus

commit 4114b17af41272e14939b000ce8f3ed7ba937e3c upstream.

We are currently using nand_soft_waitrdy to poll the status of the NAND
flash. FMC2 enables the wait feature bit (this feature is mandatory for
the sequencer mode). By enabling this feature, we can't poll the status
of the NAND flash, the read status command is stucked in FMC2 pipeline
until R/B# signal is high, and locks the CPU bus.
To avoid to lock the CPU bus, we poll FMC2 ISR register. This register
reports the status of the R/B# signal.

Fixes: 2cd457f328c1 ("mtd: rawnand: stm32_fmc2: add STM32 FMC2 NAND flash controller driver")
Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/nand/raw/stm32_fmc2_nand.c