diff mbox

ivtv: Fix PCI direction

Message ID 20090605105551.20201.22179.stgit@t61.ukuu.org.uk (mailing list archive)
State Accepted
Headers show

Commit Message

Alan Cox June 5, 2009, 10:56 a.m. UTC
From: Alan Cox <alan@linux.intel.com>

The ivtv stream buffers may be for receive or for send but the attached sg
handle is always destined cpu->device. We flush it correctly but the
allocation is wrongly done with the same type as the buffers.

See bug: http://bugzilla.kernel.org/show_bug.cgi?id=13385

(Note this doesn't close the bug - it fixes the ivtv part and in turn the
 logging next shows up some rather alarming DMA sg list warnings in libata)

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/media/video/ivtv/ivtv-queue.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/video/ivtv/ivtv-queue.c b/drivers/media/video/ivtv/ivtv-queue.c
index ff7b7de..7fde36e 100644
--- a/drivers/media/video/ivtv/ivtv-queue.c
+++ b/drivers/media/video/ivtv/ivtv-queue.c
@@ -230,7 +230,8 @@  int ivtv_stream_alloc(struct ivtv_stream *s)
 		return -ENOMEM;
 	}
 	if (ivtv_might_use_dma(s)) {
-		s->sg_handle = pci_map_single(itv->pdev, s->sg_dma, sizeof(struct ivtv_sg_element), s->dma);
+		s->sg_handle = pci_map_single(itv->pdev, s->sg_dma,
+				sizeof(struct ivtv_sg_element), PCI_DMA_TODEVICE);
 		ivtv_stream_sync_for_cpu(s);
 	}