Skip to content

Commit 2b2a26b

Browse files
committed
drm/panthor: Force an immediate reset on unrecoverable faults
If the FW reports an unrecoverable fault, we need to reset the GPU before we can start re-using it again. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Liviu Dudau <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 591eafc commit 2b2a26b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

drivers/gpu/drm/panthor/panthor_device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ static const struct panthor_exception_info panthor_exception_infos[] = {
293293
PANTHOR_EXCEPTION(ACTIVE),
294294
PANTHOR_EXCEPTION(CS_RES_TERM),
295295
PANTHOR_EXCEPTION(CS_CONFIG_FAULT),
296+
PANTHOR_EXCEPTION(CS_UNRECOVERABLE),
296297
PANTHOR_EXCEPTION(CS_ENDPOINT_FAULT),
297298
PANTHOR_EXCEPTION(CS_BUS_FAULT),
298299
PANTHOR_EXCEPTION(CS_INSTR_INVALID),

drivers/gpu/drm/panthor/panthor_device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ enum drm_panthor_exception_type {
216216
DRM_PANTHOR_EXCEPTION_CS_RES_TERM = 0x0f,
217217
DRM_PANTHOR_EXCEPTION_MAX_NON_FAULT = 0x3f,
218218
DRM_PANTHOR_EXCEPTION_CS_CONFIG_FAULT = 0x40,
219+
DRM_PANTHOR_EXCEPTION_CS_UNRECOVERABLE = 0x41,
219220
DRM_PANTHOR_EXCEPTION_CS_ENDPOINT_FAULT = 0x44,
220221
DRM_PANTHOR_EXCEPTION_CS_BUS_FAULT = 0x48,
221222
DRM_PANTHOR_EXCEPTION_CS_INSTR_INVALID = 0x49,

drivers/gpu/drm/panthor/panthor_sched.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,16 @@ cs_slot_process_fatal_event_locked(struct panthor_device *ptdev,
12811281
if (group)
12821282
group->fatal_queues |= BIT(cs_id);
12831283

1284-
sched_queue_delayed_work(sched, tick, 0);
1284+
if (CS_EXCEPTION_TYPE(fatal) == DRM_PANTHOR_EXCEPTION_CS_UNRECOVERABLE) {
1285+
/* If this exception is unrecoverable, queue a reset, and make
1286+
* sure we stop scheduling groups until the reset has happened.
1287+
*/
1288+
panthor_device_schedule_reset(ptdev);
1289+
cancel_delayed_work(&sched->tick_work);
1290+
} else {
1291+
sched_queue_delayed_work(sched, tick, 0);
1292+
}
1293+
12851294
drm_warn(&ptdev->base,
12861295
"CSG slot %d CS slot: %d\n"
12871296
"CS_FATAL.EXCEPTION_TYPE: 0x%x (%s)\n"

0 commit comments

Comments
 (0)