From: Barry Song Date: Thu, 5 Aug 2010 15:07:41 +0000 (-0400) Subject: mtd: Blackfin NFC: wait for the ECC reset to finish X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=752b957a37ee1cc09fccb39a8bc5843edf32119b;p=mv-sheeva.git mtd: Blackfin NFC: wait for the ECC reset to finish When resetting the ECC registers/counters, the bit will automatically clear itself once the reset has actually finished. So make sure we wait for that to occur before doing anything else rather than assuming everything is peachy and proceeding with stale ECC values. Signed-off-by: Barry Song Signed-off-by: Mike Frysinger Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c index d48cc39afc2..8070ff359a4 100644 --- a/drivers/mtd/nand/bf5xx_nand.c +++ b/drivers/mtd/nand/bf5xx_nand.c @@ -507,6 +507,8 @@ static void bf5xx_nand_dma_rw(struct mtd_info *mtd, */ bfin_write_NFC_RST(ECC_RST); SSYNC(); + while (bfin_read_NFC_RST() & ECC_RST) + cpu_relax(); disable_dma(CH_NFC); clear_dma_irqstat(CH_NFC);