If the exception type isn't one of the normal faults, don't try to map
and instead go straight to a terminal fault.

Otherwise, we can get flooded by kernel warnings and further faults.

Signed-off-by: Tomeu Vizoso <tomeu.viz...@collabora.com>
---
 drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c 
b/drivers/gpu/drm/panfrost/panfrost_mmu.c
index 763cfca886a7..80abddb4544c 100644
--- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
@@ -596,8 +596,9 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, 
void *data)
                source_id = (fault_status >> 16);
 
                /* Page fault only */
-               if ((status & mask) == BIT(i)) {
-                       WARN_ON(exception_type < 0xC1 || exception_type > 0xC4);
+               if ((status & mask) == BIT(i) &&
+                    exception_type >= 0xC1 &&
+                    exception_type <= 0xC4) {
 
                        ret = panfrost_mmu_map_fault_addr(pfdev, i, addr);
                        if (!ret) {
-- 
2.21.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to