lkml.org 
[lkml]   [2010]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] dma: Add timb-dma
From
On Thu, Mar 25, 2010 at 11:44 AM, Richard Röjfors
<richard.rojfors@pelagicore.com> wrote:
> Adds the support for the DMA engine withing the timberdale FPGA.
>
> The DMA channels are strict device to host, or host to device
> and can not be used for generic memcpy.
>
> Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
[..]
> +struct timb_dma_chan {
> +       struct dma_chan         chan;
> +       void __iomem            *membase;
> +       spinlock_t              lock; /* Used for mutual exclusion */

Please add some value to this comment. I can assume it protects all
list manipulations, anything non-obvious worth noting?

[..]
> +
> +static int td_fill_desc(struct timb_dma_chan *td_chan, u8 *dma_desc,
> +       struct scatterlist *sg, bool last)
> +{
> +       if (sg_dma_len(sg) > USHORT_MAX) {
> +               dev_err(chan2dev(&td_chan->chan), "Too big sg element\n");
> +               return -EINVAL;
> +       }
> +
> +       /* length must be word aligned */
> +       if (sg_dma_len(sg) % sizeof(u32)) {
> +               dev_err(chan2dev(&td_chan->chan), "Incorrect length: %d\n",
> +                       sg_dma_len(sg));
> +               return -EINVAL;
> +       }
> +
> +       dev_dbg(chan2dev(&td_chan->chan), "desc: %p, addr: %p\n",
> +               dma_desc, (void *)(int)sg_dma_address(sg));

That (int) cast is not needed, causes a compiler warning, and can be dropped.

Nice simple driver. You can just send a follow up patch to fix up
those minor issues. I've pushed it out to my 'next' branch [1].

--
Dan

git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx.git next
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-03-26 01:57    [W:0.032 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site