]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/sun50i: Implement .iotlb_sync_map
authorJernej Skrabec <jernej.skrabec@gmail.com>
Tue, 25 Oct 2022 16:54:15 +0000 (18:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:47 +0000 (13:32 +0100)
commit31d6627dfe6f19c3194df76176f75131072d3183
treee4828c57c66dfafba0f05a7d63a27a3a97c3d80e
parentc42c76e92a6a69f39ea845ce3c5b96dad9b9a4f8
iommu/sun50i: Implement .iotlb_sync_map

[ Upstream commit 2fd5fe0b3211de11f8d2ea65acbc018e0011ffe1 ]

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: b52188050f20 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/sun50i-iommu.c