Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [CI v2 01/18] drm/xe/pci: remove broken driver_release
@ 2024-05-20 15:42 Matthew Auld
  2024-05-20 15:42 ` [CI v2 02/18] drm/xe: covert sysfs over to devm Matthew Auld
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: Matthew Auld @ 2024-05-20 15:42 UTC (permalink / raw)
  To: intel-xe; +Cc: Andrzej Hajda, Rodrigo Vivi

This is quite broken since we are nuking the pdev link to the private
driver struct, but note here that driver_release is called when the
drm_device is released (poor mans drmm), which can be long after the
device has been removed. So here what we are actually doing is nuking
the pdev link for what is potentially bound to a different drm_device.
If that happens before our pci remove callback is triggered (for the new
drm_device) we silently exit and skip some important cleanup steps,
resulting in hilarity.

There should be no reason to implement driver_release, when we already
have nicer stuff like drmm, so just remove completely. The actual pdev
link is already nuked when removing the device.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 8da90934c900..f17283c9dcb9 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -188,13 +188,6 @@ static const struct file_operations xe_driver_fops = {
 #endif
 };
 
-static void xe_driver_release(struct drm_device *dev)
-{
-	struct xe_device *xe = to_xe_device(dev);
-
-	pci_set_drvdata(to_pci_dev(xe->drm.dev), NULL);
-}
-
 static struct drm_driver driver = {
 	/* Don't use MTRRs here; the Xserver or userspace app should
 	 * deal with them for Intel hardware.
@@ -213,8 +206,6 @@ static struct drm_driver driver = {
 #ifdef CONFIG_PROC_FS
 	.show_fdinfo = xe_drm_client_fdinfo,
 #endif
-	.release = &xe_driver_release,
-
 	.ioctls = xe_ioctls,
 	.num_ioctls = ARRAY_SIZE(xe_ioctls),
 	.fops = &xe_driver_fops,
-- 
2.45.1


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

end of thread, other threads:[~2024-05-20 18:18 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-20 15:42 [CI v2 01/18] drm/xe/pci: remove broken driver_release Matthew Auld
2024-05-20 15:42 ` [CI v2 02/18] drm/xe: covert sysfs over to devm Matthew Auld
2024-05-20 15:42 ` [CI v2 03/18] drm/xe/ggtt: use drm_dev_enter to mark device section Matthew Auld
2024-05-20 15:42 ` [CI v2 04/18] drm/xe/guc: move guc_fini over to devm Matthew Auld
2024-05-20 15:42 ` [CI v2 05/18] drm/xe/guc: s/guc_fini/guc_fini_hw/ Matthew Auld
2024-05-20 15:42 ` [CI v2 06/18] drm/xe/guc_pc: move pc_fini to devm Matthew Auld
2024-05-20 15:42 ` [CI v2 07/18] drm/xe/guc_pc: s/pc_fini/pc_fini_hw/ Matthew Auld
2024-05-20 15:42 ` [CI v2 08/18] drm/xe/irq: move irq_uninstall over to devm Matthew Auld
2024-05-20 15:42 ` [CI v2 09/18] drm/xe/device: move flr " Matthew Auld
2024-05-20 15:42 ` [CI v2 10/18] drm/xe/device: move xe_device_sanitize over " Matthew Auld
2024-05-20 15:43 ` [CI v2 11/18] drm/xe/coredump: move " Matthew Auld
2024-05-20 15:43 ` [CI v2 12/18] drm/xe/gt: break out gt_fini into sw vs hw state Matthew Auld
2024-05-20 15:43 ` [CI v2 13/18] drm/xe: make gt_remove use devm Matthew Auld
2024-05-20 15:43 ` [CI v2 14/18] drm/xe/mmio: move mmio_fini over to devm Matthew Auld
2024-05-20 15:43 ` [CI v2 15/18] drm/xe: reset mmio mappings with devm Matthew Auld
2024-05-20 15:43 ` [CI v2 16/18] drm/xe/display: move display fini stuff to devm Matthew Auld
2024-05-20 15:43 ` [CI v2 17/18] drm/xe/display: stop calling domains_driver_remove twice Matthew Auld
2024-05-20 15:43 ` [CI v2 18/18] drm/xe/display: move device_remove over to drmm Matthew Auld
2024-05-20 15:51 ` ✓ CI.Patch_applied: success for series starting with [CI,v2,01/18] drm/xe/pci: remove broken driver_release Patchwork
2024-05-20 15:51 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-20 15:52 ` ✓ CI.KUnit: success " Patchwork
2024-05-20 16:04 ` ✓ CI.Build: " Patchwork
2024-05-20 16:06 ` ✗ CI.Hooks: failure " Patchwork
2024-05-20 16:08 ` ✓ CI.checksparse: success " Patchwork
2024-05-20 16:30 ` ✓ CI.BAT: " Patchwork
2024-05-20 18:18 ` ✓ CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox