From: Ariel D'Alessandro Date: Mon, 24 Mar 2025 18:57:56 +0000 (-0300) Subject: drm/panfrost: Set IOMMU_CACHE flag X-Git-Tag: v6.16-rc1~33^2~30^2~97 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=f91e534f4e605caabc6abd61809dd8d6698e7c71;p=linux-block.git drm/panfrost: Set IOMMU_CACHE flag Panfrost does not support uncached mappings, so flag them properly. Also flag the pages that are mapped as response to a page fault as cached. Signed-off-by: Boris Brezillon Signed-off-by: Ariel D'Alessandro Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Steven Price Reviewed-by: Adrián Larumbe Signed-off-by: Steven Price Link: https://lore.kernel.org/r/20250324185801.168664-2-ariel.dalessandro@collabora.com --- diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 4a0b4bf03f1a..d5c136bb64ec 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -327,7 +327,7 @@ int panfrost_mmu_map(struct panfrost_gem_mapping *mapping) struct drm_gem_object *obj = &shmem->base; struct panfrost_device *pfdev = to_panfrost_device(obj->dev); struct sg_table *sgt; - int prot = IOMMU_READ | IOMMU_WRITE; + int prot = IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE; if (WARN_ON(mapping->active)) return 0; @@ -528,7 +528,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, goto err_map; mmu_map_sg(pfdev, bomapping->mmu, addr, - IOMMU_WRITE | IOMMU_READ | IOMMU_NOEXEC, sgt); + IOMMU_WRITE | IOMMU_READ | IOMMU_CACHE | IOMMU_NOEXEC, sgt); bomapping->active = true; bo->heap_rss_size += SZ_2M;