public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/overlay: Fix oops on unload
@ 2026-03-03 10:14 Ville Syrjala
  2026-03-03 10:25 ` Michał Grzelak
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ville Syrjala @ 2026-03-03 10:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: intel-xe

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Apparently I failed to test the unload case properly and
thus didn't notice that the i915_overlay_is_active() needs
i915->overlay after fetch_and_zero() already cleared it.
Stop using fetch_and_zero() and only clear the pointer at
the end to avoid the oops.

Fixes: 38d9a352c45e ("drm/i915/overlay: Extract i915_overlay_is_active()")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
Looks like CI did catch this but the set of different mails that
CI sends these days is such a mess that the signal to noise ratio
is extremely low. So it just slipped past my radar.

 drivers/gpu/drm/i915/i915_overlay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_overlay.c b/drivers/gpu/drm/i915/i915_overlay.c
index 28518dbb5b8e..04d5ad6aba5a 100644
--- a/drivers/gpu/drm/i915/i915_overlay.c
+++ b/drivers/gpu/drm/i915/i915_overlay.c
@@ -482,9 +482,8 @@ static void __iomem *i915_overlay_setup(struct drm_device *drm,
 static void i915_overlay_cleanup(struct drm_device *drm)
 {
 	struct drm_i915_private *i915 = to_i915(drm);
-	struct i915_overlay *overlay;
+	struct i915_overlay *overlay = i915->overlay;
 
-	overlay = fetch_and_zero(&i915->overlay);
 	if (!overlay)
 		return;
 
@@ -499,6 +498,7 @@ static void i915_overlay_cleanup(struct drm_device *drm)
 	i915_active_fini(&overlay->last_flip);
 
 	kfree(overlay);
+	i915->overlay = NULL;
 }
 
 const struct intel_display_overlay_interface i915_display_overlay_interface = {
-- 
2.52.0


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

end of thread, other threads:[~2026-03-03 20:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 10:14 [PATCH] drm/i915/overlay: Fix oops on unload Ville Syrjala
2026-03-03 10:25 ` Michał Grzelak
2026-03-03 17:17   ` Ville Syrjälä
2026-03-03 12:08 ` ✓ i915.CI.BAT: success for " Patchwork
2026-03-03 20:14 ` ✓ i915.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