Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915: more struct_mutex locking

When auditing the locking in i915_gem.c (for a prospective change which
I then abandoned), I noticed two places where struct_mutex is not held
across GEM object manipulations that would usually require it.

Since one is in initial setup and the other in driver unload, I'm
guessing the mutex is not required for either; but post a patch in case
it is.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
ecbec53b e2377fe0

+6 -2
+1 -2
drivers/gpu/drm/i915/i915_dma.c
··· 2182 2182 /* Flush any outstanding unpin_work. */ 2183 2183 flush_workqueue(dev_priv->wq); 2184 2184 2185 - i915_gem_free_all_phys_object(dev); 2186 - 2187 2185 mutex_lock(&dev->struct_mutex); 2186 + i915_gem_free_all_phys_object(dev); 2188 2187 i915_gem_cleanup_ringbuffer(dev); 2189 2188 mutex_unlock(&dev->struct_mutex); 2190 2189 if (I915_HAS_FBC(dev) && i915_powersave)
+5
drivers/gpu/drm/i915/intel_overlay.c
··· 1416 1416 goto out_free; 1417 1417 overlay->reg_bo = reg_bo; 1418 1418 1419 + mutex_lock(&dev->struct_mutex); 1420 + 1419 1421 if (OVERLAY_NEEDS_PHYSICAL(dev)) { 1420 1422 ret = i915_gem_attach_phys_object(dev, reg_bo, 1421 1423 I915_GEM_PHYS_OVERLAY_REGS, ··· 1441 1439 goto out_unpin_bo; 1442 1440 } 1443 1441 } 1442 + 1443 + mutex_unlock(&dev->struct_mutex); 1444 1444 1445 1445 /* init all values */ 1446 1446 overlay->color_key = 0x0101fe; ··· 1468 1464 i915_gem_object_unpin(reg_bo); 1469 1465 out_free_bo: 1470 1466 drm_gem_object_unreference(&reg_bo->base); 1467 + mutex_unlock(&dev->struct_mutex); 1471 1468 out_free: 1472 1469 kfree(overlay); 1473 1470 return;