All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm: Restore driver.preclose() for all to use
@ 2020-07-23 17:21 ` Chris Wilson
  0 siblings, 0 replies; 45+ messages in thread
From: Chris Wilson @ 2020-07-23 17:21 UTC (permalink / raw)
  To: intel-gfx
  Cc: dri-devel, Chris Wilson, Daniel Vetter, Gustavo Padovan, CQ Tang, stable

An unfortunate sequence of events, but it turns out there is a valid
usecase for being able to free/decouple the driver objects before they
are freed by the DRM core. In particular, if we have a pointer into a
drm core object from inside a driver object, that pointer needs to be
nerfed *before* it is freed so that concurrent access (e.g. debugfs)
does not following the dangling pointer.

The legacy marker was adding in the code movement from drp_fops.c to
drm_file.c

References: 9acdac68bcdc ("drm: rename drm_fops.c to drm_file.c")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: CQ Tang <cq.tang@intel.com>
Cc: <stable@vger.kernel.org> # v4.12+
---
 drivers/gpu/drm/drm_file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 0ac4566ae3f4..7b4258d6f7cc 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -258,8 +258,7 @@ void drm_file_free(struct drm_file *file)
 		  (long)old_encode_dev(file->minor->kdev->devt),
 		  atomic_read(&dev->open_count));
 
-	if (drm_core_check_feature(dev, DRIVER_LEGACY) &&
-	    dev->driver->preclose)
+	if (dev->driver->preclose)
 		dev->driver->preclose(dev, file);
 
 	if (drm_core_check_feature(dev, DRIVER_LEGACY))
-- 
2.20.1


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

end of thread, other threads:[~2020-09-16  8:27 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 17:21 [PATCH 1/3] drm: Restore driver.preclose() for all to use Chris Wilson
2020-07-23 17:21 ` [Intel-gfx] " Chris Wilson
2020-07-23 17:21 ` Chris Wilson
2020-07-23 17:21 ` [PATCH 2/3] drm/i915/gem: Move context decoupling from postclose to preclose Chris Wilson
2020-07-23 17:21   ` [Intel-gfx] " Chris Wilson
2020-07-23 17:21   ` Chris Wilson
2020-07-23 17:44   ` Tang, CQ
2020-07-23 17:44     ` [Intel-gfx] " Tang, CQ
2020-07-23 17:44     ` Tang, CQ
2020-07-23 17:48     ` Chris Wilson
2020-07-23 17:48       ` [Intel-gfx] " Chris Wilson
2020-07-23 17:21 ` [PATCH 3/3] drm/i915/gem: Serialise debugfs i915_gem_objects with ctx->mutex Chris Wilson
2020-07-23 17:21   ` [Intel-gfx] " Chris Wilson
2020-07-23 17:21   ` Chris Wilson
2020-07-27 21:24   ` Sasha Levin
2020-07-27 21:24     ` [Intel-gfx] " Sasha Levin
2020-07-27 21:24     ` Sasha Levin
2020-09-14 16:45   ` [Intel-gfx] " Tvrtko Ursulin
2020-09-14 16:45     ` Tvrtko Ursulin
2020-09-14 16:45     ` Tvrtko Ursulin
2020-09-16  7:42     ` Daniel Vetter
2020-09-16  7:42       ` Daniel Vetter
2020-09-16  7:42       ` Daniel Vetter
2020-09-16  8:27       ` Tvrtko Ursulin
2020-09-16  8:27         ` Tvrtko Ursulin
2020-09-16  8:27         ` Tvrtko Ursulin
2020-07-23 17:31 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm: Restore driver.preclose() for all to use Patchwork
2020-07-23 17:31 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-07-23 17:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-07-23 20:37 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-07-27 19:32 ` [PATCH 1/3] " Daniel Vetter
2020-07-27 19:32   ` [Intel-gfx] " Daniel Vetter
2020-07-27 19:32   ` Daniel Vetter
2020-07-27 20:11   ` Tang, CQ
2020-07-27 20:11     ` [Intel-gfx] " Tang, CQ
2020-07-27 20:11     ` Tang, CQ
2020-07-28 16:27   ` Chris Wilson
2020-07-28 16:27     ` [Intel-gfx] " Chris Wilson
2020-07-28 16:27     ` Chris Wilson
2020-07-29 15:09     ` Tang, CQ
2020-07-29 15:09       ` [Intel-gfx] " Tang, CQ
2020-07-29 15:09       ` Tang, CQ
2020-07-27 21:24 ` Sasha Levin
2020-07-27 21:24   ` [Intel-gfx] " Sasha Levin
2020-07-27 21:24   ` Sasha Levin

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.