mtd: Blackfin NFC: wait for the ECC reset to finish

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=752b957a37ee1cc09fccb39a8bc5843edf32119b
Commit:     752b957a37ee1cc09fccb39a8bc5843edf32119b
Parent:     00355b0baadf949f02ab7d3e2bd222e3fbcc72ee
Author:     Barry Song <barry.song at analog.com>
AuthorDate: Thu Aug 5 11:07:41 2010 -0400
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Aug 5 16:14:24 2010 +0100

    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 <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 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index d48cc39..8070ff3 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);



More information about the linux-mtd-cvs mailing list