提交 e9e10124 编写于 作者: A Alan Cox 提交者: Linus Torvalds

ivtv: Fix PCI DMA direction

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: NAlan Cox <alan@linux.intel.com>
Acked-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 edaba2c5
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册