public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/tegra: fix locking of SET_TILING ioctl
@ 2015-11-12  7:09 Alexandre Courbot
       [not found] ` <1447312196-11470-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Courbot @ 2015-11-12  7:09 UTC (permalink / raw)
  To: Thierry Reding, Terje Bergstrom
  Cc: linux-tegra, gnurou, linux-kernel, dri-devel

drm_gem_object_unreference() now expects obj->dev->struct_mutex to be
held. Use the newly-introduced drm_gem_object_unreference_unlocked()
which handles locking for us.

If we don't do this drm_gem_object_unreference() will get noisy about
struct_mutex not being held every time we call the SET_TILING ioctl.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/drm/tegra/drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index cc48334ef164..c0ae89865958 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -683,7 +683,7 @@ static int tegra_gem_set_tiling(struct drm_device *drm, void *data,
 	bo->tiling.mode = mode;
 	bo->tiling.value = value;
 
-	drm_gem_object_unreference(gem);
+	drm_gem_object_unreference_unlocked(gem);
 
 	return 0;
 }
-- 
2.6.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/tegra: fix locking of SET_TILING ioctl
       [not found] ` <1447312196-11470-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2015-11-17 10:02   ` Daniel Vetter
  2015-11-19  4:52     ` Alexandre Courbot
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2015-11-17 10:02 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Thierry Reding, Terje Bergstrom,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, gnurou-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Thu, Nov 12, 2015 at 04:09:56PM +0900, Alexandre Courbot wrote:
> drm_gem_object_unreference() now expects obj->dev->struct_mutex to be
> held. Use the newly-introduced drm_gem_object_unreference_unlocked()
> which handles locking for us.

This rule has been really old, I simply made the checking more anal in

commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663
Author: Daniel Vetter <daniel.vetter-/w4YWyX8dFk@public.gmane.org>
Date:   Thu Oct 15 09:36:25 2015 +0200

    drm/gem: Check locking in drm_gem_object_unreference

With the above added this is:

Reviewed-by: Daniel Vetter <daniel.vetter-/w4YWyX8dFk@public.gmane.org>

> 
> If we don't do this drm_gem_object_unreference() will get noisy about
> struct_mutex not being held every time we call the SET_TILING ioctl.
> 
> Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/gpu/drm/tegra/drm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index cc48334ef164..c0ae89865958 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -683,7 +683,7 @@ static int tegra_gem_set_tiling(struct drm_device *drm, void *data,
>  	bo->tiling.mode = mode;
>  	bo->tiling.value = value;
>  
> -	drm_gem_object_unreference(gem);
> +	drm_gem_object_unreference_unlocked(gem);
>  
>  	return 0;
>  }
> -- 
> 2.6.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] drm/tegra: fix locking of SET_TILING ioctl
  2015-11-17 10:02   ` Daniel Vetter
@ 2015-11-19  4:52     ` Alexandre Courbot
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Courbot @ 2015-11-19  4:52 UTC (permalink / raw)
  To: Alexandre Courbot, Thierry Reding, Terje Bergstrom,
	linux-tegra@vger.kernel.org, Alexandre Courbot,
	Linux Kernel Mailing List, dri-devel@lists.freedesktop.org

On Tue, Nov 17, 2015 at 7:02 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Thu, Nov 12, 2015 at 04:09:56PM +0900, Alexandre Courbot wrote:
>> drm_gem_object_unreference() now expects obj->dev->struct_mutex to be
>> held. Use the newly-introduced drm_gem_object_unreference_unlocked()
>> which handles locking for us.
>
> This rule has been really old, I simply made the checking more anal in
>
> commit ef4c6270bf2867e2f8032e9614d1a8cfc6c71663
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Thu Oct 15 09:36:25 2015 +0200
>
>     drm/gem: Check locking in drm_gem_object_unreference
>
> With the above added this is:
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch

Thanks! Sending an updated version.

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

end of thread, other threads:[~2015-11-19  4:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-12  7:09 [PATCH] drm/tegra: fix locking of SET_TILING ioctl Alexandre Courbot
     [not found] ` <1447312196-11470-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-11-17 10:02   ` Daniel Vetter
2015-11-19  4:52     ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox