]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.20.2/ieee1394-video1394-dma-fix.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.20.2 / ieee1394-video1394-dma-fix.patch
CommitLineData
a1cd50fd
GKH
1From stable-bounces@linux.kernel.org Fri Feb 9 15:42:53 2007
2From: David Moore <dcm@acm.org>
3Date: Sat, 10 Feb 2007 00:41:28 +0100 (CET)
4Subject: ieee1394: video1394: DMA fix
5To: stable@kernel.org
6Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
7Message-ID: <tkrat.c5f99af899e152d1@s5r6.in-berlin.de>
8Content-Disposition: INLINE
9
10From: David Moore <dcm@acm.org>
11
12This together with the phys_to_virt fix in lib/swiotlb.c::swiotlb_sync_sg
13fixes video1394 DMA on machines with DMA bounce buffers, especially Intel
14x86-64 machines with > 3GB RAM.
15
16Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17Signed-off-by: David Moore <dcm@acm.org>
18Tested-by: Nicolas Turro <Nicolas.Turro@inrialpes.fr>
19Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21---
22 drivers/ieee1394/video1394.c | 8 ++++++++
23 1 file changed, 8 insertions(+)
24
25--- linux-2.6.20.1.orig/drivers/ieee1394/video1394.c
26+++ linux-2.6.20.1/drivers/ieee1394/video1394.c
27@@ -489,6 +489,9 @@ static void wakeup_dma_ir_ctx(unsigned l
28 reset_ir_status(d, i);
29 d->buffer_status[d->buffer_prg_assignment[i]] = VIDEO1394_BUFFER_READY;
30 do_gettimeofday(&d->buffer_time[d->buffer_prg_assignment[i]]);
31+ dma_region_sync_for_cpu(&d->dma,
32+ d->buffer_prg_assignment[i] * d->buf_size,
33+ d->buf_size);
34 }
35 }
36
37@@ -1096,6 +1099,8 @@ static long video1394_ioctl(struct file
38 DBGMSG(ohci->host->id, "Starting iso transmit DMA ctx=%d",
39 d->ctx);
40 put_timestamp(ohci, d, d->last_buffer);
41+ dma_region_sync_for_device(&d->dma,
42+ v.buffer * d->buf_size, d->buf_size);
43
44 /* Tell the controller where the first program is */
45 reg_write(ohci, d->cmdPtr,
46@@ -1111,6 +1116,9 @@ static long video1394_ioctl(struct file
47 "Waking up iso transmit dma ctx=%d",
48 d->ctx);
49 put_timestamp(ohci, d, d->last_buffer);
50+ dma_region_sync_for_device(&d->dma,
51+ v.buffer * d->buf_size, d->buf_size);
52+
53 reg_write(ohci, d->ctrlSet, 0x1000);
54 }
55 }