Skip to content

Commit

Permalink
mtd: Blackfin NFC: fix nand busy detection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Barry Song authored and David Woodhouse committed Aug 5, 2010
1 parent 4429917 commit d2350c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/nand/bf5xx_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d2350c2

Please sign in to comment.