From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: LPC32xx and MMCI driver
Date: Sat, 22 Dec 2012 21:24:57 +0000 [thread overview]
Message-ID: <20121222212457.GJ14363@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <50D2E317.6000005@precidata.com>
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.
next prev parent reply other threads:[~2012-12-22 21:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <50D2E156.20707@precidata.com>
2012-12-20 10:06 ` LPC32xx and MMCI driver Gabriele Mondada
2012-12-20 10:43 ` Roland Stigge
2012-12-22 21:24 ` Russell King - ARM Linux [this message]
2013-01-23 10:32 ` Gabriele Mondada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121222212457.GJ14363@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox