Re: [RFC][PATCH] DMA: Expand dmaengine implementation for more DMACs
From: Dan Williams
Date: Wed Jul 11 2007 - 12:43:59 EST
On 7/3/07, Peter Pearse <peter.pearse@xxxxxxx> wrote:
Hi,
The existing DMAC used by the dmaengine API (Intel IOAT) assumes all
possible clients can use any available DMA channel.
Some other DMACs restrict particular peripherals to particular DMA channels.
The patch below (against v2.6.22-rc7) extends the dmaengine implementation
to allow such DMACs to differentiate between clients.
Hi Peter,
Have a look at:
http://marc.info/?l=linux-raid&m=118290909528910&w=2
http://marc.info/?l=linux-raid&m=118290909523734&w=2
It seems your requirement could be satisfied by a natural extension of
the 'dma_cap_mask' implementation. 'dma_cap_mask' allows clients to
only be notified of channels that meet a certain capability profile.
However since your driver is pretty much guaranteed to be the only
dmaengine driver in the system you can safely do something like the
following in your client callback:
static enum dma_state_client
my_dma_client_callback(struct dma_client *client,
struct dma_chan *chan, enum dma_state state)
{
struct dma_device *dma_dev;
struct my_platform_specific_dma *plat_dma_dev;
dma_dev = chan->device;
plat_dma_dev = container_of(dma_dev, struct my_platform_specific_dma, dma_dev);
if (!plat_dma_dev->platform_specific_capability)
return DMA_DUP;
. . .
}
Regards
Peter Pearse
--
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/