mtd: Blackfin NFC: fix nand busy detection
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Aug 5 11:59:01 EDT 2010
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d2350c2ab51df7088d3db73a4c85ad73ded37a01
Commit: d2350c2ab51df7088d3db73a4c85ad73ded37a01
Parent: 44299179c0e87cc6d8b753c1ca8c97b1cf9340e1
Author: Barry Song <barry.song at analog.com>
AuthorDate: Thu Aug 5 11:07:38 2010 -0400
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Aug 5 16:14:54 2010 +0100
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: Barry Song <barry.song at analog.com>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/nand/bf5xx_nand.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 3784f41..a382e3d 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -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;
More information about the linux-mtd-cvs
mailing list