linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/ast: Fix double lock at PM resume
@ 2014-05-09  6:14 Takashi Iwai
  2014-05-09  6:14 ` [PATCH 2/2] drm/exynos: Fix double locks " Takashi Iwai
  2014-05-12  8:10 ` [PATCH 1/2] drm/ast: Fix double lock " Daniel Vetter
  0 siblings, 2 replies; 4+ messages in thread
From: Takashi Iwai @ 2014-05-09  6:14 UTC (permalink / raw)
  To: David Airlie; +Cc: Daniel Vetter, dri-devel, linux-kernel

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 ast driver still takes
this lock before calling it.  Remove the caller side lock for avoid a
fatal deadlock.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/ast/ast_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index 5137f15dba19..27e56dda476d 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -94,9 +94,7 @@ static int ast_drm_thaw(struct drm_device *dev)
 	ast_post_gpu(dev);
 
 	drm_mode_config_reset(dev);
-	drm_modeset_lock_all(dev);
 	drm_helper_resume_force_mode(dev);
-	drm_modeset_unlock_all(dev);
 
 	console_lock();
 	ast_fbdev_set_suspend(dev, 0);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/exynos: Fix double locks at PM resume
  2014-05-09  6:14 [PATCH 1/2] drm/ast: Fix double lock at PM resume Takashi Iwai
@ 2014-05-09  6:14 ` Takashi Iwai
  2014-05-09  8:50   ` Inki Dae
  2014-05-12  8:10 ` [PATCH 1/2] drm/ast: Fix double lock " Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2014-05-09  6:14 UTC (permalink / raw)
  To: David Airlie; +Cc: Daniel Vetter, dri-devel, linux-kernel

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);
 
 	return 0;
 }
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] drm/exynos: Fix double locks at PM resume
  2014-05-09  6:14 ` [PATCH 2/2] drm/exynos: Fix double locks " Takashi Iwai
@ 2014-05-09  8:50   ` Inki Dae
  0 siblings, 0 replies; 4+ messages in thread
From: Inki Dae @ 2014-05-09  8:50 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: David Airlie, Daniel Vetter, linux-kernel, dri-devel

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;
>  }
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] drm/ast: Fix double lock at PM resume
  2014-05-09  6:14 [PATCH 1/2] drm/ast: Fix double lock at PM resume Takashi Iwai
  2014-05-09  6:14 ` [PATCH 2/2] drm/exynos: Fix double locks " Takashi Iwai
@ 2014-05-12  8:10 ` Daniel Vetter
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-05-12  8:10 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: David Airlie, Daniel Vetter, dri-devel, linux-kernel

On Fri, May 09, 2014 at 08:14:14AM +0200, 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 ast driver still takes
> this lock before calling it.  Remove the caller side lock for avoid a
> fatal deadlock.
> 
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Oops, failed to do the audit correctly. Thanks for catching this.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/ast/ast_drv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
> index 5137f15dba19..27e56dda476d 100644
> --- a/drivers/gpu/drm/ast/ast_drv.c
> +++ b/drivers/gpu/drm/ast/ast_drv.c
> @@ -94,9 +94,7 @@ static int ast_drm_thaw(struct drm_device *dev)
>  	ast_post_gpu(dev);
>  
>  	drm_mode_config_reset(dev);
> -	drm_modeset_lock_all(dev);
>  	drm_helper_resume_force_mode(dev);
> -	drm_modeset_unlock_all(dev);
>  
>  	console_lock();
>  	ast_fbdev_set_suspend(dev, 0);
> -- 
> 1.9.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-12  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-09  6:14 [PATCH 1/2] drm/ast: Fix double lock at PM resume Takashi Iwai
2014-05-09  6:14 ` [PATCH 2/2] drm/exynos: Fix double locks " Takashi Iwai
2014-05-09  8:50   ` Inki Dae
2014-05-12  8:10 ` [PATCH 1/2] drm/ast: Fix double lock " Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).