[PATCH -next] drm: omapdrm: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Using the newest pm_runtime_resume_and_get is more appropriate for simplifing code here. Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/dispc.c | 6 ++ drivers/gpu/drm/omapdrm/dss/dsi.c | 6 ++ drivers/gpu/drm/omapdrm/dss/dss.c | 6 ++ drivers/gpu/drm/omapdrm/dss/hdmi4.c | 6 ++ drivers/gpu/drm/omapdrm/dss/hdmi5.c | 6 ++ drivers/gpu/drm/omapdrm/dss/venc.c | 6 ++ 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 0ee344ebcd1c..b6db72cf25f4 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -652,11 +652,9 @@ int dispc_runtime_get(struct dispc_device *dispc) DSSDBG("dispc_runtime_get\n"); - r = pm_runtime_get_sync(&dispc->pdev->dev); - if (WARN_ON(r < 0)) { - pm_runtime_put_noidle(&dispc->pdev->dev); + r = pm_runtime_resume_and_get(&dispc->pdev->dev); + if (WARN_ON(r < 0)) return r; - } return 0; } diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index a6845856cbce..7e28e314d34c 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -704,11 +704,9 @@ static int dsi_runtime_get(struct dsi_data *dsi) DSSDBG("dsi_runtime_get\n"); - r = pm_runtime_get_sync(dsi->dev); - if (WARN_ON(r < 0)) { - pm_runtime_put_noidle(dsi->dev); + r = pm_runtime_resume_and_get(dsi->dev); + if (WARN_ON(r < 0)) return r; - } return 0; } diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index c4febb861910..0e32ddf0e24a 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -857,11 +857,9 @@ int dss_runtime_get(struct dss_device *dss) DSSDBG("dss_runtime_get\n"); - r = pm_runtime_get_sync(&dss->pdev->dev); - if (WARN_ON(r < 0)) { - pm_runtime_put_noidle(&dss->pdev->dev); + r = pm_runtime_resume_and_get(&dss->pdev->dev); + if (WARN_ON(r < 0)) return r; - } return 0; } diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index a8a75dc24751..e802d42f12fe 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c @@ -43,11 +43,9 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi) DSSDBG("hdmi_runtime_get\n"); - r = pm_runtime_get_sync(&hdmi->pdev->dev); - if (WARN_ON(r < 0)) { - pm_runtime_put_noidle(&hdmi->pdev->dev); + r = pm_runtime_resume_and_get(&hdmi->pdev->dev); + if (WARN_ON(r < 0)) return r; - } return 0; } diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index 868712cd8a3a..96f78aa2b0ba 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c @@ -44,11 +44,9 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi) DSSDBG("hdmi_runtime_get\n"); - r = pm_runtime_get_sync(&hdmi->pdev->dev); - if (WARN_ON(r < 0)) { - pm_runtime_put_noidle(&hdmi->pdev->dev); + r = pm_runtime_resume_and_get(&hdmi->pdev->dev); + if (WARN_ON(r < 0)) return r; - } return 0; } diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c index 4480b69ab5a7..8c48f222351b 100644 --- a/drivers/gpu/drm/omapdrm/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c @@ -360,11 +360,9 @@ static int venc_runtime_get(struct venc_device *venc) DSSDBG("venc_runtime_get\n"); - r = pm_runtime_get_sync(&venc->pdev->dev); - if (WARN_ON(r < 0)) { - pm_runtime_put_noidle(&venc->pdev->dev); + r = pm_runtime_resume_and_get(&venc->pdev->dev); + if (WARN_ON(r < 0)) return r; - } return 0; } -- 2.25.1
[PATCH -next 1/2] drm/rockchip: vop: fix PM usage counter unbalance in vop ops
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with the newest pm_runtime_resume_and_get to keep usage counter balanced. Fixes:5e570373c015b ("drm/rockchip: vop: Enable pm domain before vop_initial") Fixes:604be85547ce4 ("drm/rockchip: Add VOP2 driver") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index c356de5dd220..fa1f4ee6d195 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -602,7 +602,7 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) struct vop *vop = to_vop(crtc); int ret, i; - ret = pm_runtime_get_sync(vop->dev); + ret = pm_runtime_resume_and_get(vop->dev); if (ret < 0) { DRM_DEV_ERROR(vop->dev, "failed to get pm runtime: %d\n", ret); return ret; @@ -1983,7 +1983,7 @@ static int vop_initial(struct vop *vop) return PTR_ERR(vop->dclk); } - ret = pm_runtime_get_sync(vop->dev); + ret = pm_runtime_resume_and_get(vop->dev); if (ret < 0) { DRM_DEV_ERROR(vop->dev, "failed to get pm runtime: %d\n", ret); return ret; -- 2.25.1
[PATCH -next 2/2] drm/rockchip: fix PM usage counter unbalance in poweron
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with the newest pm_runtime_resume_and_get to keep usage counter balanced. Fixes:34cc0aa254560 ("drm/rockchip: Add support for Rockchip Soc LVDS") Fixes:cca1705c3d895 ("drm/rockchip: lvds: Add PX30 support") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 5a284332ec49..68f6ebb33460 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -152,7 +152,7 @@ static int rk3288_lvds_poweron(struct rockchip_lvds *lvds) DRM_DEV_ERROR(lvds->dev, "failed to enable lvds pclk %d\n", ret); return ret; } - ret = pm_runtime_get_sync(lvds->dev); + ret = pm_runtime_resume_and_get(lvds->dev); if (ret < 0) { DRM_DEV_ERROR(lvds->dev, "failed to get pm runtime: %d\n", ret); clk_disable(lvds->pclk); @@ -336,16 +336,20 @@ static int px30_lvds_poweron(struct rockchip_lvds *lvds) { int ret; - ret = pm_runtime_get_sync(lvds->dev); + ret = pm_runtime_resume_and_get(lvds->dev); if (ret < 0) { DRM_DEV_ERROR(lvds->dev, "failed to get pm runtime: %d\n", ret); return ret; } /* Enable LVDS mode */ - return regmap_update_bits(lvds->grf, PX30_LVDS_GRF_PD_VO_CON1, + ret = regmap_update_bits(lvds->grf, PX30_LVDS_GRF_PD_VO_CON1, PX30_LVDS_MODE_EN(1) | PX30_LVDS_P2S_EN(1), PX30_LVDS_MODE_EN(1) | PX30_LVDS_P2S_EN(1)); + if (ret) + pm_runtime_put(lvds->dev); + + return ret; } static void px30_lvds_poweroff(struct rockchip_lvds *lvds) -- 2.25.1
[PATCH -next 0/2] fix PM usage counter unbalance
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with the newest pm_runtime_resume_and_get to keep usage counter balanced. Zhang Qilong (2): drm/rockchip: vop: fix PM usage counter unbalance in vop ops drm/rockchip: fix PM usage counter unbalance in poweron drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- drivers/gpu/drm/rockchip/rockchip_lvds.c| 10 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) -- 2.25.1
[PATCH 3/4] drm/omap: hdmi4: fix reference leak in hdmi_runtime_get
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in hdmi_runtime_get, so we should fix it. Fixes: ac7674567c620 ("drm: omapdrm: hdmi4: Allocate the omap_hdmi data structure dynamically") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index a14fbf06cb30..33f12c351b08 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c @@ -44,8 +44,10 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi) r = pm_runtime_get_sync(&hdmi->pdev->dev); WARN_ON(r < 0); - if (r < 0) + if (r < 0) { + pm_runtime_put_noidle(&hdmi->pdev->dev); return r; + } return 0; } -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/4] drm/omap: hdmi5: fix reference leak in hdmi_runtime_get
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in hdmi_runtime_get, so we should fix it. Fixes: c44991ce21bef ("drm: omapdrm: hdmi5: Allocate the omap_hdmi data structure dynamically") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index b738d9750686..26ffbd1bd1cc 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c @@ -45,8 +45,10 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi) r = pm_runtime_get_sync(&hdmi->pdev->dev); WARN_ON(r < 0); - if (r < 0) + if (r < 0) { + pm_runtime_put_noidle(&hdmi->pdev->dev); return r; + } return 0; } -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/4] drm: omapdrm: dss: fix reference leak in dss_runtime_get
pm_runtime_get_sync() will increment pm usage at first and it will resume the device later. If runtime of the device has error or device is in inaccessible state(or other error state), resume operation will fail. If we do not call put operation to decrease the reference, it will result in reference leak in dss_runtime_get. Moreover, this device cannot enter the idle state and always stay busy or other non-idle state later. So we should fix it through adding pm_runtime_put_noidle. Fixes: 7b295257a13d8 ("drm: omapdrm: dss: Pass DSS private structure to runtime PM functions") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/dss.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 6ccbc29c4ce4..9571f3db6f71 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -858,8 +858,12 @@ int dss_runtime_get(struct dss_device *dss) DSSDBG("dss_runtime_get\n"); r = pm_runtime_get_sync(&dss->pdev->dev); - WARN_ON(r < 0); - return r < 0 ? r : 0; + if (WARN_ON(r < 0)) { + pm_runtime_put_noidle(&dss->pdev->dev); + return r; + } + + return 0; } void dss_runtime_put(struct dss_device *dss) -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/4] drm: omapdrm: dsi: fix-reference-leak-in dsi_runtime_get.
pm_runtime_get_sync() will increment pm usage at first and it will resume the device later. If runtime of the device has error or device is in inaccessible state(or other error state), resume operation will fail. If we do not call put operation to decrease the reference, it will result in reference leak in dsi_runtime_get. Moreover, this device cannot enter the idle state and always stay busy or other non-idle state later. So we should fix it through adding pm_runtime_put_noidle. Fixes: 4600ea9c49cc4 ("drm: omapdrm: dsi: Store the struct device pointer in struct dsi_data") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index eeccf40bae41..f407d9c60ada 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -1112,8 +1112,12 @@ static int dsi_runtime_get(struct dsi_data *dsi) DSSDBG("dsi_runtime_get\n"); r = pm_runtime_get_sync(dsi->dev); - WARN_ON(r < 0); - return r < 0 ? r : 0; + if (WARN_ON(r < 0)) { + pm_runtime_put_noidle(dsi->dev); + return r; + } + + return 0; } static void dsi_runtime_put(struct dsi_data *dsi) -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/4] drm/omap: fix reference leak in runtime get ops
This series of patches fixed several usage counter leaks refer to pm_runtime_get_sync. Many callers forget to call pm_runtime_put_noidle when pm_runtime_get_sync failed, and we fixed it. Zhang Qilong (4): drm: omapdrm: dsi: fix-reference-leak-in dsi_runtime_get. drm: omapdrm: dss: fix reference leak in dss_runtime_get drm/omap: hdmi4: fix reference leak in hdmi_runtime_get drm/omap: hdmi5: fix reference leak in hdmi_runtime_get drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++-- drivers/gpu/drm/omapdrm/dss/dss.c | 8 ++-- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +++- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 4 +++- 4 files changed, 18 insertions(+), 6 deletions(-) -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/2] drm: omapdrm: dss: fix reference leak in dss_runtime_get
pm_runtime_get_sync() will increment pm usage at first and it will resume the device later. If runtime of the device has error or device is in inaccessible state(or other error state), resume operation will fail. If we do not call put operation to decrease the reference, it will result in reference leak in dss_runtime_get. Moreover, this device cannot enter the idle state and always stay busy or other non-idle state later. So we should fix it through adding pm_runtime_put_noidle. Fixes: 7b295257a13d8 ("drm: omapdrm: dss: Pass DSS private structure to runtime PM functions") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/dss.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 6ccbc29c4ce4..9571f3db6f71 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -858,8 +858,12 @@ int dss_runtime_get(struct dss_device *dss) DSSDBG("dss_runtime_get\n"); r = pm_runtime_get_sync(&dss->pdev->dev); - WARN_ON(r < 0); - return r < 0 ? r : 0; + if (WARN_ON(r < 0)) { + pm_runtime_put_noidle(&dss->pdev->dev); + return r; + } + + return 0; } void dss_runtime_put(struct dss_device *dss) -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/2] drm: omapdrm: fix reference leak in runtime get ops
pm_runtime_get_sync() will increment pm usage at first and it will resume the device later. If runtime of the device has error or device is in inaccessible state(or other error state), resume operation will fail. If we do not call put operation to decrease the reference, it will result in reference leak in Moreover, this device cannot enter the idle state and always stay busy or other non-idle state later. So we should fix it through adding pm_runtime_put_noidle. Zhang Qilong (2): drm: omapdrm: dsi: fix-reference-leak-in dsi_runtime_get. drm: omapdrm: dss: fix reference leak in dss_runtime_get drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++-- drivers/gpu/drm/omapdrm/dss/dss.c | 8 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/2] drm: omapdrm: dsi: fix-reference-leak-in dsi_runtime_get.
pm_runtime_get_sync() will increment pm usage at first and it will resume the device later. If runtime of the device has error or device is in inaccessible state(or other error state), resume operation will fail. If we do not call put operation to decrease the reference, it will result in reference leak in dsi_runtime_get. Moreover, this device cannot enter the idle state and always stay busy or other non-idle state later. So we should fix it through adding pm_runtime_put_noidle. Fixes: 4600ea9c49cc4 ("drm: omapdrm: dsi: Store the struct device pointer in struct dsi_data") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index eeccf40bae41..f407d9c60ada 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -1112,8 +1112,12 @@ static int dsi_runtime_get(struct dsi_data *dsi) DSSDBG("dsi_runtime_get\n"); r = pm_runtime_get_sync(dsi->dev); - WARN_ON(r < 0); - return r < 0 ? r : 0; + if (WARN_ON(r < 0)) { + pm_runtime_put_noidle(dsi->dev); + return r; + } + + return 0; } static void dsi_runtime_put(struct dsi_data *dsi) -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/2] drm/omap: hdmi5: fix reference leak in hdmi_runtime_get
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in hdmi_runtime_get, so we should fix it. Fixes: c44991ce21bef ("drm: omapdrm: hdmi5: Allocate the omap_hdmi data structure dynamically") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index b738d9750686..26ffbd1bd1cc 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c @@ -45,8 +45,10 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi) r = pm_runtime_get_sync(&hdmi->pdev->dev); WARN_ON(r < 0); - if (r < 0) + if (r < 0) { + pm_runtime_put_noidle(&hdmi->pdev->dev); return r; + } return 0; } -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 0/2] drm/omap: hdmi: fix reference leak in error handling
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak. This two patches try to fix them in hdmi_runtime_get. Zhang Qilong (2): drm/omap: hdmi4: fix reference leak in hdmi_runtime_get drm/omap: hdmi5: fix reference leak in hdmi_runtime_get drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +++- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/2] drm/omap: hdmi4: fix reference leak in hdmi_runtime_get
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in hdmi_runtime_get, so we should fix it. Fixes: ac7674567c620 ("drm: omapdrm: hdmi4: Allocate the omap_hdmi data structure dynamically") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index a14fbf06cb30..33f12c351b08 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c @@ -44,8 +44,10 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi) r = pm_runtime_get_sync(&hdmi->pdev->dev); WARN_ON(r < 0); - if (r < 0) + if (r < 0) { + pm_runtime_put_noidle(&hdmi->pdev->dev); return r; + } return 0; } -- 2.25.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH -next] drm/nouveau/nvkm: discard unnecessary breaks
The 'break' is not necessary and reachable because of previous 'return', and we could discard it for better view. Signed-off-by: Zhang Qilong --- drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c | 1 - drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c index 350f10a3de37..2ec84b8a3b3a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c @@ -123,7 +123,6 @@ pll_map(struct nvkm_bios *bios) case NV_20: case NV_30: return nv04_pll_mapping; - break; case NV_40: return nv40_pll_mapping; case NV_50: diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c index efa50274df97..295ee352b5c6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c @@ -147,10 +147,8 @@ mcp77_clk_read(struct nvkm_clk *base, enum nv_clk_src src) switch (mast & 0x0040) { case 0x0040: return nvkm_clk_read(&clk->base, nv_clk_src_core) >> P; - break; default: return 50 >> P; - break; } break; default: -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH -next] drm/amdgpu: Discard unnecessary breaks
The 'break' is unnecessary because of previous 'return', discard it. Signed-off-by: Zhang Qilong --- drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 6 -- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 4 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 7 --- 3 files changed, 17 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c index 8339c8c3a328..fa817ebff980 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c @@ -499,10 +499,8 @@ int amdgpu_atombios_encoder_get_encoder_mode(struct drm_encoder *encoder) } else { return ATOM_ENCODER_MODE_DVI; } - break; case DRM_MODE_CONNECTOR_LVDS: return ATOM_ENCODER_MODE_LVDS; - break; case DRM_MODE_CONNECTOR_DisplayPort: dig_connector = amdgpu_connector->con_priv; if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || @@ -519,20 +517,16 @@ int amdgpu_atombios_encoder_get_encoder_mode(struct drm_encoder *encoder) } else { return ATOM_ENCODER_MODE_DVI; } - break; case DRM_MODE_CONNECTOR_eDP: return ATOM_ENCODER_MODE_DP; case DRM_MODE_CONNECTOR_DVIA: case DRM_MODE_CONNECTOR_VGA: return ATOM_ENCODER_MODE_CRT; - break; case DRM_MODE_CONNECTOR_Composite: case DRM_MODE_CONNECTOR_SVIDEO: case DRM_MODE_CONNECTOR_9PinDIN: /* fix me */ return ATOM_ENCODER_MODE_TV; - /*return ATOM_ENCODER_MODE_CV;*/ - break; } } diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 5963cbe0d455..34448df0ccf3 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -2202,22 +2202,18 @@ static int dce_v10_0_pick_dig_encoder(struct drm_encoder *encoder) return 1; else return 0; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: if (dig->linkb) return 3; else return 2; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: if (dig->linkb) return 5; else return 4; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY3: return 6; - break; default: DRM_ERROR("invalid encoder_id: 0x%x\n", amdgpu_encoder->encoder_id); return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index 1954472c8e8f..eb16f7529223 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -2235,22 +2235,18 @@ static int dce_v11_0_pick_dig_encoder(struct drm_encoder *encoder) return 1; else return 0; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: if (dig->linkb) return 3; else return 2; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: if (dig->linkb) return 5; else return 4; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY3: return 6; - break; default: DRM_ERROR("invalid encoder_id: 0x%x\n", amdgpu_encoder->encoder_id); return 0; @@ -2304,19 +2300,16 @@ static u32 dce_v11_0_pick_pll(struct drm_crtc *crtc) return ATOM_COMBOPHY_PLL1; else return ATOM_COMBOPHY_PLL0; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: if (dig->linkb) return ATOM_COMBOPHY_PLL3; else return ATOM_COMBOPHY_PLL2; - break; case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: if (dig->linkb) return ATOM_COMBOPHY_PLL5; else return ATOM_COMBOPHY_PLL4; - break; default: DRM_ERROR("invalid encoder_id: 0x%x\n", amdgpu_encoder->encoder_id); return ATOM_PPLL_INVALID; -- 2.17.1 _