[v2,13/24] drm/msm: dpu: Don't drop locks in crtc_vblank_enable

Submitted by Sean Paul on Nov. 16, 2018, 6:42 p.m.

Details

Message ID 20181116184238.170034-14-sean@poorly.run
State New
Headers show
Series "drm/msm: Various dpu locking and legacy cleanups" ( rev: 2 1 ) in Freedreno

Not browsing as part of any series.

Commit Message

Sean Paul Nov. 16, 2018, 6:42 p.m.
From: Sean Paul <seanpaul@chromium.org>

Now that runtime resume is handled in encoder, we don't need to worry
about crtc_lock recursion when calling pm_runtime_(get|put). So drop the
lock drops in _dpu_crtc_vblank_enable_no_lock().

Changes in v2:
- None

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 ------
 1 file changed, 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 9be24907f8c1..80de5289ada3 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -777,10 +777,7 @@  static void _dpu_crtc_vblank_enable_no_lock(
 	struct drm_encoder *enc;
 
 	if (enable) {
-		/* drop lock since power crtc cb may try to re-acquire lock */
-		mutex_unlock(&dpu_crtc->crtc_lock);
 		pm_runtime_get_sync(dev->dev);
-		mutex_lock(&dpu_crtc->crtc_lock);
 
 		list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
 			if (enc->crtc != crtc)
@@ -805,10 +802,7 @@  static void _dpu_crtc_vblank_enable_no_lock(
 			dpu_encoder_register_vblank_callback(enc, NULL, NULL);
 		}
 
-		/* drop lock since power crtc cb may try to re-acquire lock */
-		mutex_unlock(&dpu_crtc->crtc_lock);
 		pm_runtime_put_sync(dev->dev);
-		mutex_lock(&dpu_crtc->crtc_lock);
 	}
 }
 

Comments

On 2018-11-16 10:42, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> Now that runtime resume is handled in encoder, we don't need to worry
> about crtc_lock recursion when calling pm_runtime_(get|put). So drop 
> the
> lock drops in _dpu_crtc_vblank_enable_no_lock().
> 
> Changes in v2:
> - None
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 9be24907f8c1..80de5289ada3 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -777,10 +777,7 @@ static void _dpu_crtc_vblank_enable_no_lock(
>  	struct drm_encoder *enc;
> 
>  	if (enable) {
> -		/* drop lock since power crtc cb may try to re-acquire
> lock */
> -		mutex_unlock(&dpu_crtc->crtc_lock);
>  		pm_runtime_get_sync(dev->dev);
> -		mutex_lock(&dpu_crtc->crtc_lock);
> 
>  		list_for_each_entry(enc, &dev->mode_config.encoder_list,
> head) {
>  			if (enc->crtc != crtc)
> @@ -805,10 +802,7 @@ static void _dpu_crtc_vblank_enable_no_lock(
>  			dpu_encoder_register_vblank_callback(enc, NULL,
> NULL);
>  		}
> 
> -		/* drop lock since power crtc cb may try to re-acquire
> lock */
> -		mutex_unlock(&dpu_crtc->crtc_lock);
>  		pm_runtime_put_sync(dev->dev);
> -		mutex_lock(&dpu_crtc->crtc_lock);
>  	}
>  }