From linux-mtd at lists.infradead.org  Thu Dec 12 18:59:01 2013
From: linux-mtd at lists.infradead.org (Linux-MTD Mailing List)
Date: Thu, 12 Dec 2013 23:59:01 +0000
Subject: mtd: nand: pxa3xx: Use info->use_dma to release DMA resources
Message-ID: <E1VrG9l-0004KX-8s@bombadil.infradead.org>

Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=15b540c71cac840f0a3e8b1b4b7a773deb847ffb
Commit:     15b540c71cac840f0a3e8b1b4b7a773deb847ffb
Parent:     9c59ac616137fb62f6cb3f1219201b09cbcf30be
Author:     Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
AuthorDate: Tue Dec 10 09:57:15 2013 -0300
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Dec 12 15:02:04 2013 -0800

    mtd: nand: pxa3xx: Use info->use_dma to release DMA resources
    
    In commit:
    
      commit 62e8b851783138a11da63285be0fbf69530ff73d
      Author: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
      Date:   Fri Oct 4 15:30:38 2013 -0300
    
      mtd: nand: pxa3xx: Allocate data buffer on detected flash size
    
    the way the buffer is allocated was changed: the first READ_ID is issued
    with a small kmalloc'ed buffer. Only once the flash page size is detected
    the DMA buffers are allocated, and info->use_dma is set.
    
    Currently, if the device detection fails, the driver checks the 'use_dma'
    module parameter and tries to release unallocated DMA resources.
    
    Fix this by checking the proper indicator of the DMA allocation, which
    is 'info->use_dma'.
    
    Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index f3d4fea..4b3aaa8 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -962,7 +962,7 @@ static int pxa3xx_nand_init_buff(struct pxa3xx_nand_info *info)
 static void pxa3xx_nand_free_buff(struct pxa3xx_nand_info *info)
 {
 	struct platform_device *pdev = info->pdev;
-	if (use_dma) {
+	if (info->use_dma) {
 		pxa_free_dma(info->data_dma_ch);
 		dma_free_coherent(&pdev->dev, info->buf_size,
 				  info->data_buff, info->data_buff_phys);


From linux-mtd at lists.infradead.org  Thu Dec 12 18:59:01 2013
From: linux-mtd at lists.infradead.org (Linux-MTD Mailing List)
Date: Thu, 12 Dec 2013 23:59:01 +0000
Subject: Partially revert "mtd: nand: pxa3xx: Introduce 'marvell,
 armada370-nand' compatible string"
Message-ID: <E1VrG9l-0004KA-7s@bombadil.infradead.org>

Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=9c59ac616137fb62f6cb3f1219201b09cbcf30be
Commit:     9c59ac616137fb62f6cb3f1219201b09cbcf30be
Parent:     6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae
Author:     Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
AuthorDate: Mon Dec 9 18:36:26 2013 -0300
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Dec 12 15:01:30 2013 -0800

    Partially revert "mtd: nand: pxa3xx: Introduce 'marvell,armada370-nand' compatible string"
    
    This partially reverts c0f3b8643a6fa2461d70760ec49d21d2b031d611.
    
    The "armada370-nand" compatible support is not complete, and it was mistake
    to add it. Revert it and postpone the support until the infrastructure is
    in place.
    
    Cc: <stable at vger.kernel.org> # 3.12
    Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
    Acked-by: Jason Cooper <jason at lakedaemon.net>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 4cabdc9..f3d4fea 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1259,10 +1259,6 @@ static struct of_device_id pxa3xx_nand_dt_ids[] = {
 		.compatible = "marvell,pxa3xx-nand",
 		.data       = (void *)PXA3XX_NAND_VARIANT_PXA,
 	},
-	{
-		.compatible = "marvell,armada370-nand",
-		.data       = (void *)PXA3XX_NAND_VARIANT_ARMADA370,
-	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, pxa3xx_nand_dt_ids);


