]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: take struct_mutex in i915_dma_cleanup()
authorDan Carpenter <error27@gmail.com>
Wed, 23 Jun 2010 11:19:55 +0000 (13:19 +0200)
committerEric Anholt <eric@anholt.net>
Thu, 1 Jul 2010 22:41:37 +0000 (15:41 -0700)
commit44b04348f5bef8d2ff37816629c5138813a34263
tree30fb8739a7197b2c499aec88f4585e7ecabcd9d3
parent148df39b6870a0eafd7f2c4464abd0016ea93e5e
drm/i915: take struct_mutex in i915_dma_cleanup()

intel_cleanup_ring_buffer() calls drm_gem_object_unreference() (as
opposed to drm_gem_object_unreference_unlocked()) so it needs to be
called with "struct_mutex" held.  If we don't hold the lock, it triggers
a BUG_ON(!mutex_is_locked(&dev->struct_mutex));

I also audited the other places that call intel_cleanup_ring_buffer()
and they all hold the lock so they're OK.

This was introduced in: a1eea4a1135 "drm/i915: introduce
intel_ring_buffer structure (V2)" and it's a regression from v2.6.34.

Addresses: https://bugzilla.kernel.org/show_bug.cgi?id=16247

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reported-by: Benny Halevy <bhalevy@panasas.com>
Tested-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_dma.c