* [PATCH] drm/v3d: fix runtime pm imbalance on error
@ 2020-05-20 12:07 ` Dinghao Liu
0 siblings, 0 replies; 3+ messages in thread
From: Dinghao Liu @ 2020-05-20 12:07 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Eric Anholt, David Airlie, Daniel Vetter, 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] drm/v3d: fix runtime pm imbalance on error
@ 2020-05-20 12:07 ` Dinghao Liu
0 siblings, 0 replies; 3+ messages 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] 3+ messages in thread
* [PATCH] drm/v3d: Fix runtime PM imbalance on error
@ 2022-01-17 16:10 Yongzhi Liu
0 siblings, 0 replies; 3+ messages in thread
From: Yongzhi Liu @ 2022-01-17 16:10 UTC (permalink / raw)
To: emma, airlied, daniel; +Cc: dri-devel, linux-kernel, Yongzhi Liu
pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code, thus a matching decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
---
drivers/gpu/drm/v3d/v3d_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index 1afcd54..6e72bd7 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -69,7 +69,7 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
if (args->value != 0)
return -EINVAL;
- ret = pm_runtime_get_sync(v3d->drm.dev);
+ ret = pm_runtime_resume_and_get(v3d->drm.dev);
if (ret < 0)
return ret;
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-17 16:13 UTC | newest]
Thread overview: 3+ messages (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
2020-05-20 12:07 ` Dinghao Liu
2022-01-17 16:10 [PATCH] drm/v3d: Fix runtime PM " Yongzhi Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.