All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>, Dan Williams <djbw@fb.com>,
	linux-kernel@vger.kernel.org, grant.likely@secretlab.ca,
	eric.y.miao@gmail.com, linux@arm.linux.org.uk,
	haojian.zhuang@gmail.com, broonie@opensource.wolfsonmicro.com,
	chao.bi@intel.com,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH 07/11] spi/pxa2xx: add support for DMA engine
Date: Thu, 17 Jan 2013 12:39:13 +0200	[thread overview]
Message-ID: <20130117103913.GT2239@intel.com> (raw)
In-Reply-To: <CACRpkdb+W5Xiek24X00p+bY8CaeErfCWuLqGOfeVTXCsi1KJxw@mail.gmail.com>

On Thu, Jan 17, 2013 at 10:48:15AM +0100, Linus Walleij wrote:
> On Mon, Jan 7, 2013 at 11:44 AM, Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> 
> > In order to use DMA with this driver on non-PXA platforms we implement support
> > for the generic DMA engine API. This allows to use different DMA engines with
> > little or no modification to the driver.
> >
> > Request lines and channel numbers can be passed to the driver from the
> > platform specific data.
> >
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > ---
> >  drivers/spi/spi-pxa2xx.c       |  351 +++++++++++++++++++++++++++++++++++++++-
> >  include/linux/spi/pxa2xx_spi.h |    6 +
> 
> So if the other DMA implementation could go into spi-pxa2xx-pxadma.c
> this could be spi-pxa2xx-dma.c and they could use the common header
> file spi-pxa2xx-dma.h and then Kconfig select which one to compile.
> 
> Just a suggestion to get the driver more readable.

Yes, it makes perfect sense. I'll do that in the next version.

> > +       /*
> > +        * Some DMA controllers have problems transferring buffers that are
> > +        * not multiple of 4 bytes. So we truncate the transfer so that it
> > +        * is suitable for such controllers, and handle the trailing bytes
> > +        * manually after the DMA completes.
> > +        */
> > +       len = ALIGN(drv_data->len, 4);
> 
> This is actually a property of the DMA controller.

Right and this is not the proper place for this but I wasn't sure where to
put this information...

> struct dma_device already has this:
> 
>  * @copy_align: alignment shift for memcpy operations
>  * @xor_align: alignment shift for xor operations
>  * @pq_align: alignment shift for pq operations
>  * @fill_align: alignment shift for memset operations
> (...)
>         u8 copy_align;
>         u8 xor_align;
>         u8 pq_align;
>         u8 fill_align;
> 
> To align memcpy's on 4 bytes you can e.g. set .copy_align
> to 2.
> 
> So the syntax is number of shifts 1 << 2 = 4.
> 
> If slave transfers can expose the same type of property we should
> maybe introdyce .slave_align in the same manner so you don't have
> to assume the worst in the driver.

... so this sounds good to me.

  reply	other threads:[~2013-01-17 10:35 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 10:44 [PATCH 00/11] spi/pxa2xx: add Intel Lynxpoint SPI controller support Mika Westerberg
2013-01-07 10:44 ` [PATCH 01/11] spi/pxa2xx: allow building on a 64-bit kernel Mika Westerberg
2013-01-08  3:27   ` Eric Miao
2013-01-08 10:29     ` Mika Westerberg
2013-01-07 10:44 ` [PATCH 02/11] spi/pxa2xx: convert to the pump message infrastructure Mika Westerberg
2013-01-17  9:26   ` Linus Walleij
2013-01-07 10:44 ` [PATCH 03/11] spi/pxa2xx-pci: switch to use pcim_* interfaces Mika Westerberg
2013-01-08 10:59   ` Mark Brown
2013-01-07 10:44 ` [PATCH 04/11] spi/pxa2xx: embed the ssp_device to platform data Mika Westerberg
2013-01-07 10:44 ` [PATCH 05/11] spi/pxa2xx: make clock rate configurable from " Mika Westerberg
2013-01-08 11:02   ` Mark Brown
2013-01-08 12:41     ` Mika Westerberg
2013-01-08 13:10       ` Mark Brown
2013-01-08 21:33         ` Rafael J. Wysocki
2013-01-09 10:51           ` Mika Westerberg
2013-01-09 21:52             ` Rafael J. Wysocki
2013-01-10 10:00               ` Mika Westerberg
2013-01-09 12:25           ` Mark Brown
2013-01-09 22:07             ` Rafael J. Wysocki
2013-01-10  9:58               ` Mika Westerberg
2013-01-10 12:38                 ` Mika Westerberg
2013-01-10 12:54                   ` Rafael J. Wysocki
2013-01-10 12:51                     ` Mark Brown
2013-01-10 13:07                       ` Mika Westerberg
2013-01-10 13:23                         ` Rafael J. Wysocki
2013-01-10 13:33                           ` Mika Westerberg
2013-01-10 13:18                       ` Rafael J. Wysocki
2013-01-10 13:33                         ` Mark Brown
2013-01-10 13:58                           ` Mika Westerberg
2013-01-10 21:56                             ` Rafael J. Wysocki
2013-01-11 10:59                               ` Mark Brown
2013-01-10 13:08                     ` Mika Westerberg
2013-01-08 21:37     ` Rafael J. Wysocki
2013-01-07 10:44 ` [PATCH 06/11] spi/pxa2xx: use the private DMA API only when CONFIG_ARCH_PXA is set Mika Westerberg
2013-01-17  9:36   ` Linus Walleij
2013-01-17 10:00     ` Mika Westerberg
2013-01-07 10:44 ` [PATCH 07/11] spi/pxa2xx: add support for DMA engine Mika Westerberg
2013-01-17  9:48   ` Linus Walleij
2013-01-17 10:39     ` Mika Westerberg [this message]
2013-01-07 10:44 ` [PATCH 08/11] spi/pxa2xx: add support for runtime PM Mika Westerberg
2013-01-07 10:44 ` [PATCH 09/11] spi/pxa2xx: add support for SPI_LOOP Mika Westerberg
2013-01-07 10:44 ` [PATCH 10/11] spi/pxa2xx: add support for Intel Low Power Subsystem SPI Mika Westerberg
2013-01-07 10:44 ` [PATCH 11/11] spi/pxa2xx: add support for Lynxpoint SPI controllers Mika Westerberg

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=20130117103913.GT2239@intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=chao.bi@intel.com \
    --cc=djbw@fb.com \
    --cc=eric.y.miao@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=haojian.zhuang@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rafael.j.wysocki@intel.com \
    --cc=vinod.koul@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.