Re: dmaengine.c: question about device_alloc_chan_resources

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Guennadi Liakhovetski
Date: Sunday, September 21, 2008 - 12:50 pm

On Sun, 21 Sep 2008, Haavard Skinnemoen wrote:


This is how it is documented in dmaengine.h:

 * @slave: data for preparing slave transfer. Must be non-NULL iff the
 *  DMA_SLAVE capability is requested.

But, looking at dma_client_chan_alloc() it seems, any client requesting a 
channel can provide a slave and link it to a specific dma_dev, regardless 
what capabilities the client is requesting, or am I missing something? If 
so, then yes, please, let's allow all do this. Wouldn't it be better to 
move the .dma_dev member to dma_client?


As far as I understand, this extension can only be done by "wrapping" 
dma_slave with driver-specific data:

 * If dma_dev is non-NULL, the client can not be bound to other DMA
 * masters than the one corresponding to this device. The DMA master
 * driver may use this to determine if there is controller-specific
 * data wrapped around this struct. Drivers of platform code that sets
 * the dma_dev field must therefore make sure to use an appropriate
 * controller-specific dma slave structure wrapping this struct.

i.e., there is no "void *priv" or similar. So, the same "wrapping" can be 
used with dma_client, even more conveniently so, if we move .dma_dev into 
it.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: dmaengine.c: question about device_alloc_chan_resources, Haavard Skinnemoen, (Thu Sep 18, 7:28 am)
Re: dmaengine.c: question about device_alloc_chan_resources, Haavard Skinnemoen, (Thu Sep 18, 7:45 am)
Re: dmaengine.c: question about device_alloc_chan_resources, Haavard Skinnemoen, (Thu Sep 18, 8:00 am)
Re: dmaengine.c: question about device_alloc_chan_resources, Haavard Skinnemoen, (Fri Sep 19, 4:25 am)
Re: dmaengine.c: question about device_alloc_chan_resources, linux-os (Dick Johnson), (Fri Sep 19, 7:50 am)
Re: dmaengine.c: question about device_alloc_chan_resources, Haavard Skinnemoen, (Sun Sep 21, 2:26 am)
Re: dmaengine.c: question about device_alloc_chan_resources, Guennadi Liakhovetski, (Sun Sep 21, 12:50 pm)
Re: dmaengine.c: question about device_alloc_chan_resources, Haavard Skinnemoen, (Mon Sep 22, 12:44 am)