mtd: Blackfin NFC: make sure to check NAND_ALE in cmd_ctrl

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=fd508da2208696db146cd1be2bb2e8b799f6e3a2
Commit:     fd508da2208696db146cd1be2bb2e8b799f6e3a2
Parent:     085d45fb5216c25b69103e5d861fabdc4389e221
Author:     Barry Song <barry.song at analog.com>
AuthorDate: Thu Aug 5 11:07:42 2010 -0400
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Aug 5 16:14:09 2010 +0100

    mtd: Blackfin NFC: make sure to check NAND_ALE in cmd_ctrl
    
    The NAND base may send some controls which are neither CLE nor ALE, so
    we need to explicitly check both instead of assuming things are always
    one or the other.  Otherwise, we sometimes send out illegal addresses
    to the NAND device.
    
    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, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index ca39819..5c999e0 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -203,7 +203,7 @@ static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd,
 
 	if (ctrl & NAND_CLE)
 		bfin_write_NFC_CMD(cmd);
-	else
+	else if (ctrl & NAND_ALE)
 		bfin_write_NFC_ADDR(cmd);
 	SSYNC();
 }



More information about the linux-mtd-cvs mailing list