mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
media: saa7134: use sg_dma_len when building pgtable
[ Upstream commit4e1cb753c0] The new AMD IOMMU DMA implementation concatenates sglist entries under certain conditions, and because saa7134 accessed the length member directly, it did not support this scenario. This fixes IO_PAGE_FAULTs and choppy DMA audio by using the sg_dma_len macro. Fixes:be62dbf554("iommu/amd: Convert AMD iommu driver to the dma-iommu api") Signed-off-by: Tasos Sahanidis <tasos@tasossah.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
385470a358
commit
a250df336a
@@ -243,7 +243,7 @@ int saa7134_pgtable_build(struct pci_dev *pci, struct saa7134_pgtable *pt,
|
||||
|
||||
ptr = pt->cpu + startpage;
|
||||
for (i = 0; i < length; i++, list = sg_next(list)) {
|
||||
for (p = 0; p * 4096 < list->length; p++, ptr++)
|
||||
for (p = 0; p * 4096 < sg_dma_len(list); p++, ptr++)
|
||||
*ptr = cpu_to_le32(sg_dma_address(list) +
|
||||
list->offset + p * 4096);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user