lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <r2re9c3a7c21004141540o90fcbb07ja92dffcd71364f8b@mail.gmail.com>
Date:	Wed, 14 Apr 2010 15:40:02 -0700
From:	Dan Williams <dan.j.williams@...el.com>
To:	Linus Walleij <linus.walleij@...ricsson.com>
Cc:	akpm@...ux-foundation.org,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Grant Likely <grant.likely@...retlab.ca>,
	linux-arm-kernel@...ts.infradead.org, linux-mmc@...r.kernel.org,
	STEricsson_nomadik_linux@...t.st.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/11] ARM: add generic PrimeCell interface to COH 901 318 
	v5

Hi Linus,

On Wed, Apr 7, 2010 at 4:12 PM, Linus Walleij
<linus.walleij@...ricsson.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@...ricsson.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ