[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1642592045-28700-1-git-send-email-lyz_cs@pku.edu.cn>
Date: Wed, 19 Jan 2022 03:34:05 -0800
From: Yongzhi Liu <lyz_cs@....edu.cn>
To: l.stach@...gutronix.de, linux+etnaviv@...linux.org.uk,
christian.gmeiner@...il.com, airlied@...ux.ie, daniel@...ll.ch
Cc: etnaviv@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, Yongzhi Liu <lyz_cs@....edu.cn>
Subject: [PATCH] drm/etnaviv: Fix runtime PM imbalance on error
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Yongzhi Liu <lyz_cs@....edu.cn>
---
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 242a5fd..aa64f45 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1690,7 +1690,7 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
goto out_workqueue;
#ifdef CONFIG_PM
- ret = pm_runtime_get_sync(gpu->dev);
+ ret = pm_runtime_resume_and_get(gpu->dev);
#else
ret = etnaviv_gpu_clk_enable(gpu);
#endif
--
2.7.4
Powered by blists - more mailing lists