Skip to contentSkip to conversation

drm/v3d/v3d_drv: Fix PM disable depth imbalance

PATCH New Miaoqian Lin 1 participant 1 message Jun 2, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 drm/v3d/v3d_drv: Fix PM disable depth imbalance

The pm_runtime_enable will increase power disable depth. We need to call pm_runtime_disable() to balance it when needed use devm_pm_runtime_enable() and handle it automatically/

Fixes 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")

---
Changes in v4:
- use devm_pm_runtime_enable()

Changes in v3:
- call pm_runtime_disable() in v3d_platform_drm_remove
- update commit message

Changes in v2
- put pm_runtime_disable before dma_free_wc
- rename dma_free to pm_disable

v1: https://lore.kernel.org/r/[email protected]
v2: https://lore.kernel.org/r/[email protected]
v3: https://lore.kernel.org/all/[email protected]

---
 drivers/gpu/drm/v3d/v3d_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/v3d/v3d_drv.c +3 -1
index 1afcd54fbbd5..563ad4b9c2e8 100644
@@ -282,7 +282,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
 
 	pm_runtime_use_autosuspend(dev);
 	pm_runtime_set_autosuspend_delay(dev, 50);
-	pm_runtime_enable(dev);
+	ret = devm_pm_runtime_enable(dev);
+	if (ret)
+		goto dma_free;
 
 	ret = v3d_gem_init(drm);
 	if (ret)
Signature · 1 line
2.25.1