提交 d2350c2a 编写于 作者: B Barry Song 提交者: David Woodhouse

mtd: Blackfin NFC: fix nand busy detection

The IRQSTAT register is a W1C register used by the interrupt handler and
may have its BUSY bit changed.  This makes it somewhat unreliable for the
polling devready function.  So switch it over to use the BUSY bit in the
STAT register that always reflects the current state of the hardware.

This fixes driver hangs seen when the NAND flash is under heavy system
load (like I/O benchmarks).
Signed-off-by: NBarry Song <barry.song@analog.com>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 44299179
...@@ -215,9 +215,9 @@ static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd, ...@@ -215,9 +215,9 @@ static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd,
*/ */
static int bf5xx_nand_devready(struct mtd_info *mtd) static int bf5xx_nand_devready(struct mtd_info *mtd)
{ {
unsigned short val = bfin_read_NFC_IRQSTAT(); unsigned short val = bfin_read_NFC_STAT();
if ((val & NBUSYIRQ) == NBUSYIRQ) if ((val & NBUSY) == NBUSY)
return 1; return 1;
else else
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册