Skip to content

Commit 725cbc7

Browse files
committed
drm/etnaviv: exec and MMU state is lost when resetting the GPU
When the GPU is reset both the current exec state, as well as all MMU state is lost. Move the driver side state tracking into the reset function to keep hardware and software state from diverging. Cc: [email protected] # 5.4 Signed-off-by: Lucas Stach <[email protected]> Tested-by: Michael Walle <[email protected]> Tested-by: Marek Vasut <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
1 parent 8f3eea9 commit 725cbc7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ static int etnaviv_hw_reset(struct etnaviv_gpu *gpu)
570570
etnaviv_gpu_update_clock(gpu);
571571

572572
gpu->fe_running = false;
573+
gpu->exec_state = -1;
574+
gpu->mmu_context = NULL;
573575

574576
return 0;
575577
}
@@ -836,7 +838,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
836838
/* Now program the hardware */
837839
mutex_lock(&gpu->lock);
838840
etnaviv_gpu_hw_init(gpu);
839-
gpu->exec_state = -1;
840841
mutex_unlock(&gpu->lock);
841842

842843
pm_runtime_mark_last_busy(gpu->dev);
@@ -1061,8 +1062,6 @@ void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu)
10611062
spin_unlock(&gpu->event_spinlock);
10621063

10631064
etnaviv_gpu_hw_init(gpu);
1064-
gpu->exec_state = -1;
1065-
gpu->mmu_context = NULL;
10661065

10671066
mutex_unlock(&gpu->lock);
10681067
pm_runtime_mark_last_busy(gpu->dev);

0 commit comments

Comments
 (0)