[02/13] drm/omapdrm: Use unlocked gem unreferencing
diff mbox

Message ID 1459330852-27668-3-git-send-email-daniel.vetter@ffwll.ch
State New
Headers show

Commit Message

Daniel Vetter March 30, 2016, 9:40 a.m. UTC
For drm_gem_object_unreference callers are required to hold
dev->struct_mutex, which these paths don't. Enforcing this requirement
has become a bit more strict with

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

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tomi Valkeinen April 18, 2016, 4:15 p.m. UTC | #1
On 30/03/16 12:40, Daniel Vetter wrote:
> For drm_gem_object_unreference callers are required to hold
> dev->struct_mutex, which these paths don't. Enforcing this requirement
> has become a bit more strict with
> 
> 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
> 
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
> index 3cb16f0cf381..89da41ac64d2 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
> @@ -153,7 +153,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
>  		/* note: if fb creation failed, we can't rely on fb destroy
>  		 * to unref the bo:
>  		 */
> -		drm_gem_object_unreference(fbdev->bo);
> +		drm_gem_object_unreference_unlocked(fbdev->bo);
>  		ret = PTR_ERR(fb);
>  		goto fail;
>  	}
> 

If this is already queued somewhere:

Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

If not, I can pick this up.

 Tomi
Daniel Vetter April 20, 2016, 10:55 a.m. UTC | #2
On Mon, Apr 18, 2016 at 07:15:04PM +0300, Tomi Valkeinen wrote:
> On 30/03/16 12:40, Daniel Vetter wrote:
> > For drm_gem_object_unreference callers are required to hold
> > dev->struct_mutex, which these paths don't. Enforcing this requirement
> > has become a bit more strict with
> > 
> > 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
> > 
> > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
> > index 3cb16f0cf381..89da41ac64d2 100644
> > --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
> > +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
> > @@ -153,7 +153,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
> >  		/* note: if fb creation failed, we can't rely on fb destroy
> >  		 * to unref the bo:
> >  		 */
> > -		drm_gem_object_unreference(fbdev->bo);
> > +		drm_gem_object_unreference_unlocked(fbdev->bo);
> >  		ret = PTR_ERR(fb);
> >  		goto fail;
> >  	}
> > 
> 
> If this is already queued somewhere:
> 
> Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> 
> If not, I can pick this up.

I've piled all the remaining ones into a branch and will send a pull
request to Dave later this week, with this one included.

Thanks, Daniel
Laurent Pinchart April 20, 2016, 1:52 p.m. UTC | #3
Hi Daniel,

Thank you for the patch.

On Wednesday 30 Mar 2016 11:40:41 Daniel Vetter wrote:
> For drm_gem_object_unreference callers are required to hold
> dev->struct_mutex, which these paths don't. Enforcing this requirement
> has become a bit more strict with
> 
> 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
> 
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c
> b/drivers/gpu/drm/omapdrm/omap_fbdev.c index 3cb16f0cf381..89da41ac64d2
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
> @@ -153,7 +153,7 @@ static int omap_fbdev_create(struct drm_fb_helper
> *helper, /* note: if fb creation failed, we can't rely on fb destroy
>  		 * to unref the bo:
>  		 */
> -		drm_gem_object_unreference(fbdev->bo);
> +		drm_gem_object_unreference_unlocked(fbdev->bo);
>  		ret = PTR_ERR(fb);
>  		goto fail;
>  	}

Patch
diff mbox

diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 3cb16f0cf381..89da41ac64d2 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -153,7 +153,7 @@  static int omap_fbdev_create(struct drm_fb_helper *helper,
 		/* note: if fb creation failed, we can't rely on fb destroy
 		 * to unref the bo:
 		 */
-		drm_gem_object_unreference(fbdev->bo);
+		drm_gem_object_unreference_unlocked(fbdev->bo);
 		ret = PTR_ERR(fb);
 		goto fail;
 	}