On 2025-04-25 14:04:54 [+0800], Junxiao Chang wrote: > MEI GSC interrupt comes from i915. It has top half and bottom half. > Top half is called from i915 interrupt handler. It should be in > irq disabled context. > > With RT kernel, by default i915 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 A380/A770 GPU boot hang issue with RT kernel. > > Fixes: 1e3dc1d8622b ("drm/i915/gsc: add gsc as a mei auxiliary device") > Tested-by: Furong Zhou <furong.z...@intel.com> > Suggested-by: Sebastian Andrzej Siewior <bige...@linutronix.de> > Signed-off-by: Junxiao Chang <junxiao.ch...@intel.com> > --- > drivers/gpu/drm/i915/gt/intel_gsc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_gsc.c > b/drivers/gpu/drm/i915/gt/intel_gsc.c > index 1e925c75fb080..a099d885508ac 100644 > --- a/drivers/gpu/drm/i915/gt/intel_gsc.c > +++ b/drivers/gpu/drm/i915/gt/intel_gsc.c > @@ -284,7 +284,9 @@ static void gsc_irq_handler(struct intel_gt *gt, unsigned > int intf_id) > if (gt->gsc.intf[intf_id].irq < 0) > return; > > - ret = generic_handle_irq(gt->gsc.intf[intf_id].irq); > + /* It can be called in both irq context and in thread context */
I don't know why this deserves a comment. However, generic_handle_irq() is used from the IRQ chip, everything that signals the interrupt. This, if it comes from an interrupt handler itself, should use the _safe() variant. It used to be a issue also with threaded interrupts on !RT but for other reasons this is no longer the case. > + ret = generic_handle_irq_safe(gt->gsc.intf[intf_id].irq); > + > if (ret) > gt_err_ratelimited(gt, "error handling GSC irq: %d\n", ret); > } Sebastian