diff mbox

[1/7] mtd: Blackfin NFC: fix nand busy detection

Message ID 1281020864-26842-1-git-send-email-vapier@gentoo.org
State Accepted
Commit d2350c2ab51df7088d3db73a4c85ad73ded37a01
Headers show

Commit Message

Mike Frysinger Aug. 5, 2010, 3:07 p.m. UTC
From: Barry Song <barry.song@analog.com>

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: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
 drivers/mtd/nand/bf5xx_nand.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff mbox


diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 2974995..f3e3e74 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -218,9 +218,9 @@  static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd,
 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 0;