diff mbox

[2/2] drm/exynos: Fix double locks at PM resume

Message ID 1399616055-13427-2-git-send-email-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai May 9, 2014, 6:14 a.m. UTC
The recent commit [3ea87855: drm/helper: lock all around force mode
restore] introduced drm_modeset_lock_all() in
drm_helper_resume_force_mode() itself, while exynos driver takes this
lock before calling it.  Move the function call outside the lock for
avoiding a deadlock.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Inki Dae May 9, 2014, 8:50 a.m. UTC | #1
Hi,

On 2014? 05? 09? 15:14, Takashi Iwai wrote:
> The recent commit [3ea87855: drm/helper: lock all around force mode
> restore] introduced drm_modeset_lock_all() in
> drm_helper_resume_force_mode() itself, while exynos driver takes this
> lock before calling it.  Move the function call outside the lock for
> avoiding a deadlock.
> 
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 2d27ba23a6a8..79410b0c4bbf 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -183,9 +183,9 @@ static int exynos_drm_resume(struct drm_device *dev)
>  		if (connector->funcs->dpms)
>  			connector->funcs->dpms(connector, connector->dpms);
>  	}
> +	drm_modeset_unlock_all(dev);
>  
>  	drm_helper_resume_force_mode(dev);
> -	drm_modeset_unlock_all(dev);

This patch had already been posted but your patch comments what was the
problem more exactly than below one.
        http://www.spinics.net/lists/dri-devel/msg58586.html

So picked it up instead of previous one.

Thanks,
Inki Dae

>  
>  	return 0;
>  }
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 2d27ba23a6a8..79410b0c4bbf 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -183,9 +183,9 @@  static int exynos_drm_resume(struct drm_device *dev)
 		if (connector->funcs->dpms)
 			connector->funcs->dpms(connector, connector->dpms);
 	}
+	drm_modeset_unlock_all(dev);
 
 	drm_helper_resume_force_mode(dev);
-	drm_modeset_unlock_all(dev);
 
 	return 0;
 }