drm/etnaviv: avoid runtime PM usage in etnaviv_gpu_bind
authorLucas Stach <l.stach@pengutronix.de>
Wed, 7 Jun 2023 13:02:20 +0000 (15:02 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 13 Mar 2024 06:58:56 +0000 (15:58 +0900)
Nothing in this callpath actually touches the GPU, so there is no reason
to get it out of suspend state here. Only if runtime PM isn't enabled at
all we must make sure to enable the clocks, so the GPU init routine can
access the GPU later on.

This also removes the need to guard against the state where the driver
isn't fully initialized yet in the runtime PM resume handler.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
(cherry picked from commit e286235a75b241be0a103258df04372fcb12f672)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c

index 3f8c9af60f8f8abd6290209a027cf57a35296498..57145ca2cc4c19f5274d3656b9dbc30bad44a5a2 100644 (file)
@@ -1731,13 +1731,11 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
        if (ret)
                goto out_workqueue;
 
-#ifdef CONFIG_PM
-       ret = pm_runtime_get_sync(gpu->dev);
-#else
+#ifndef CONFIG_PM
        ret = etnaviv_gpu_clk_enable(gpu);
-#endif
        if (ret < 0)
                goto out_sched;
+#endif
 
 
        gpu->drm = drm;
@@ -1750,9 +1748,6 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
 
        priv->gpu[priv->num_gpus++] = gpu;
 
-       pm_runtime_mark_last_busy(gpu->dev);
-       pm_runtime_put_autosuspend(gpu->dev);
-
        return 0;
 
 out_sched:
@@ -1935,7 +1930,7 @@ static int etnaviv_gpu_rpm_resume(struct device *dev)
                return ret;
 
        /* Re-initialise the basic hardware state */
-       if (gpu->drm && gpu->initialized) {
+       if (gpu->initialized) {
                ret = etnaviv_gpu_hw_resume(gpu);
                if (ret) {
                        etnaviv_gpu_clk_disable(gpu);