OSDN Git Service

mtd: rawnand: fsmc: Keep bank enable bit set
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 9 Jan 2019 21:51:44 +0000 (22:51 +0100)
committerBoris Brezillon <bbrezillon@kernel.org>
Tue, 15 Jan 2019 17:29:53 +0000 (18:29 +0100)
commit663ec3a2c2d02775bc723b20a1af33262f790f50
tree7f08f12b0668c80c07379fe45a7dd57548ff5f6a
parent1c7fc5cbc33980acd13d668f1c8f0313d6ae9fd8
mtd: rawnand: fsmc: Keep bank enable bit set

Hammering the "bank enable" (PBKEN) bit on and off between
every command crashes the Nomadik NHK15 with this message:

Scanning device for bad blocks
Unhandled fault: external abort on non-linefetch (0x008) at 0xcc95e000
pgd = (ptrval)
[cc95e000] *pgd=0b808811, *pte=40000653, *ppte=40000552
Internal error: : 8 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.20.0-rc2+ #72
Hardware name: Nomadik STn8815
PC is at fsmc_exec_op+0x194/0x204
(...)

After a discussion we (me and Boris Brezillon) start to suspect
that this bit does not immediately control the chip select line
at all, it rather enables access to the bank and the hardware
will drive the CS autonomously. If there is a NAND chip connected,
we should keep this enabled.

As fsmc_nand_setup() sets this bit, we can simply remove the
offending code.

Fixes: 550b9fc4e3af ("mtd: rawnand: fsmc: Stop implementing ->select_chip()")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
drivers/mtd/nand/raw/fsmc_nand.c