Re: [RFC v3 4/7] dmaengine: Add slave DMA interface

From: Dan Williams
Date: Sat Feb 16 2008 - 15:07:12 EST


On Feb 15, 2008 2:53 AM, Haavard Skinnemoen
<hskinnemoen@xxxxxxxxxxxxxxxx> wrote:
> On Wed, 13 Feb 2008 20:24:02 +0100
> Haavard Skinnemoen <hskinnemoen@xxxxxxxxx> wrote:
>
> > But looking at your latest patch series, I guess we can use the new
> > "next" field instead. It's not like we really need the full
> > capabilities of list_head.
>
> On second thought, if we do this, we would be using the "next" field in
> an undocumented way. It is currently documented as follows:
>
> * @next: at completion submit this descriptor
>
> But that's not how we're going to use it when doing slave transfers:
> We're using it to keep track of all the descriptors that have already
> been submitted.
>
> I think it would actually be better to go the other way and have the
> async_tx API extend the descriptor as well for its private fields. That
> way, we get the pointer we need, but we can document it differently.
>
> So how about we do something along the lines of the patch below? We
> need to update all the users too of course, but apart from making the
> dma_slave_descriptor struct smaller, I don't think it will change the
> actual memory layout at all.
>

I like the direction of the patch, i.e. splitting out separate
functionality into separate structs. However, I do not want to break
the model of clients sourcing the operations and drivers sinking them
which dma_slave_descriptor appears to do. How about adding a
scatterlist pointer and an 'unmap_type' to the common descriptor?
Where unmap_type selects between, page, single, sg, or no-unmap.
Drivers already know the length and direction.

Regards,
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/