dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panfrost: fix runtime pm imbalance on error
@ 2020-05-20 11:05 Dinghao Liu
  2020-05-20 14:02 ` Steven Price
  0 siblings, 1 reply; 5+ messages in thread
From: Dinghao Liu @ 2020-05-20 11:05 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Tomeu Vizoso, David Airlie, linux-kernel, dri-devel,
	Steven Price, Alyssa Rosenzweig

pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/gpu/drm/panfrost/panfrost_job.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
index 7914b1570841..5719e356c969 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -146,8 +146,10 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
 	int ret;
 
 	ret = pm_runtime_get_sync(pfdev->dev);
-	if (ret < 0)
+	if (ret < 0) {
+		pm_runtime_put_sync_autosuspend(pfdev->dev);
 		return;
+	}
 
 	if (WARN_ON(job_read(pfdev, JS_COMMAND_NEXT(js)))) {
 		pm_runtime_put_sync_autosuspend(pfdev->dev);
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-23  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 11:05 [PATCH] drm/panfrost: fix runtime pm imbalance on error Dinghao Liu
2020-05-20 14:02 ` Steven Price
2020-05-21  7:00   ` dinghao.liu
2020-05-22 13:09     ` Steven Price
2020-05-22 13:23       ` dinghao.liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).