mtd: nand: set correct length to FBCR for a non-full-page write

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jan 9 13:59:06 EST 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e32de766c2eb65f775438dd6d8ec5007619d2fe5
Commit:     e32de766c2eb65f775438dd6d8ec5007619d2fe5
Parent:     a9a552f0bf6258c3593e8887c7212f0fbec8b44c
Author:     Liu Shuo <b35362 at freescale.com>
AuthorDate: Sun Dec 4 12:31:37 2011 +0800
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Jan 9 18:13:18 2012 +0000

    mtd: nand: set correct length to FBCR for a non-full-page write
    
    When we do a non-full-page write, the length be set to FBCR should
    not be 'elbc_fcm_ctrl->index', it should be 'elbc_fcm_ctrl->index -
    elbc_fcm_ctrl->column'.
    
    Signed-off-by: Liu Shuo <b35362 at freescale.com>
    Signed-off-by: Li Yang <leoli at freescale.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/fsl_elbc_nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index c554c2f..7db573e 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -467,7 +467,8 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
 		 */
 		if (elbc_fcm_ctrl->oob || elbc_fcm_ctrl->column != 0 ||
 		    elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize)
-			out_be32(&lbc->fbcr, elbc_fcm_ctrl->index);
+			out_be32(&lbc->fbcr,
+				elbc_fcm_ctrl->index - elbc_fcm_ctrl->column);
 		else
 			out_be32(&lbc->fbcr, 0);
 



More information about the linux-mtd-cvs mailing list