aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-07-08 14:58:21 -0400
committerDan Williams <dan.j.williams@intel.com>2008-07-08 14:58:21 -0400
commit7cc5bf9a3a84e5a02e23e5739fb894790b37c101 (patch)
treeb526b348ed1b64884bf672924540bb5dc29cb211 /include/linux
parent9c402f4e196290692d998b188f9094deb1619e57 (diff)
dmaengine: track the number of clients using a channel
Haavard's dma-slave interface would like to test for exclusive access to a channel. The standard channel refcounting is not sufficient in that it tracks more than just client references, it is also inaccurate as reference counts are percpu until the channel is removed. This change also enables a future fix to deallocate resources when a client declines to use a capable channel. Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dmaengine.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index d08a5c5eb928..6432b8343220 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -139,6 +139,7 @@ struct dma_chan_percpu {
139 * @rcu: the DMA channel's RCU head 139 * @rcu: the DMA channel's RCU head
140 * @device_node: used to add this to the device chan list 140 * @device_node: used to add this to the device chan list
141 * @local: per-cpu pointer to a struct dma_chan_percpu 141 * @local: per-cpu pointer to a struct dma_chan_percpu
142 * @client-count: how many clients are using this channel
142 */ 143 */
143struct dma_chan { 144struct dma_chan {
144 struct dma_device *device; 145 struct dma_device *device;
@@ -154,6 +155,7 @@ struct dma_chan {
154 155
155 struct list_head device_node; 156 struct list_head device_node;
156 struct dma_chan_percpu *local; 157 struct dma_chan_percpu *local;
158 int client_count;
157}; 159};
158 160
159#define to_dma_chan(p) container_of(p, struct dma_chan, dev) 161#define to_dma_chan(p) container_of(p, struct dma_chan, dev)