iommu/sun50i: Implement .iotlb_sync_map
authorJernej Skrabec <jernej.skrabec@gmail.com>
Tue, 25 Oct 2022 16:54:15 +0000 (18:54 +0200)
committerJoerg Roedel <jroedel@suse.de>
Thu, 3 Nov 2022 14:45:44 +0000 (15:45 +0100)
commite563cc0c787c85a4d9def0a77078dc5d3f445e3d
treed305926696372393c8c04c839a78a85b1be23a55
parent67a8a67f9eceb72e4c73d1d09ed9ab04f4b8e12d
iommu/sun50i: Implement .iotlb_sync_map

Allocated iova ranges need to be invalidated immediately or otherwise
they might or might not work when used by master or CPU. This was
discovered when running video decoder conformity test with Cedrus. Some
videos were now and then decoded incorrectly and generated page faults.

According to vendor driver, it's enough to invalidate just start and end
TLB and PTW cache lines. Documentation says that neighbouring lines must
be invalidated too. Finally, when page fault occurs, that iova must be
invalidated the same way, according to documentation.

Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20221025165415.307591-6-jernej.skrabec@gmail.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/sun50i-iommu.c