Patchwork [1/2] mtd: lpc32xx_slc: Adjust to pl08x DMA interface changes

login
register
mail settings
Submitter stigge@antcom.de
Date July 12, 2012, 12:22 p.m.
Message ID <1342095778-13403-2-git-send-email-stigge@antcom.de>
Download mbox | patch
Permalink /patch/170643/
State Accepted
Commit 314a15664e028e6bcafc03495cc492645d9df4df
Headers show

Comments

stigge@antcom.de - July 12, 2012, 12:22 p.m.
This patch adjusts the LPC32xx SLC NAND driver to the new pl08x DMA interface,
fixing the compile error resulting from changed pl08x structures.

Signed-off-by: Roland Stigge <stigge@antcom.de>

---

Applies to today's linux-next (integrated lpc32xx-next and dma branches which collide)

 drivers/mtd/nand/lpc32xx_slc.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
Alexandre Pereira da Silva - July 13, 2012, 12:52 p.m.
On Thu, Jul 12, 2012 at 9:22 AM, Roland Stigge <stigge@antcom.de> wrote:
> This patch adjusts the LPC32xx SLC NAND driver to the new pl08x DMA interface,
> fixing the compile error resulting from changed pl08x structures.
>
> Signed-off-by: Roland Stigge <stigge@antcom.de>

Acked-By: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

> ---
>
> Applies to today's linux-next (integrated lpc32xx-next and dma branches which collide)
>
>  drivers/mtd/nand/lpc32xx_slc.c |   13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c
> index 1719387..c8c1d06 100644
> --- a/drivers/mtd/nand/lpc32xx_slc.c
> +++ b/drivers/mtd/nand/lpc32xx_slc.c
> @@ -714,17 +714,6 @@ static int lpc32xx_nand_write_page_raw_syndrome(struct mtd_info *mtd,
>         return 0;
>  }
>
> -static bool lpc32xx_dma_filter(struct dma_chan *chan, void *param)
> -{
> -       struct pl08x_dma_chan *ch =
> -               container_of(chan, struct pl08x_dma_chan, chan);
> -
> -       /* In LPC32xx's PL080 DMA wiring, the SLC NAND DMA signal is #1 */
> -       if (ch->cd->min_signal == 1)
> -               return true;
> -       return false;
> -}
> -
>  static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
>  {
>         struct mtd_info *mtd = &host->mtd;
> @@ -732,7 +721,7 @@ static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
>
>         dma_cap_zero(mask);
>         dma_cap_set(DMA_SLAVE, mask);
> -       host->dma_chan = dma_request_channel(mask, lpc32xx_dma_filter, NULL);
> +       host->dma_chan = dma_request_channel(mask, pl08x_filter_id, "nand-slc");
>         if (!host->dma_chan) {
>                 dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
>                 return -EBUSY;
> --
> 1.7.10.4
>
Artem Bityutskiy - Aug. 15, 2012, 10:37 a.m.
On Thu, 2012-07-12 at 14:22 +0200, Roland Stigge wrote:
> This patch adjusts the LPC32xx SLC NAND driver to the new pl08x DMA interface,
> fixing the compile error resulting from changed pl08x structures.
> 
> Signed-off-by: Roland Stigge <stigge@antcom.de>

This patch breaks compilation:

ERROR: "pl08x_filter_id" [drivers/mtd/nand/lpc32xx_slc.ko] undefined!

Please, send a fix. The defconfig I used is attached.
stigge@antcom.de - Aug. 16, 2012, 8:46 a.m.
Hi,

On 08/15/2012 12:37 PM, Artem Bityutskiy wrote:
> On Thu, 2012-07-12 at 14:22 +0200, Roland Stigge wrote:
>> This patch adjusts the LPC32xx SLC NAND driver to the new pl08x
>> DMA interface, fixing the compile error resulting from changed
>> pl08x structures.
>> 
>> Signed-off-by: Roland Stigge <stigge@antcom.de>
> 
> This patch breaks compilation:
> 
> ERROR: "pl08x_filter_id" [drivers/mtd/nand/lpc32xx_slc.ko]
> undefined!
> 
> Please, send a fix. The defconfig I used is attached.

Thanks for the note. The issue happens on compiling lpc32xx_slc and
lpc32xx_mlc as a module. Caused by pl08x_filter_id not being exported.
Looking at other dma drivers, they have an EXPORT_SYMBOL() for this,
see also

drivers/dma/coh901318.c
drivers/dma/sirf-dma.c

Will post a respective adjustment for drivers/dma/amba-pl08x.c separately.

Roland
stigge@antcom.de - Aug. 16, 2012, 2:26 p.m.
Hi,

On 08/15/2012 12:37 PM, Artem Bityutskiy wrote:
> On Thu, 2012-07-12 at 14:22 +0200, Roland Stigge wrote:
>> This patch adjusts the LPC32xx SLC NAND driver to the new pl08x
>> DMA interface, fixing the compile error resulting from changed
>> pl08x structures.
>> 
>> Signed-off-by: Roland Stigge <stigge@antcom.de>
> 
> This patch breaks compilation:
> 
> ERROR: "pl08x_filter_id" [drivers/mtd/nand/lpc32xx_slc.ko]
> undefined!
> 
> Please, send a fix. The defconfig I used is attached.

Please see my just posted patches:

mtd: lpc32xx_slc: Make driver independent of AMBA DMA engine driver
mtd: lpc32xx_mlc: Make driver independent of AMBA DMA engine driver

This also fixes the above problem by getting rid of the reference to
pl08x_filter_id.

Thanks,

Roland

Patch

diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c
index 1719387..c8c1d06 100644
--- a/drivers/mtd/nand/lpc32xx_slc.c
+++ b/drivers/mtd/nand/lpc32xx_slc.c
@@ -714,17 +714,6 @@  static int lpc32xx_nand_write_page_raw_syndrome(struct mtd_info *mtd,
 	return 0;
 }
 
-static bool lpc32xx_dma_filter(struct dma_chan *chan, void *param)
-{
-	struct pl08x_dma_chan *ch =
-		container_of(chan, struct pl08x_dma_chan, chan);
-
-	/* In LPC32xx's PL080 DMA wiring, the SLC NAND DMA signal is #1 */
-	if (ch->cd->min_signal == 1)
-		return true;
-	return false;
-}
-
 static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
 {
 	struct mtd_info *mtd = &host->mtd;
@@ -732,7 +721,7 @@  static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
 
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);
-	host->dma_chan = dma_request_channel(mask, lpc32xx_dma_filter, NULL);
+	host->dma_chan = dma_request_channel(mask, pl08x_filter_id, "nand-slc");
 	if (!host->dma_chan) {
 		dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
 		return -EBUSY;