* [PATCH] drm/v3d: fix runtime pm imbalance on error
@ 2020-05-20 12:07 Dinghao Liu
0 siblings, 0 replies; only message in thread
From: Dinghao Liu @ 2020-05-20 12:07 UTC (permalink / raw)
To: dinghao.liu, kjlu; +Cc: David Airlie, dri-devel, linux-kernel
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/v3d/v3d_gem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index 549dde83408b..d53c683ed74c 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -440,8 +440,10 @@ v3d_job_init(struct v3d_dev *v3d, struct drm_file *file_priv,
job->free = free;
ret = pm_runtime_get_sync(v3d->dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_autosuspend(v3d->dev);
return ret;
+ }
xa_init_flags(&job->deps, XA_FLAGS_ALLOC);
--
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] only message in thread
only message in thread, other threads:[~2020-05-22 6:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 12:07 [PATCH] drm/v3d: fix runtime pm imbalance on error 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).