On Thu, 2026-08-27 at 15:47 +0530, Arvind Yadav wrote:
> xe_irq_suspend() clears irq.enabled after disabling and synchronizing
> the
> interrupts. irq_uninstall() currently returns when that flag is
> clear, so
> a suspended device can skip free_irq() during teardown.
>
> The managed uninstall action is registered only after the IRQ request
> succeeds. Reset the interrupt registers only when interrupts are
> still
> enabled, but always free the requested IRQs.
>
> Fixes: 4d79a1266d4c ("drm/xe: Make irq enabled flag atomic")
> Cc: Matthew Brost <[email protected]>
> Cc: Thomas Hellström <[email protected]>
> Cc: Himal Prasad Ghimiray <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Arvind Yadav <[email protected]>
Reviewed-by: Thomas Hellström <[email protected]>
> ---
> drivers/gpu/drm/xe/xe_irq.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_irq.c
> b/drivers/gpu/drm/xe/xe_irq.c
> index 9e49e2241da4..d314993b14a1 100644
> --- a/drivers/gpu/drm/xe/xe_irq.c
> +++ b/drivers/gpu/drm/xe/xe_irq.c
> @@ -786,10 +786,8 @@ static void irq_uninstall(void *arg)
> {
> struct xe_device *xe = arg;
>
> - if (!atomic_xchg(&xe->irq.enabled, 0))
> - return;
> -
> - xe_irq_reset(xe);
> + if (atomic_xchg(&xe->irq.enabled, 0))
> + xe_irq_reset(xe);
>
> if (xe_device_has_msix(xe))
> xe_irq_msix_free(xe);