* [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
@ 2020-05-20 10:47 ` Dinghao Liu
0 siblings, 0 replies; 5+ messages in thread
From: Dinghao Liu @ 2020-05-20 10:47 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Ben Skeggs, David Airlie, Daniel Vetter, Lyude Paul, Sean Paul,
Pankaj Bharadiya, Alex Deucher, Takashi Iwai, dri-devel, nouveau,
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/nouveau/dispnv50/disp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 6be9df1820c5..e670756664ff 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1123,8 +1123,10 @@ nv50_mstc_detect(struct drm_connector *connector,
return connector_status_disconnected;
ret = pm_runtime_get_sync(connector->dev->dev);
- if (ret < 0 && ret != -EACCES)
+ if (ret < 0 && ret != -EACCES) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
ret = drm_dp_mst_detect_port(connector, ctx, mstc->port->mgr,
mstc->port);
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
@ 2020-05-20 10:47 ` Dinghao Liu
0 siblings, 0 replies; 5+ messages in thread
From: Dinghao Liu @ 2020-05-20 10:47 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: David Airlie, Pankaj Bharadiya, linux-kernel, dri-devel,
Sean Paul, Ben Skeggs, nouveau, Alex Deucher
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/nouveau/dispnv50/disp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 6be9df1820c5..e670756664ff 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -1123,8 +1123,10 @@ nv50_mstc_detect(struct drm_connector *connector,
return connector_status_disconnected;
ret = pm_runtime_get_sync(connector->dev->dev);
- if (ret < 0 && ret != -EACCES)
+ if (ret < 0 && ret != -EACCES) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
ret = drm_dp_mst_detect_port(connector, ctx, mstc->port->mgr,
mstc->port);
--
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
* Re: [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
@ 2020-06-03 16:26 ` Lyude Paul
0 siblings, 0 replies; 5+ messages in thread
From: Lyude Paul @ 2020-06-03 16:26 UTC (permalink / raw)
To: Dinghao Liu, kjlu
Cc: Ben Skeggs, David Airlie, Daniel Vetter, Sean Paul,
Pankaj Bharadiya, Alex Deucher, Takashi Iwai, dri-devel, nouveau,
linux-kernel
Hi! Was going through my email and found this from last month, it's a bit late
and someone might have reviewed/pushed this already but just in case:
Reviewed-by: Lyude Paul <lyude@redhat.com>
On Wed, 2020-05-20 at 18:47 +0800, Dinghao Liu wrote:
> 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/nouveau/dispnv50/disp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 6be9df1820c5..e670756664ff 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -1123,8 +1123,10 @@ nv50_mstc_detect(struct drm_connector *connector,
> return connector_status_disconnected;
>
> ret = pm_runtime_get_sync(connector->dev->dev);
> - if (ret < 0 && ret != -EACCES)
> + if (ret < 0 && ret != -EACCES) {
> + pm_runtime_put_autosuspend(connector->dev->dev);
> return connector_status_disconnected;
> + }
>
> ret = drm_dp_mst_detect_port(connector, ctx, mstc->port->mgr,
> mstc->port);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
@ 2020-06-03 16:26 ` Lyude Paul
0 siblings, 0 replies; 5+ messages in thread
From: Lyude Paul @ 2020-06-03 16:26 UTC (permalink / raw)
To: Dinghao Liu, kjlu-OJFnDUYgAso
Cc: David Airlie, Pankaj Bharadiya,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Takashi Iwai,
Sean Paul, Ben Skeggs, Daniel Vetter,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Deucher
Hi! Was going through my email and found this from last month, it's a bit late
and someone might have reviewed/pushed this already but just in case:
Reviewed-by: Lyude Paul <lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Wed, 2020-05-20 at 18:47 +0800, Dinghao Liu wrote:
> 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-Y5EWUtBUdg4nDS1+zs4M5A@public.gmane.org>
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 6be9df1820c5..e670756664ff 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -1123,8 +1123,10 @@ nv50_mstc_detect(struct drm_connector *connector,
> return connector_status_disconnected;
>
> ret = pm_runtime_get_sync(connector->dev->dev);
> - if (ret < 0 && ret != -EACCES)
> + if (ret < 0 && ret != -EACCES) {
> + pm_runtime_put_autosuspend(connector->dev->dev);
> return connector_status_disconnected;
> + }
>
> ret = drm_dp_mst_detect_port(connector, ctx, mstc->port->mgr,
> mstc->port);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
@ 2020-06-03 16:26 ` Lyude Paul
0 siblings, 0 replies; 5+ messages in thread
From: Lyude Paul @ 2020-06-03 16:26 UTC (permalink / raw)
To: Dinghao Liu, kjlu
Cc: David Airlie, Pankaj Bharadiya, linux-kernel, dri-devel,
Sean Paul, Ben Skeggs, nouveau, Alex Deucher
Hi! Was going through my email and found this from last month, it's a bit late
and someone might have reviewed/pushed this already but just in case:
Reviewed-by: Lyude Paul <lyude@redhat.com>
On Wed, 2020-05-20 at 18:47 +0800, Dinghao Liu wrote:
> 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/nouveau/dispnv50/disp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 6be9df1820c5..e670756664ff 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -1123,8 +1123,10 @@ nv50_mstc_detect(struct drm_connector *connector,
> return connector_status_disconnected;
>
> ret = pm_runtime_get_sync(connector->dev->dev);
> - if (ret < 0 && ret != -EACCES)
> + if (ret < 0 && ret != -EACCES) {
> + pm_runtime_put_autosuspend(connector->dev->dev);
> return connector_status_disconnected;
> + }
>
> ret = drm_dp_mst_detect_port(connector, ctx, mstc->port->mgr,
> mstc->port);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-06-03 16:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20 10:47 [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error Dinghao Liu
2020-05-20 10:47 ` Dinghao Liu
2020-06-03 16:26 ` Lyude Paul
2020-06-03 16:26 ` Lyude Paul
2020-06-03 16:26 ` Lyude Paul
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.