]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
mtd: Blackfin NFC: fix nand busy detection
authorBarry Song <barry.song@analog.com>
Thu, 5 Aug 2010 15:07:38 +0000 (11:07 -0400)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 5 Aug 2010 15:14:54 +0000 (16:14 +0100)
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>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/bf5xx_nand.c

index 3784f4137994958a92a1e1a2a92a146d90fb053f..a382e3dd0a5dc8cdcddc2fc5f0b993c3badadd33 100644 (file)
@@ -215,9 +215,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;
        else
                return 0;