media: saa7146: use sg_dma_len when building pgtable
authorTasos Sahanidis <tasos@tasossah.com>
Wed, 3 Mar 2021 18:52:53 +0000 (19:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:22 +0000 (09:50 +0200)
commit3ad6a6288c88a61d20fd7a589e4da6972c8e152e
tree197223b848a35f997b11f820ac9694b6ecc4e1f9
parenta250df336aa5fb2028e2baeab7822bbfa251048a
media: saa7146: use sg_dma_len when building pgtable

[ Upstream commit e56429b09d5e0802b86f84ec7c24025886c9f88b ]

The new AMD IOMMU DMA implementation concatenates sglist entries under
certain conditions, and because saa7146 accessed the length member
directly, it did not support this scenario.

This fixes IO_PAGE_FAULTs by using the sg_dma_len macro.

Fixes: be62dbf554c5 ("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>
drivers/media/common/saa7146/saa7146_core.c
drivers/media/common/saa7146/saa7146_video.c