From: Dan Williams <dan.j.williams@intel.com>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: akpm@linux-foundation.org,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Grant Likely <grant.likely@secretlab.ca>,
linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
STEricsson_nomadik_linux@list.st.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 05/11] ARM: add generic PrimeCell interface to COH 901 318 v5
Date: Wed, 14 Apr 2010 15:40:02 -0700 [thread overview]
Message-ID: <r2re9c3a7c21004141540o90fcbb07ja92dffcd71364f8b@mail.gmail.com> (raw)
In-Reply-To: <1270681973-5763-1-git-send-email-linus.walleij@stericsson.com>
Hi Linus,
On Wed, Apr 7, 2010 at 4:12 PM, Linus Walleij
<linus.walleij@stericsson.com> wrote:
> This extends the DMA engine driver for the COH 901 318 used in the
> U300 platform with the generic PrimeCell interface.
>
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
> drivers/dma/coh901318.c | 146 +++++++++++++++++++++++++++++++++++++++++++
> drivers/dma/coh901318_lli.c | 78 ++++++++++++++++++++++-
> 2 files changed, 221 insertions(+), 3 deletions(-)
>
[..]
> diff --git a/drivers/dma/coh901318_lli.c b/drivers/dma/coh901318_lli.c
> index 9f7e0e6..f37db49 100644
> --- a/drivers/dma/coh901318_lli.c
> +++ b/drivers/dma/coh901318_lli.c
> @@ -153,6 +153,39 @@ coh901318_lli_fill_memcpy(struct coh901318_pool *pool,
> lli->src_addr = src;
> lli->dst_addr = dst;
>
> + /*
> + * The DMA hardware will increase its pointer by 1,
> + * 2 or 4 bytes at a time depending on configuration.
> + * If using som oddly-aligned buffer this will cause
s/som/some/
> + * performance problems.
> + */
> +#if 0
> + ctrl_chained &= ~COH901318_CX_CTRL_SRC_BUS_SIZE_MASK;
> + ctrl_eom &= ~COH901318_CX_CTRL_SRC_BUS_SIZE_MASK;
> + ctrl_chained &= ~COH901318_CX_CTRL_DST_BUS_SIZE_MASK;
> + ctrl_eom &= ~COH901318_CX_CTRL_DST_BUS_SIZE_MASK;
> + if (src & 0x01) {
> + ctrl_chained |= COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS;
> + ctrl_eom |= COH901318_CX_CTRL_SRC_BUS_SIZE_8_BITS;
> + } else if (src & 0x02) {
> + ctrl_chained |= COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS;
> + ctrl_eom |= COH901318_CX_CTRL_SRC_BUS_SIZE_16_BITS;
> + } else {
> + ctrl_chained |= COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS;
> + ctrl_eom |= COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS;
> + }
> + if (dst & 0x01) {
> + ctrl_chained |= COH901318_CX_CTRL_DST_BUS_SIZE_8_BITS;
> + ctrl_eom |= COH901318_CX_CTRL_SRC_DST_SIZE_8_BITS;
> + } else if (dst & 0x02) {
> + ctrl_chained |= COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS;
> + ctrl_eom |= COH901318_CX_CTRL_DST_BUS_SIZE_16_BITS;
> + } else {
> + ctrl_chained |= COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS;
> + ctrl_eom |= COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS;
> + }
> +#endif
It looks like this bit twiddling code is duplicated three times. Can
it be moved to a static inline in a header file and hide the #if 0
there as well. I assume you want it for documentation purposes in
case someone in the future has an unaligned usage model?
--
Dan
prev parent reply other threads:[~2010-04-14 22:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-07 23:12 [PATCH 05/11] ARM: add generic PrimeCell interface to COH 901 318 v5 Linus Walleij
2010-04-14 22:40 ` Dan Williams [this message]
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=r2re9c3a7c21004141540o90fcbb07ja92dffcd71364f8b@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=STEricsson_nomadik_linux@list.st.com \
--cc=akpm@linux-foundation.org \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).