summaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-2.6.18/dmac-add-explicit-blockcount-to-dma_request_sg.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/linux-2.6.18/dmac-add-explicit-blockcount-to-dma_request_sg.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/linux-2.6.18/dmac-add-explicit-blockcount-to-dma_request_sg.patch')
-rw-r--r--recipes/linux/linux-2.6.18/dmac-add-explicit-blockcount-to-dma_request_sg.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.18/dmac-add-explicit-blockcount-to-dma_request_sg.patch b/recipes/linux/linux-2.6.18/dmac-add-explicit-blockcount-to-dma_request_sg.patch
new file mode 100644
index 0000000000..54400aeff1
--- /dev/null
+++ b/recipes/linux/linux-2.6.18/dmac-add-explicit-blockcount-to-dma_request_sg.patch
@@ -0,0 +1,66 @@
+From nobody Mon Sep 17 00:00:00 2001
+From: Haavard Skinnemoen <hskinnemoen@atmel.com>
+Date: Sun, 14 Jan 2007 19:07:06 +0100
+Subject: [DW DMAC] Add nr_blocks field to struct dma_request_sg
+
+Allow drivers to specify how many blocks to transfer in a sg request.
+The number of blocks will no longer be automatically calculated based
+on the scatterlist because this doesn't always correspond with the
+desired amount of data to be transferred.
+
+Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
+---
+ arch/avr32/drivers/dw-dmac.c | 13 ++++++-------
+ include/asm-avr32/dma-controller.h | 1 +
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+Index: linux-2.6.18-avr32/include/asm-avr32/dma-controller.h
+===================================================================
+--- linux-2.6.18-avr32.orig/include/asm-avr32/dma-controller.h 2007-01-15 15:34:32.000000000 +0100
++++ linux-2.6.18-avr32/include/asm-avr32/dma-controller.h 2007-01-15 15:34:50.000000000 +0100
+@@ -36,6 +36,7 @@ struct dma_request_sg {
+ int nr_sg;
+ struct scatterlist *sg;
+ unsigned long block_size;
++ unsigned int nr_blocks;
+
+ dma_addr_t data_reg;
+ unsigned short periph_id;
+Index: linux-2.6.18-avr32/arch/avr32/drivers/dw-dmac.c
+===================================================================
+--- linux-2.6.18-avr32.orig/arch/avr32/drivers/dw-dmac.c 2007-01-15 15:35:00.000000000 +0100
++++ linux-2.6.18-avr32/arch/avr32/drivers/dw-dmac.c 2007-01-15 15:35:03.000000000 +0100
+@@ -176,7 +176,8 @@ static int dmac_prepare_request_sg(struc
+ struct dw_dma_channel *chan;
+ unsigned long ctlhi, ctllo, cfghi, cfglo;
+ unsigned long block_size;
+- int ret, i, nr_blocks, direction;
++ unsigned int nr_blocks;
++ int ret, i, direction;
+ unsigned long flags;
+
+ spin_lock_irqsave(&dmac->lock, flags);
+@@ -215,12 +216,9 @@ static int dmac_prepare_request_sg(struc
+ * Each block will get its own Linked List Item (LLI) below.
+ */
+ block_size = req->block_size;
+- pr_debug("block_size = %lu, nr_sg = %u\n", block_size, req->nr_sg);
+- for (i = 0, nr_blocks = 0; i < req->nr_sg; i++) {
+- pr_debug("sg[i].length = %u\n", req->sg[i].length);
+- BUG_ON(req->sg[i].length % block_size);
+- nr_blocks += req->sg[i].length / block_size;
+- }
++ nr_blocks = req->nr_blocks;
++ pr_debug("block_size %lu, nr_blocks %u nr_sg = %u\n",
++ block_size, nr_blocks, req->nr_sg);
+
+ BUG_ON(nr_blocks == 0);
+ chan->nr_blocks = nr_blocks;
+@@ -269,6 +267,7 @@ static int dmac_prepare_request_sg(struc
+ }
+ dmac_chan_writel_lo(dmac, req->req.channel, CTL, ctllo);
+ dmac_chan_writel_hi(dmac, req->req.channel, CTL, ctlhi);
++ pr_debug("ctl hi:lo 0x%lx:%lx\n", ctlhi, ctllo);
+ } else {
+ struct dw_dma_lli *lli, *lli_prev = NULL;
+ int j = 0, offset = 0;