Skip to content

Commit 9ec2afd

Browse files
committed
drm/etnaviv: expedited MMU fault handling
The GPU is halted when it hits a MMU exception, so there is no point in waiting for the job timeout to expire or try to work out if the GPU is still making progress in the timeout handler, as we know that the GPU won't make any more progress. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
1 parent e116be2 commit 9ec2afd

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,8 @@ static irqreturn_t irq_handler(int irq, void *data)
15391539

15401540
if (intr & VIVS_HI_INTR_ACKNOWLEDGE_MMU_EXCEPTION) {
15411541
dump_mmu_fault(gpu);
1542+
gpu->state = ETNA_GPU_STATE_FAULT;
1543+
drm_sched_fault(&gpu->sched);
15421544
intr &= ~VIVS_HI_INTR_ACKNOWLEDGE_MMU_EXCEPTION;
15431545
}
15441546

drivers/gpu/drm/etnaviv/etnaviv_gpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ enum etnaviv_gpu_state {
101101
ETNA_GPU_STATE_RESET,
102102
ETNA_GPU_STATE_INITIALIZED,
103103
ETNA_GPU_STATE_RUNNING,
104+
ETNA_GPU_STATE_FAULT,
104105
};
105106

106107
struct etnaviv_gpu {

drivers/gpu/drm/etnaviv/etnaviv_sched.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ static enum drm_gpu_sched_stat etnaviv_sched_timedout_job(struct drm_sched_job
5555
*/
5656
dma_addr = gpu_read(gpu, VIVS_FE_DMA_ADDRESS);
5757
change = dma_addr - gpu->hangcheck_dma_addr;
58-
if (gpu->completed_fence != gpu->hangcheck_fence ||
59-
change < 0 || change > 16) {
58+
if (gpu->state == ETNA_GPU_STATE_RUNNING &&
59+
(gpu->completed_fence != gpu->hangcheck_fence ||
60+
change < 0 || change > 16)) {
6061
gpu->hangcheck_dma_addr = dma_addr;
6162
gpu->hangcheck_fence = gpu->completed_fence;
6263
goto out_no_timeout;

0 commit comments

Comments
 (0)