Dinghao Liu
2020-May-20  10:48 UTC
[Nouveau] [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
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 at 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
Lyude Paul
2020-Jun-03  16:26 UTC
[Nouveau] [PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
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 at 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 at 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);
Apparently Analagous Threads
- [PATCH] drm/nouveau: Grab runtime PM ref in nv50_mstc_detect()
- [PATCH v5 06/14] drm/dp_mst: Protect drm_dp_mst_port members with locking
- [PATCH] drm/nouveau: fix runtime pm imbalance on error
- [PATCH] drm/nouveau/debugfs: fix runtime pm imbalance on error
- [PATCH] drm/nouveau: fix runtime pm imbalance on error