mxc_nand: Do not do byte accesses to the NFC buffer.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Sep 13 04:59:02 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f7b66e5e51d31c45c6039db9a6da7863fb75be1e
Commit:     f7b66e5e51d31c45c6039db9a6da7863fb75be1e
Parent:     76be97c1fc945db08aae1f1b746012662d643e97
Author:     John Ogness <john.ogness at linutronix.de>
AuthorDate: Fri Jun 18 18:59:47 2010 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Aug 27 00:29:09 2010 +0100

    mxc_nand: Do not do byte accesses to the NFC buffer.
    
    This patch avoids byte access to the NFC buffer. Byte access to the
    NFC is not allowed.
    
    The patch is against linux-next 20100618.
    
    Signed-off-by: John Ogness <john.ogness at linutronix.de>
    Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
    Tested-by: John Ogness <john.ogness at linutronix.de>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/mxc_nand.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index fcf8ceb..26caa01 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -402,16 +402,16 @@ static void send_read_id_v1_v2(struct mxc_nand_host *host)
 	/* Wait for operation to complete */
 	wait_op_done(host, true);
 
+	memcpy(host->data_buf, host->main_area0, 16);
+
 	if (this->options & NAND_BUSWIDTH_16) {
-		void __iomem *main_buf = host->main_area0;
 		/* compress the ID info */
-		writeb(readb(main_buf + 2), main_buf + 1);
-		writeb(readb(main_buf + 4), main_buf + 2);
-		writeb(readb(main_buf + 6), main_buf + 3);
-		writeb(readb(main_buf + 8), main_buf + 4);
-		writeb(readb(main_buf + 10), main_buf + 5);
+		host->data_buf[1] = host->data_buf[2];
+		host->data_buf[2] = host->data_buf[4];
+		host->data_buf[3] = host->data_buf[6];
+		host->data_buf[4] = host->data_buf[8];
+		host->data_buf[5] = host->data_buf[10];
 	}
-	memcpy(host->data_buf, host->main_area0, 16);
 }
 
 static uint16_t get_dev_status_v3(struct mxc_nand_host *host)



More information about the linux-mtd-cvs mailing list