Skip to content

Commit eb9d8dd

Browse files
tomeuvrobherring
authored andcommitted
drm/panfrost: Don't try to map on error faults
If the exception type isn't a translation fault, don't try to map and instead go straight to a terminal fault. Otherwise, we can get flooded by kernel warnings and further faults. Fixes: 187d292 ("drm/panfrost: Add support for GPU heap allocations") Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fbb3016 commit eb9d8dd

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

drivers/gpu/drm/panfrost/panfrost_mmu.c

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -601,33 +601,27 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
601601
source_id = (fault_status >> 16);
602602

603603
/* Page fault only */
604-
if ((status & mask) == BIT(i)) {
605-
WARN_ON(exception_type < 0xC1 || exception_type > 0xC4);
606-
604+
ret = -1;
605+
if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0)
607606
ret = panfrost_mmu_map_fault_addr(pfdev, i, addr);
608-
if (!ret) {
609-
mmu_write(pfdev, MMU_INT_CLEAR, BIT(i));
610-
status &= ~mask;
611-
continue;
612-
}
613-
}
614607

615-
/* terminal fault, print info about the fault */
616-
dev_err(pfdev->dev,
617-
"Unhandled Page fault in AS%d at VA 0x%016llX\n"
618-
"Reason: %s\n"
619-
"raw fault status: 0x%X\n"
620-
"decoded fault status: %s\n"
621-
"exception type 0x%X: %s\n"
622-
"access type 0x%X: %s\n"
623-
"source id 0x%X\n",
624-
i, addr,
625-
"TODO",
626-
fault_status,
627-
(fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"),
628-
exception_type, panfrost_exception_name(pfdev, exception_type),
629-
access_type, access_type_name(pfdev, fault_status),
630-
source_id);
608+
if (ret)
609+
/* terminal fault, print info about the fault */
610+
dev_err(pfdev->dev,
611+
"Unhandled Page fault in AS%d at VA 0x%016llX\n"
612+
"Reason: %s\n"
613+
"raw fault status: 0x%X\n"
614+
"decoded fault status: %s\n"
615+
"exception type 0x%X: %s\n"
616+
"access type 0x%X: %s\n"
617+
"source id 0x%X\n",
618+
i, addr,
619+
"TODO",
620+
fault_status,
621+
(fault_status & (1 << 10) ? "DECODER FAULT" : "SLAVE FAULT"),
622+
exception_type, panfrost_exception_name(pfdev, exception_type),
623+
access_type, access_type_name(pfdev, fault_status),
624+
source_id);
631625

632626
mmu_write(pfdev, MMU_INT_CLEAR, mask);
633627

0 commit comments

Comments
 (0)