diff options
author | Barry Song <barry.song@analog.com> | 2010-08-05 11:07:38 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-08-05 11:14:54 -0400 |
commit | d2350c2ab51df7088d3db73a4c85ad73ded37a01 (patch) | |
tree | d06f9e54f97f799097d220f66c23b0eab146c2ad /drivers/mtd | |
parent | 44299179c0e87cc6d8b753c1ca8c97b1cf9340e1 (diff) |
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@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | 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 3784f4137994..a382e3dd0a5d 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, | |||
215 | */ | 215 | */ |
216 | static int bf5xx_nand_devready(struct mtd_info *mtd) | 216 | static int bf5xx_nand_devready(struct mtd_info *mtd) |
217 | { | 217 | { |
218 | unsigned short val = bfin_read_NFC_IRQSTAT(); | 218 | unsigned short val = bfin_read_NFC_STAT(); |
219 | 219 | ||
220 | if ((val & NBUSYIRQ) == NBUSYIRQ) | 220 | if ((val & NBUSY) == NBUSY) |
221 | return 1; | 221 | return 1; |
222 | else | 222 | else |
223 | return 0; | 223 | return 0; |