[RFC][PATCH] DMA: Expand dmaengine implementation for more DMACs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Regards

Peter Pearse

---
From: Peter Pearse <[email protected]>

Pass client data down to the dmaengine DMAC implementation code.

Signed-off-by: Peter Pearse <[email protected]> 
---
diff -purN RFCbase/drivers/dma/dmaengine.c
RFCpatched/drivers/dma/dmaengine.c
--- RFCbase/drivers/dma/dmaengine.c	2007-07-02 09:38:15.124179000 +0100
+++ RFCpatched/drivers/dma/dmaengine.c	2007-07-03 15:16:45.550630000 +0100
@@ -146,7 +146,7 @@ static struct dma_chan *dma_client_chan_
 			if (chan->client)
 				continue;
 
-			desc =
chan->device->device_alloc_chan_resources(chan);
+			desc =
chan->device->device_alloc_chan_resources(chan, client);
 			if (desc >= 0) {
 				kref_get(&device->refcount);
 				kref_init(&chan->refcount);
diff -purN RFCbase/drivers/dma/ioatdma.c RFCpatched/drivers/dma/ioatdma.c
--- RFCbase/drivers/dma/ioatdma.c	2007-07-02 09:38:15.129184000 +0100
+++ RFCpatched/drivers/dma/ioatdma.c	2007-07-03 12:58:01.525560000 +0100
@@ -110,7 +110,7 @@ static struct ioat_desc_sw *ioat_dma_all
 static void ioat_start_null_desc(struct ioat_dma_chan *ioat_chan);
 
 /* returns the actual number of allocated descriptors */
-static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
+static int ioat_dma_alloc_chan_resources(struct dma_chan, struct dma_client
*client)
 {
 	struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
 	struct ioat_desc_sw *desc = NULL;
diff -purN RFCbase/include/linux/dmaengine.h
RFCpatched/include/linux/dmaengine.h
--- RFCbase/include/linux/dmaengine.h	2007-07-02 09:39:08.954261000 +0100
+++ RFCpatched/include/linux/dmaengine.h	2007-07-03
15:46:33.552608000 +0100
@@ -143,6 +143,8 @@ typedef void (*dma_event_callback) (stru
  * @event_callback: func ptr to call when something happens
  * @chan_count: number of chans allocated
  * @chans_desired: number of chans requested. Can be +/- chan_count
+ * @client_data: ptr to data which allows implementations to distinguish
+ *               between clients
  * @lock: protects access to the channels list
  * @channels: the list of DMA channels allocated
  * @global_node: list_head for global dma_client_list
@@ -151,6 +153,7 @@ struct dma_client {
 	dma_event_callback	event_callback;
 	unsigned int		chan_count;
 	unsigned int		chans_desired;
+	void *client_data;
 
 	spinlock_t		lock;
 	struct list_head	channels;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux