Skip to content

Commit 2da20c9

Browse files
digetxbbrezillon
authored andcommitted
drm/panfrost: Sync IRQ by job's timeout handler
Panfrost IRQ handler may stuck for a long time, for example this happens when there is a bad HDMI connection and HDMI handler takes a long time to finish processing, holding Panfrost. Make Panfrost's job timeout handler to sync IRQ before checking fence signal status in order to prevent spurious job timeouts due to a slow IRQ processing. Reviewed-by: Steven Price <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Tested-by: AngeloGioacchino Del Regno <[email protected]> # MediaTek MT8192 and MT8195 Chromebooks Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 991eb53 commit 2da20c9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/gpu/drm/panfrost/panfrost_job.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,22 @@ static enum drm_gpu_sched_stat panfrost_job_timedout(struct drm_sched_job
720720
if (dma_fence_is_signaled(job->done_fence))
721721
return DRM_GPU_SCHED_STAT_NOMINAL;
722722

723+
/*
724+
* Panfrost IRQ handler may take a long time to process an interrupt
725+
* if there is another IRQ handler hogging the processing.
726+
* For example, the HDMI encoder driver might be stuck in the IRQ
727+
* handler for a significant time in a case of bad cable connection.
728+
* In order to catch such cases and not report spurious Panfrost
729+
* job timeouts, synchronize the IRQ handler and re-check the fence
730+
* status.
731+
*/
732+
synchronize_irq(pfdev->js->irq);
733+
734+
if (dma_fence_is_signaled(job->done_fence)) {
735+
dev_warn(pfdev->dev, "unexpectedly high interrupt latency\n");
736+
return DRM_GPU_SCHED_STAT_NOMINAL;
737+
}
738+
723739
dev_err(pfdev->dev, "gpu sched timeout, js=%d, config=0x%x, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p",
724740
js,
725741
job_read(pfdev, JS_CONFIG(js)),

0 commit comments

Comments
 (0)