LPC32xx and MMCI driver

Russell King - ARM Linux linux at arm.linux.org.uk
Sat Dec 22 16:24:57 EST 2012


On Thu, Dec 20, 2012 at 11:06:15AM +0100, Gabriele Mondada wrote:
> @@ -385,6 +385,7 @@ static void pl08x_start_next_txd(struct  
> pl08x_dma_chan *plchan)
>      while ((val & PL080_CONFIG_ACTIVE) || (val & PL080_CONFIG_ENABLE))
>          val = readl(phychan->base + PL080_CH_CONFIG);
>
> +    /* TODO: why val and not txd->ccfg ? */
>      writel(val | PL080_CONFIG_ENABLE, phychan->base + PL080_CH_CONFIG);

We've written txd->ccfg to the register.  We've read the register back
into val, waiting for bits to change.  Should we write back the latest
value we've read back from the register or the old one?

> +#ifdef CONFIG_ARCH_LPC32XX
> +/*
> + * This exported function is used by mmci driver to workaround a bug in the
> + * LPC32xx CPU.
> + */
> +void pl08x_force_dma_burst(struct dma_chan *chan)
> +{
> +    struct pl08x_dma_chan *plchan = to_pl08x_chan(chan);
> +    struct pl08x_driver_data *pl08x = plchan->host;
> +
> +    dev_dbg(&pl08x->adev->dev,
> +        "force burst signal=%d chan=%p plchan=%p\n",
> +        plchan->signal, chan, plchan);
> +    if (plchan->signal >= 0)
> +        writel(1 << plchan->signal, pl08x->base + PL080_SOFT_BREQ);
> +}
> +
> +EXPORT_SYMBOL_GPL(pl08x_force_dma_burst);

Eww.  This is really horrid and totally breaks software layering.

As for formatting in the patch, that's also horrid.  Extra tab
indentations, lines over 80 characters, and a hell of a lot of code
to fix this brokenness.

At least the first thing that needs to happen is to clean the patch up
so that it passes checkpatch.pl.



More information about the linux-arm-kernel mailing list