From b1bbfb6c0245cd35ad197d290e26ee1cdee467ff Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 24 Sep 2026 14:30:43 +0200 Subject: drm/panthor: Don't invalidate OTHER caches Don't invalidate the OTHER caches (AKA L1 read-only caches) since this seems to trip out the flush-elimination logic on v13, and it's not needed in practice (can't leak other context data because of TLB invalidation or corrupt physical pages returned to the system because it's a RO cache). It's also worth noting that the downstream driver has been avoid OTHER caches invalidation from the start, and that we were doing the same until atomic page table update was introduced. Fixes: 6e2d3b3e8589 ("drm/panthor: Add support for atomic page table updates") Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau [Update comment as suggested by sashiko] Signed-off-by: Liviu Dudau Link: https://patch.msgid.link/20260924-panthor-mmu-fixes-v1-1-e25f9b106466@collabora.com --- drivers/gpu/drm/panthor/panthor_mmu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index d75d575473da..dd7642872d59 100644 --- a/drivers/gpu/drm/panthor/panthor_mmu.c +++ b/drivers/gpu/drm/panthor/panthor_mmu.c @@ -630,7 +630,7 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr, /* Flush+invalidate RW caches, invalidate RO ones. */ ret = panthor_gpu_flush_caches(ptdev, CACHE_CLEAN | CACHE_INV, - CACHE_CLEAN | CACHE_INV, CACHE_INV); + CACHE_CLEAN | CACHE_INV, 0); if (ret) return ret; @@ -1832,13 +1832,12 @@ static void panthor_vm_unlock_region(struct panthor_vm *vm) if (vm->as.id >= 0) { int ret; - /* flush+invalidate RW caches and invalidate RO ones. + /* flush+invalidate RW caches. * TODO: See if we can use FLUSH_PA_RANGE when the physical * range is narrow enough and the HW supports it. */ ret = panthor_gpu_flush_caches(ptdev, CACHE_CLEAN | CACHE_INV, - CACHE_CLEAN | CACHE_INV, - CACHE_INV); + CACHE_CLEAN | CACHE_INV, 0); /* Unlock the region if the flush is effective. */ if (!ret) -- cgit v1.2.3