diff --git a/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch index d281a7877e..244d6f5046 100644 --- a/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch +++ b/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch @@ -451,94 +451,6 @@ index db6ea48e21f9..1e2a4de941aa 100644 ktime_t busy_time; -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Fri, 5 Feb 2021 12:17:55 +0100 -Subject: [PATCH] drm/panfrost: Clear MMU irqs before handling the fault - -When a fault is handled it will unblock the GPU which will continue -executing its shader and might fault almost immediately on a different -page. If we clear interrupts after handling the fault we might miss new -faults, so clear them before. - -Cc: -Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") -Signed-off-by: Boris Brezillon -Reviewed-by: Steven Price ---- - drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c -index be8d68fb0e11..e5f7f647430f 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_mmu.c -+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c -@@ -600,6 +600,8 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - access_type = (fault_status >> 8) & 0x3; - source_id = (fault_status >> 16); - -+ mmu_write(pfdev, MMU_INT_CLEAR, mask); -+ - /* Page fault only */ - ret = -1; - if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0) -@@ -623,8 +625,6 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) - access_type, access_type_name(pfdev, fault_status), - source_id); - -- mmu_write(pfdev, MMU_INT_CLEAR, mask); -- - status &= ~mask; - } - - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Fri, 5 Feb 2021 12:17:56 +0100 -Subject: [PATCH] drm/panfrost: Don't try to map pages that are already mapped - -We allocate 2MB chunks at a time, so it might appear that a page fault -has already been handled by a previous page fault when we reach -panfrost_mmu_map_fault_addr(). Bail out in that case to avoid mapping the -same area twice. - -Cc: -Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") -Signed-off-by: Boris Brezillon -Reviewed-by: Steven Price ---- - drivers/gpu/drm/panfrost/panfrost_mmu.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c -index e5f7f647430f..198686216317 100644 ---- a/drivers/gpu/drm/panfrost/panfrost_mmu.c -+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c -@@ -495,8 +495,14 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, - } - bo->base.pages = pages; - bo->base.pages_use_count = 1; -- } else -+ } else { - pages = bo->base.pages; -+ if (pages[page_offset]) { -+ /* Pages are already mapped, bail out. */ -+ mutex_unlock(&bo->base.pages_lock); -+ goto out; -+ } -+ } - - mapping = bo->base.base.filp->f_mapping; - mapping_set_unevictable(mapping); -@@ -529,6 +535,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, - - dev_dbg(pfdev->dev, "mapped page fault @ AS%d %llx", as, addr); - -+out: - panfrost_gem_mapping_put(bomapping); - - return 0; - From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 5 Feb 2021 12:17:57 +0100