All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/i915: Fix harmfull driver register/unregister assymetry
@ 2025-02-06 18:07 Janusz Krzysztofik
  2025-02-06 18:07 ` [PATCH 1/3] drm/i915: Fix PM reference not released if device register fails Janusz Krzysztofik
                   ` (10 more replies)
  0 siblings, 11 replies; 19+ messages in thread
From: Janusz Krzysztofik @ 2025-02-06 18:07 UTC (permalink / raw)
  To: intel-gfx
  Cc: dri-devel, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Lucas De Marchi, Chris Wilson, Janusz Krzysztofik

We return immediately from i915_driver_register() if drm_dev_register()
fails, skipping remaining registration steps.  However, the _unregister()
counterpart called at device remove knows nothing about that skip and
executes reverts for all those steps.  For that to work correctly, those
revert functions must be resistant to being called even on uninitialized
objects, or we must not skip their initialization.

Three cases have been identified and fixes proposed.  Call traces are
taken from CI results of igt@i915_driver_load@reload-with-fault-injection
execution, reported to several separate Gitlab issues (links provided).

Immediate return was introduced to i915_driver_register() by commit
ec3e00b4ee27 ("drm/i915: stop registering if drm_dev_register() fails"),
however, quite a few things have changed since then.  That's why I haven't
mentioned it in a Fixes: tag to avoid it being picked up by stable, which
I haven't tested.

Janusz Krzysztofik (3):
  drm/i915: Fix PM reference not released if device register fails
  drm/i915: Fix GT sysfs unregister tried even if not registered
  drm/i915: Fix device sysfs teardown tried even if not set up

 drivers/gpu/drm/i915/gt/intel_gt_sysfs.c | 3 +++
 drivers/gpu/drm/i915/i915_driver.c       | 6 ++++--
 drivers/gpu/drm/i915/i915_sysfs.c        | 3 +++
 3 files changed, 10 insertions(+), 2 deletions(-)

-- 
2.47.1


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

end of thread, other threads:[~2025-02-14 13:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 18:07 [PATCH 0/3] drm/i915: Fix harmfull driver register/unregister assymetry Janusz Krzysztofik
2025-02-06 18:07 ` [PATCH 1/3] drm/i915: Fix PM reference not released if device register fails Janusz Krzysztofik
2025-02-06 18:07 ` [PATCH 2/3] drm/i915: Fix GT sysfs unregister tried even if not registered Janusz Krzysztofik
2025-02-06 18:07 ` [PATCH 3/3] drm/i915: Fix device sysfs teardown tried even if not set up Janusz Krzysztofik
2025-02-06 20:11 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fix harmfull driver register/unregister assymetry Patchwork
2025-02-06 20:11 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-07 14:24 ` ✗ i915.CI.BAT: failure " Patchwork
2025-02-10 13:01 ` [PATCH 0/3] " Andi Shyti
2025-02-11 12:12   ` Janusz Krzysztofik
2025-02-12 15:32     ` Andi Shyti
2025-02-14 13:12       ` Janusz Krzysztofik
2025-02-12 11:50   ` Krzysztof Niemiec
2025-02-12 15:35     ` Andi Shyti
2025-02-13 14:33       ` Krzysztof Niemiec
2025-02-13 17:15         ` Lucas De Marchi
2025-02-10 14:24 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fix harmfull driver register/unregister assymetry (rev2) Patchwork
2025-02-10 14:24 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-10 15:56 ` ✓ i915.CI.BAT: success " Patchwork
2025-02-10 20:34 ` ✗ i915.CI.Full: failure " Patchwork

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.