drm/exynos: Use pm_runtime_resume_and_get() to replace open coding
Subsystems (3)
PATCH v2 1/1 drm/exynos: Use pm_runtime_resume_and_get() to replace open coding
use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle.
---
v2: drop unnecessary change about if condition.
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_mic.c +2 -4
@@ -268,11 +268,9 @@ static void mic_pre_enable(struct drm_bridge *bridge)if (mic->enabled) goto unlock; - ret =pm_runtime_get_sync (mic->dev); -if (ret <0 ) { -pm_runtime_put_noidle (mic->dev); + ret =pm_runtime_resume_and_get (mic->dev); +if (ret <0 ) goto unlock; - }mic_set_path (mic,1 );
Signature · 1 line
2.7.4
Quoted 2 lines · Tian Tao
use
pm_runtime_resume_and_get()to replacepm_runtime_get_syncandpm_runtime_put_noidle.
It would be good to explain why: Apparently get_sync increments the refcount even if it fails, which ususally leads to leaks.
With that or similar added to the commit message:
Quoted 30 lines
Signed-off-by Tian Tao <[email protected]>---
v2: drop unnecessary change about if condition.
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_drm_mic.c +2
-4@@ -268,11 +268,9 @@ static void mic_pre_enable(struct drm_bridge *bridge)if (mic->enabled) goto unlock; - ret =pm_runtime_get_sync (mic->dev); -if (ret <0 ) { -pm_runtime_put_noidle (mic->dev); + ret =pm_runtime_resume_and_get (mic->dev); +if (ret <0 ) goto unlock; - }mic_set_path (mic,1 );Signature · 1 line
2.7.4
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Inki Dae
maintainer21. 5. 22. 오전 12:31에 Daniel Vetter 이(가) 쓴 글:
Quoted 6 lines · Tian Tao
Quoted 2 lines
use
pm_runtime_resume_and_get()to replacepm_runtime_get_syncandpm_runtime_put_noidle.It would be good to explain why: Apparently
get_syncincrements the refcount even if it fails, which ususally leads to leaks.
Tian Tao, could you update the description?
Thanks,
Inki Dae
Quoted 36 lines
With that or similar added to the commit message:
Reviewed-by Daniel Vetter <[email protected]>Quoted 30 lines
Signed-off-by Tian Tao <[email protected]>---
v2: drop unnecessary change about if condition.
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_drm_mic.c +2
-4@@ -268,11 +268,9 @@ static void mic_pre_enable(struct drm_bridge *bridge)if (mic->enabled) goto unlock; - ret =pm_runtime_get_sync (mic->dev); -if (ret <0 ) { -pm_runtime_put_noidle (mic->dev); + ret =pm_runtime_resume_and_get (mic->dev); +if (ret <0 ) goto unlock; - }mic_set_path (mic,1 );Signature · 1 line
2.7.4
Quoted 8 lines · Inki Dae
21. 5. 22. 오전 12:31에 Daniel Vetter 이(가) 쓴 글:
Quoted 5 lines · Tian Tao
Quoted 2 lines
use
pm_runtime_resume_and_get()to replacepm_runtime_get_syncandpm_runtime_put_noidle.It would be good to explain why: Apparently
get_syncincrements the refcount even if it fails, which ususally leads to leaks.Tian Tao, could you update the description?
done:-)
Quoted 39 lines
Thanks,
Inki DaeQuoted 28 lines
With that or similar added to the commit message:
Reviewed-by Daniel Vetter <[email protected]>Quoted 24 lines
Signed-off-by Tian Tao <[email protected]>---
v2: drop unnecessary change about if condition.
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_drm_mic.c +2
-4@@ -268,11 +268,9 @@ static void mic_pre_enable(struct drm_bridge *bridge)if (mic->enabled) goto unlock; - ret =pm_runtime_get_sync (mic->dev); -if (ret <0 ) { -pm_runtime_put_noidle (mic->dev); + ret =pm_runtime_resume_and_get (mic->dev); +if (ret <0 ) goto unlock; - }Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_mic.c +0
-0mic_set_path (mic,1 );Signature · 1 line
2.7.4.