39b4d07aa3
In order to be fully threadsafe we need to check that the drm_gem_object refcount is still 0 after acquiring the mutex in order to call the free function. Otherwise, we may encounter scenarios like: Thread A: Thread B: drm_gem_close unreference_unlocked kref_put mutex_lock ... i915_gem_evict ... kref_get -> BUG ... i915_gem_unbind ... kref_put ... i915_gem_object_free ... mutex_unlock mutex_lock i915_gem_object_free -> BUG i915_gem_object_unbind kfree mutex_unlock Note that no driver is currently using the free_unlocked vfunc and it is scheduled for removal, hasten that process. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30454 Reported-and-Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com> |
||
---|---|---|
.. | ||
i2c | ||
ttm | ||
drm_buffer.h | ||
drm_cache.h | ||
drm_core.h | ||
drm_crtc_helper.h | ||
drm_crtc.h | ||
drm_dp_helper.h | ||
drm_edid.h | ||
drm_encoder_slave.h | ||
drm_fb_helper.h | ||
drm_fixed.h | ||
drm_global.h | ||
drm_hashtab.h | ||
drm_mem_util.h | ||
drm_memory.h | ||
drm_mm.h | ||
drm_mode.h | ||
drm_os_linux.h | ||
drm_pciids.h | ||
drm_sarea.h | ||
drm_sman.h | ||
drm_sysfs.h | ||
drm.h | ||
drmP.h | ||
i810_drm.h | ||
i830_drm.h | ||
i915_drm.h | ||
Kbuild | ||
mga_drm.h | ||
nouveau_drm.h | ||
r128_drm.h | ||
radeon_drm.h | ||
savage_drm.h | ||
sis_drm.h | ||
via_drm.h | ||
vmwgfx_drm.h |