Skip to content

x86/irq: Fix lost interrupts on CPU hot-unplug

Naman Jain linux-hyperv linux-iommu linux-pci lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest4 patches 6 repliesIn review
  2. v54 patches 4 repliesSuperseded
  3. v44 patches 3 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches9 repliesSuperseded
v23 patches20 repliesSuperseded
v13 patches14 repliesSuperseded

Changes in v6 from the cover letter

https://lore.kernel.org/all/[email protected]/
* Commit messages refinement/correction (Michael)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/hyperv: Set irq_retrigger for root partition PCI/MSI irqchiparch/x86/hyperv/irqdomain.c+1 -00 replies
2/4x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()arch/x86/kernel/irq.c+8 -100 replies
3/4x86/irq: Use irq_chip_retrigger_hierarchy() in msi_set_affinity()arch/x86/kernel/apic/msi.c+1 -11 reply
4/4x86/irq, iommu/amd, x86/hyperv, PCI: Drop redundant irq_retrigger initsarch/x86/hyperv/irqdomain.c arch/x86/kernel/apic/io_apic.c arch/x86/kernel/apic/msi.c +3 more+0 -82 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMichael KelleyNam CaoShradha GuptaThomas GleixnerBjorn Helgaas
SeriesR-b
1/4R-b R-b
2/4R-b R-b R-b
3/4R-b R-b R-b
4/4R-b R-b R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/4] x86/irq: Fix lost interrupts on CPU hot-unplug

On CPU hot-unplug, fixup_irqs() re-injects interrupts that are still pending in the outgoing CPU's IRR via the irqchip's irq_retrigger() callback. The Hyper-V root partition PCI/MSI irqchip lost that callback when it was converted to msi_create_parent_irq_domain(), so such a pending interrupt is silently dropped, leading to lost interrupts, stalls and "No irq handler for vector" messages.

Patch 1 is the minimal, backportable fix (Fixes:/Cc: stable) that restores irq_chip_retrigger_hierarchy() on the Hyper-V root partition PCI/MSI chip. The equivalent guest pci-hyperv.c fix from the previous version is already merged, so it is dropped here.

Patch 2 then switches fixup_irqs() to call irq_chip_retrigger_hierarchy() directly which ensures that this issue does not occur for chips that miss adding this initialization.

Patch 3 makes a similar change in msi_set_affinity()

Patch 4 then drops the now-redundant irq_retrigger() initializations. This way, patch 2-4 do not need to be backported.

Changes since v5:
https://lore.kernel.org/all/[email protected]/
* Commit messages refinement/correction (Michael)

Changes since v4:
https://lore.kernel.org/all/[email protected]/
* Discussion between Thomas and Michael concluded that if-else check for irq_retrigger callback is not required, and irq_chip_retrigger_hierarchy() can safely replace all irq_retrigger invocations. Make the change to remove if-else blocks and update commit msg accordingly. Older series could not be picked because there was a genuine change in patch 1 of this series.

Changes since v3:
https://lore.kernel.org/all/[email protected]/
* Move irq_retrigger setting to hv_init_dev_msi_info() in patch 1 (Michael, Nam)
* Add if-else fallback check in msi_set_affinity() in patch 3 (Michael)
* Break patch 3 into two separate patches, while *keeping review tags*.

Changes since v2:
https://lore.kernel.org/all/[email protected]/
* Add a backportable fix for Hyper-V root partition irqchip (Wei)
* Add a check for custom irq_retrigger implementations and add direct irq_chip_retrigger_hierarchy() calls as a fallback if it is not defined by a chip. (Sashiko, Michael)
* Removed local loop variable change, and continue using the irq_desc accessor function (Michael)
* Did not pick "Acked-by: Manivannan Sadhasivam" as it was on v1, and v3 is a functionally different to some extent, specially patch 2. Requesting you to please review again.

Changes since v1:
https://lore.kernel.org/all/[email protected]/#t
* Added Review tags
* Adding minor clarification in commit msg of patch 2 (Shradha)

Original RFC: https://lore.kernel.org/all/87y0f3jhd6.ffs@fw13/

Naman Jain (4):
x86/hyperv: Set irq_retrigger for root partition PCI/MSI irqchip x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs() x86/irq: Use irq_chip_retrigger_hierarchy() in msi_set_affinity() x86/irq, iommu/amd, x86/hyperv, PCI: Drop redundant irq_retrigger
inits

 arch/x86/kernel/apic/io_apic.c      |  2 --
 arch/x86/kernel/apic/msi.c          |  4 +---
 arch/x86/kernel/hpet.c              |  1 -
 arch/x86/kernel/irq.c               | 18 ++++++++----------
 drivers/iommu/amd/init.c            |  1 -
 drivers/pci/controller/pci-hyperv.c |  1 -
 6 files changed, 9 insertions(+), 18 deletions(-)
Signature · 1 line
2.43.0