Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Naman Jain" <namjain@linux.microsoft.com>
Cc: linux-pci@vger.kernel.org, linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v5 2/4] x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()
Date: Mon, 14 Sep 2026 11:34:54 +0000	[thread overview]
Message-ID: <20260914113454.A5A441F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914111836.2119301-3-namjain@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The use of irq_chip_retrigger_hierarchy() silently drops pending interrupts for root-level irq_chips (like lapic_controller) during CPU hotplug, because it intentionally bypasses the outermost chip.
--

commit 25a8009ce9e28c732ed15d13383d7819cd1539c8
Author: Naman Jain <namjain@linux.microsoft.com>

x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()

This patch modifies fixup_irqs() to re-inject pending interrupts by walking
the interrupt hierarchy using irq_chip_retrigger_hierarchy(), rather than
relying solely on the outermost chip. It also introduces scoped guards for
the descriptor locks and conditionally sets VECTOR_RETRIGGERED only when
the retrigger operation succeeds.

> diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
> --- a/arch/x86/kernel/irq.c
> +++ b/arch/x86/kernel/irq.c
[ ... ]
> @@ -490,21 +490,19 @@ void fixup_irqs(void)
[ ... ]
>  		if (is_vector_pending(vector)) {
> -			desc = __this_cpu_read(vector_irq[vector]);
> -
> -			raw_spin_lock(&desc->lock);
> +			guard(raw_spinlock)(&desc->lock);
>  			data = irq_desc_get_irq_data(desc);
> -			chip = irq_data_get_irq_chip(data);
> -			if (chip->irq_retrigger) {
> -				chip->irq_retrigger(data);
> +			ret = irq_chip_retrigger_hierarchy(data);
> +			if (ret)
>  				__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
> -			}
> -			raw_spin_unlock(&desc->lock);
>  		}

[Severity: High]
Does this silently drop pending interrupts for root-level irq_chips like
lapic_controller?

Looking at irq_chip_retrigger_hierarchy(), it initializes its loop by
stepping immediately to the parent data:

kernel/irq/chip.c:irq_chip_retrigger_hierarchy() {
    for (data = data->parent_data; data; data = data->parent_data)
        if (data->chip && data->chip->irq_retrigger)
            return data->chip->irq_retrigger(data);

    return 0;
}

If the interrupt relies on a non-hierarchical root domain where parent_data
is NULL, this loop will immediately exit and return 0. The valid
irq_retrigger callback on the outermost leaf chip is never executed.

Could this lead to lost hardware interrupts (such as legacy timer or ISA
interrupts) during CPU hot-unplug for these devices?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914111836.2119301-1-namjain@linux.microsoft.com?part=2

  reply	other threads:[~2026-09-14 11:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 11:18 [PATCH v5 0/4] x86/irq: Fix lost interrupts on CPU hot-unplug Naman Jain
2026-09-14 11:18 ` [PATCH v5 1/4] x86/hyperv: Set irq_retrigger for root partition PCI/MSI irqchip Naman Jain
2026-09-14 11:26   ` sashiko-bot
2026-09-14 11:18 ` [PATCH v5 2/4] x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs() Naman Jain
2026-09-14 11:34   ` sashiko-bot [this message]
2026-09-14 11:18 ` [PATCH v5 3/4] x86/irq: Use irq_chip_retrigger_hierarchy() in msi_set_affinity() Naman Jain
2026-09-14 11:29   ` sashiko-bot
2026-09-21 21:00   ` Michael Kelley
2026-09-22  3:46     ` Naman Jain
2026-09-14 11:18 ` [PATCH v5 4/4] x86/irq, iommu/amd, x86/hyperv, PCI: Drop redundant irq_retrigger inits Naman Jain
2026-09-14 11:26   ` sashiko-bot
2026-09-21 21:01   ` Michael Kelley
2026-09-22  3:46     ` Naman Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260914113454.A5A441F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=namjain@linux.microsoft.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox