mtd: nand: pxa3xx: Set info->use_dma properly

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:04 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0a60d049812e959b43b0556ef5b914d0900b6283
Commit:     0a60d049812e959b43b0556ef5b914d0900b6283
Parent:     1b7192658a08f70df0f290634fd7cd2ecb629fc9
Author:     Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
AuthorDate: Tue May 14 08:15:21 2013 -0300
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 20:56:59 2013 +0100

    mtd: nand: pxa3xx: Set info->use_dma properly
    
    Currently, the variable info->use_dma is never set and always
    zero-valued which means the driver never does DMA transfers.
    We fix this by simply setting info->use_dma to the module parameter,
    also named 'use_dma'. Note that the module parameter has the same name,
    but different semantics.
    
    This fixes a regression introduced by the below commit
    which removed the info->use_dma variable set.
    
      commit 4eb2da8994042d68e84e31138788429a102da2ea
      Author: Lei Wen <leiwen at marvell.com>
      Date:   Mon Feb 28 10:32:13 2011 +0800
    
          mtd: pxa3xx_nand: unify prepare command
    
    Before the above commit, the driver had use_dma=1 on all NAND commands
    except on CMD_STATUS. This behavior is long lost and we are not
    recovering in this patch, either.
    
    This was spotted and verified by human inspection.
    
    Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
    Tested-by: Nikita Kiryanov <nikita at compulab.co.il>
    Acked-by: Igor Grinberg <grinberg at compulab.co.il>
    Reviewed-by: Haojian Zhuang <haojian.zhuang at gmail.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/pxa3xx_nand.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 14d3db5..cef1eeb 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -506,6 +506,7 @@ static int prepare_command_pool(struct pxa3xx_nand_info *info, int command,
 	info->buf_count		= 0;
 	info->oob_size		= 0;
 	info->use_ecc		= 0;
+	info->use_dma		= (use_dma) ? 1 : 0;
 	info->is_ready		= 0;
 	info->retcode		= ERR_NONE;
 	if (info->cs != 0)



More information about the linux-mtd-cvs mailing list