]>
Commit | Line | Data |
---|---|---|
a1cd50fd GKH |
1 | From stable-bounces@linux.kernel.org Fri Feb 9 15:42:53 2007 |
2 | From: David Moore <dcm@acm.org> | |
3 | Date: Sat, 10 Feb 2007 00:41:28 +0100 (CET) | |
4 | Subject: ieee1394: video1394: DMA fix | |
5 | To: stable@kernel.org | |
6 | Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org | |
7 | Message-ID: <tkrat.c5f99af899e152d1@s5r6.in-berlin.de> | |
8 | Content-Disposition: INLINE | |
9 | ||
10 | From: David Moore <dcm@acm.org> | |
11 | ||
12 | This together with the phys_to_virt fix in lib/swiotlb.c::swiotlb_sync_sg | |
13 | fixes video1394 DMA on machines with DMA bounce buffers, especially Intel | |
14 | x86-64 machines with > 3GB RAM. | |
15 | ||
16 | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> | |
17 | Signed-off-by: David Moore <dcm@acm.org> | |
18 | Tested-by: Nicolas Turro <Nicolas.Turro@inrialpes.fr> | |
19 | Signed-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 | } |