diff options
author | Luka Perkov <luka@openwrt.org> | 2014-02-11 02:07:41 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2014-02-11 02:07:41 +0000 |
commit | 3af779eb172b0438f77e8a01a97dd0eb9a146076 (patch) | |
tree | 23838dbde109e79f4c4763dbf78a983aeeefafe1 /target/linux/mvebu/patches-3.10/0106-mtd-nand-pxa3xx-Move-buffer-release-code-to-its-own-.patch | |
parent | 69d323f23119ce6986c2803f34d95869144a00e6 (diff) | |
download | mtk-20170518-3af779eb172b0438f77e8a01a97dd0eb9a146076.zip mtk-20170518-3af779eb172b0438f77e8a01a97dd0eb9a146076.tar.gz mtk-20170518-3af779eb172b0438f77e8a01a97dd0eb9a146076.tar.bz2 |
mvebu: backport mainline patches from kernel 3.12
This is a backport of the patches accepted to the Linux mainline related to
mvebu SoC (Armada XP and Armada 370) between Linux v3.11, and Linux v3.12.
This work mainly covers:
* Ground work for sharing the pxa nand driver(drivers/mtd/nand/pxa3xx_nand.c)
between the PXA family,and the Armada family.
* Further updates to the mvebu MBus.
* Work and ground work for enabling MSI on the Armada family.
* some phy / mdio bus initialization related work.
* Device tree binding documentation update.
Signed-off-by: Seif Mazareeb <seif.mazareeb@gmail.com>
CC: Luka Perkov <luka@openwrt.org>
SVN-Revision: 39565
Diffstat (limited to 'target/linux/mvebu/patches-3.10/0106-mtd-nand-pxa3xx-Move-buffer-release-code-to-its-own-.patch')
-rw-r--r-- | target/linux/mvebu/patches-3.10/0106-mtd-nand-pxa3xx-Move-buffer-release-code-to-its-own-.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-3.10/0106-mtd-nand-pxa3xx-Move-buffer-release-code-to-its-own-.patch b/target/linux/mvebu/patches-3.10/0106-mtd-nand-pxa3xx-Move-buffer-release-code-to-its-own-.patch new file mode 100644 index 0000000..b199fcf --- /dev/null +++ b/target/linux/mvebu/patches-3.10/0106-mtd-nand-pxa3xx-Move-buffer-release-code-to-its-own-.patch @@ -0,0 +1,66 @@ +From 49ff5bd7d4d51a8eb05796f130e9a1a96d18f522 Mon Sep 17 00:00:00 2001 +From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> +Date: Wed, 17 Apr 2013 13:38:14 -0300 +Subject: [PATCH 106/203] mtd: nand: pxa3xx: Move buffer release code to its + own function + +Create a function to release the buffer and the dma channel, thus undoing +what pxa3xx_nand_init_buff() did. This commit makes the code more readable +and will allow to handle non-DMA capable platforms easier. + +Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> +Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> +Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> +--- + drivers/mtd/nand/pxa3xx_nand.c | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +--- a/drivers/mtd/nand/pxa3xx_nand.c ++++ b/drivers/mtd/nand/pxa3xx_nand.c +@@ -912,6 +912,18 @@ static int pxa3xx_nand_init_buff(struct + return 0; + } + ++static void pxa3xx_nand_free_buff(struct pxa3xx_nand_info *info) ++{ ++ struct platform_device *pdev = info->pdev; ++ if (use_dma) { ++ pxa_free_dma(info->data_dma_ch); ++ dma_free_coherent(&pdev->dev, MAX_BUFF_SIZE, ++ info->data_buff, info->data_buff_phys); ++ } else { ++ kfree(info->data_buff); ++ } ++} ++ + static int pxa3xx_nand_sensing(struct pxa3xx_nand_info *info) + { + struct mtd_info *mtd; +@@ -1137,12 +1149,7 @@ static int alloc_nand_resource(struct pl + + fail_free_buf: + free_irq(irq, info); +- if (use_dma) { +- pxa_free_dma(info->data_dma_ch); +- dma_free_coherent(&pdev->dev, MAX_BUFF_SIZE, +- info->data_buff, info->data_buff_phys); +- } else +- kfree(info->data_buff); ++ pxa3xx_nand_free_buff(info); + fail_disable_clk: + clk_disable_unprepare(info->clk); + return ret; +@@ -1163,12 +1170,7 @@ static int pxa3xx_nand_remove(struct pla + irq = platform_get_irq(pdev, 0); + if (irq >= 0) + free_irq(irq, info); +- if (use_dma) { +- pxa_free_dma(info->data_dma_ch); +- dma_free_writecombine(&pdev->dev, MAX_BUFF_SIZE, +- info->data_buff, info->data_buff_phys); +- } else +- kfree(info->data_buff); ++ pxa3xx_nand_free_buff(info); + + clk_disable_unprepare(info->clk); + |