All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915: use i915_gem_object_put_unlocked() after releasing mutex
@ 2016-07-21 17:39 Dave Gordon
  2016-07-21 18:00 ` Chris Wilson
  2016-07-21 18:09 ` Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Dave Gordon @ 2016-07-21 17:39 UTC (permalink / raw)
  To: intel-gfx

The exit path in intel_overlay_put_image_ioctl() first unlocks the
struct_mutex, then drops its reference to 'new_bo' by calling
i915_gem_object_put(). As it isn't holding the mutex at this point,
this should be i915_gem_object_put_unlocked().

This was previously correct but got splatted in the recent
s/drm_gem_object_unreference/i915_gem_object_put/
where the _unlocked suffix was lost in this one case.

v2: don't bother fixing whitespace glitch [Chris Wilson]
    Chris can do it next time he touches gem_evict.c ;)

Fixes: f8c417cd drm/i915: Rename drm_gem_object_unreference in preparation ...
Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 8654a32..c10ce36 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -1219,7 +1219,7 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
 out_unlock:
 	mutex_unlock(&dev->struct_mutex);
 	drm_modeset_unlock_all(dev);
-	i915_gem_object_put(new_bo);
+	i915_gem_object_put_unlocked(new_bo);
 out_free:
 	kfree(params);
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: use i915_gem_object_put_unlocked() after releasing mutex
  2016-07-21 17:39 [PATCH v2] drm/i915: use i915_gem_object_put_unlocked() after releasing mutex Dave Gordon
@ 2016-07-21 18:00 ` Chris Wilson
  2016-07-21 18:09 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2016-07-21 18:00 UTC (permalink / raw)
  To: Dave Gordon; +Cc: intel-gfx

On Thu, Jul 21, 2016 at 06:39:38PM +0100, Dave Gordon wrote:
> The exit path in intel_overlay_put_image_ioctl() first unlocks the
> struct_mutex, then drops its reference to 'new_bo' by calling
> i915_gem_object_put(). As it isn't holding the mutex at this point,
> this should be i915_gem_object_put_unlocked().
> 
> This was previously correct but got splatted in the recent
> s/drm_gem_object_unreference/i915_gem_object_put/
> where the _unlocked suffix was lost in this one case.
> 
> v2: don't bother fixing whitespace glitch [Chris Wilson]
>     Chris can do it next time he touches gem_evict.c ;)

He plans to, it is drm/i915: Release vma when the handle is closed,
where we don't need to touch the obj in that loop any more.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: use i915_gem_object_put_unlocked() after releasing mutex
  2016-07-21 17:39 [PATCH v2] drm/i915: use i915_gem_object_put_unlocked() after releasing mutex Dave Gordon
  2016-07-21 18:00 ` Chris Wilson
@ 2016-07-21 18:09 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2016-07-21 18:09 UTC (permalink / raw)
  To: Dave Gordon; +Cc: intel-gfx

On Thu, Jul 21, 2016 at 06:39:38PM +0100, Dave Gordon wrote:
> The exit path in intel_overlay_put_image_ioctl() first unlocks the
> struct_mutex, then drops its reference to 'new_bo' by calling
> i915_gem_object_put(). As it isn't holding the mutex at this point,
> this should be i915_gem_object_put_unlocked().
> 
> This was previously correct but got splatted in the recent
> s/drm_gem_object_unreference/i915_gem_object_put/
> where the _unlocked suffix was lost in this one case.
> 
> v2: don't bother fixing whitespace glitch [Chris Wilson]
>     Chris can do it next time he touches gem_evict.c ;)
> 
> Fixes: f8c417cd drm/i915: Rename drm_gem_object_unreference in preparation ...
> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

CI doesn't provide any coverage of this, so pushed.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-07-21 18:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21 17:39 [PATCH v2] drm/i915: use i915_gem_object_put_unlocked() after releasing mutex Dave Gordon
2016-07-21 18:00 ` Chris Wilson
2016-07-21 18:09 ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.