Skip to contentSkip to conversation

drm/me/gsc: mei interrupt top half should be in irq disabled context

PATCH In review Junxiao Chang 3 participants 4 messages Nov 6, 2025 – Dec 11, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/me/gsc: mei interrupt top half should be in irq disabled context

MEI GSC interrupt comes from i915 or xe driver. It has top half and bottom half. Top half is called from i915/xe interrupt handler. It should be in irq disabled context.

With RT kernel(PREEMPT_RT enabled), by default IRQ handler is in threaded IRQ. MEI GSC top half might be in threaded IRQ context. generic_handle_irq_safe API could be called from either IRQ or process context, it disables local IRQ then calls MEI GSC interrupt top half.

This change fixes B580 GPU boot issue with RT enabled.

Fixes e02cea83d32d ("drm/xe/gsc: add Battlemage support")
---
 drivers/gpu/drm/xe/xe_heci_gsc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_heci_gsc.c +2 -2
index a415ca4887914..32d509b113915 100644
@@ -221,7 +221,7 @@ void xe_heci_gsc_irq_handler(struct xe_device *xe, u32 iir)
 	if (xe->heci_gsc.irq < 0)
 		return;
 
-	ret = generic_handle_irq(xe->heci_gsc.irq);
+	ret = generic_handle_irq_safe(xe->heci_gsc.irq);
 	if (ret)
 		drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret);
 }
@@ -241,7 +241,7 @@ void xe_heci_csc_irq_handler(struct xe_device *xe, u32 iir)
 	if (xe->heci_gsc.irq < 0)
 		return;
 
-	ret = generic_handle_irq(xe->heci_gsc.irq);
+	ret = generic_handle_irq_safe(xe->heci_gsc.irq);
 	if (ret)
 		drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret);
 }
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Junxiao Chang

MEI GSC interrupt comes from i915 or xe driver. It has top half and bottom half. Top half is called from i915/xe interrupt handler. It should be in irq disabled context.

With RT kernel(PREEMPT_RT enabled), by default IRQ handler is in threaded IRQ. MEI GSC top half might be in threaded IRQ context. generic_handle_irq_safe API could be called from either IRQ or process context, it disables local IRQ then calls MEI GSC interrupt top half.

Quoted 5 lines

This change fixes B580 GPU boot issue with RT enabled.

Fixes e02cea83d32d ("drm/xe/gsc: add Battlemage support")

Sounds reasonable.

What about intel_lpe_audio_irq_handler() ?

Sebastian

#2 lore raw
Quoted 3 lines

From: Sebastian Andrzej Siewior <[email protected]>
Sent: Thursday, November 6, 2025 3:16 PM
What about intel_lpe_audio_irq_handler() ?

Good finding. I will try to reproduce the issue which looks like hdmi audio related. If it could be reproduced, a separate patch will be submitted to fix it. Thank you!

#3 lore raw
In reply to Junxiao Chang

Thanks for the patch, I pushed it.

I also added Matthew Brost's r-b, as I submitted this patch separately, and b4-am recognised it as the same patch.

Kind regards,
~Maarten Lankhorst

Den 2025-11-07 kl. 04:31, skrev Junxiao Chang:

Quoted 41 lines

MEI GSC interrupt comes from i915 or xe driver. It has top half and bottom half. Top half is called from i915/xe interrupt handler. It should be in irq disabled context.

With RT kernel(PREEMPT_RT enabled), by default IRQ handler is in threaded IRQ. MEI GSC top half might be in threaded IRQ context. generic_handle_irq_safe API could be called from either IRQ or process context, it disables local IRQ then calls MEI GSC interrupt top half.

This change fixes B580 GPU boot issue with RT enabled.

Fixes e02cea83d32d ("drm/xe/gsc: add Battlemage support")
---
 drivers/gpu/drm/xe/xe_heci_gsc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_heci_gsc.c +2 -2
index a415ca4887914..32d509b113915 100644
@@ -221,7 +221,7 @@ void xe_heci_gsc_irq_handler(struct xe_device *xe, u32 iir)
 	if (xe->heci_gsc.irq < 0)
 		return;
 
-	ret = generic_handle_irq(xe->heci_gsc.irq);
+	ret = generic_handle_irq_safe(xe->heci_gsc.irq);
 	if (ret)
 		drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret);
 }
@@ -241,7 +241,7 @@ void xe_heci_csc_irq_handler(struct xe_device *xe, u32 iir)
 	if (xe->heci_gsc.irq < 0)
 		return;
 
-	ret = generic_handle_irq(xe->heci_gsc.irq);
+	ret = generic_handle_irq_safe(xe->heci_gsc.irq);
 	if (ret)
 		drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret);
 }