Skip to content

Commit 7cb5449

Browse files
committed
drm/etnaviv: make clock handling symetric between runtime resume and suspend
Currently the clock is enabled in the runtime resume function, but are disabled a level further down in the callstack in the suspend function. Move the clock disable into the suspend function to make handling symmetrical between resume and suspend. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
1 parent f098f9b commit 7cb5449

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ int etnaviv_gpu_wait_idle(struct etnaviv_gpu *gpu, unsigned int timeout_ms)
16401640
} while (1);
16411641
}
16421642

1643-
static int etnaviv_gpu_hw_suspend(struct etnaviv_gpu *gpu)
1643+
static void etnaviv_gpu_hw_suspend(struct etnaviv_gpu *gpu)
16441644
{
16451645
if (gpu->initialized && gpu->fe_running) {
16461646
/* Replace the last WAIT with END */
@@ -1659,8 +1659,6 @@ static int etnaviv_gpu_hw_suspend(struct etnaviv_gpu *gpu)
16591659
}
16601660

16611661
gpu->exec_state = -1;
1662-
1663-
return etnaviv_gpu_clk_disable(gpu);
16641662
}
16651663

16661664
static int etnaviv_gpu_hw_resume(struct etnaviv_gpu *gpu)
@@ -1797,6 +1795,7 @@ static void etnaviv_gpu_unbind(struct device *dev, struct device *master,
17971795
pm_runtime_put_sync_suspend(gpu->dev);
17981796
} else {
17991797
etnaviv_gpu_hw_suspend(gpu);
1798+
etnaviv_gpu_clk_disable(gpu);
18001799
}
18011800

18021801
if (gpu->mmu_context)
@@ -1930,7 +1929,9 @@ static int etnaviv_gpu_rpm_suspend(struct device *dev)
19301929
return -EBUSY;
19311930
}
19321931

1933-
return etnaviv_gpu_hw_suspend(gpu);
1932+
etnaviv_gpu_hw_suspend(gpu);
1933+
1934+
return etnaviv_gpu_clk_disable(gpu);
19341935
}
19351936

19361937
static int etnaviv_gpu_rpm_resume(struct device *dev)

0 commit comments

Comments
 (0)