[PATCH v2 00/13] PCI: xgene: Fix and simplify the MSI driver

Marc Zyngier posted 13 patches 3 months ago
drivers/pci/controller/pci-xgene-msi.c | 428 +++++++++----------------
drivers/pci/controller/pci-xgene.c     |  33 +-
include/linux/cpuhotplug.h             |   1 -
kernel/irq/chip.c                      |   8 +-
4 files changed, 187 insertions(+), 283 deletions(-)
[PATCH v2 00/13] PCI: xgene: Fix and simplify the MSI driver
Posted by Marc Zyngier 3 months ago
Having recently dipped into the xgene-msi driver to bring it to use
the MSI-parent concept, I have realised that some of it was slightly
sub-par (read: downright broken).

The driver is playing horrible tricks behind the core code, missing
proper affinity management, is terribly over-designed for no good
reason, and despite what MAINTAINERS says, completely unmaintained.

This series is an attempt to fix most of the issues, and effectively
results more or less in a full rewrite of the driver, removing a lot
of cruft and fixing the interactions with the PCI host driver in the
process (there really isn't any reason to rely on initcall ordering
anymore).

I've stopped short of repainting the MAINTAINERS file, but given how
reactive Toan Le has been, maybe that's on the cards. Patches on top
of -rc3, tested on a Mustang board. I'd really like this to hit 6.17!

* From v1:

  - Killed CPUHP_PCI_XGENE_DEAD altogether

  - Added a couple of definitions and helpers to make the hwirq/frame/group
    mapping a bit less awkward

  - More comments about the weird and wonderful behaviour of MSInIRx
    registerse

  - Collected RB from tglx, with thanks

Marc Zyngier (13):
  genirq: Teach handle_simple_irq() to resend an in-progress interrupt
  PCI: xgene: Defer probing if the MSI widget driver hasn't probed yet
  PCI: xgene: Drop useless conditional compilation
  PCI: xgene: Drop XGENE_PCIE_IP_VER_UNKN
  PCI: xgene-msi: Make per-CPU interrupt setup robust
  PCI: xgene-msi: Drop superfluous fields from xgene_msi structure
  PCI: xgene-msi: Use device-managed memory allocations
  PCI: xgene-msi: Get rid of intermediate tracking structure
  PCI: xgene-msi: Sanitise MSI allocation and affinity setting
  PCI: xgene-msi: Resend an MSI racing with itself on a different CPU
  PCI: xgene-msi: Probe as a standard platform driver
  PCI: xgene-msi: Restructure handler setup/teardown
  cpu/hotplug: Remove unused cpuhp_state CPUHP_PCI_XGENE_DEAD

 drivers/pci/controller/pci-xgene-msi.c | 428 +++++++++----------------
 drivers/pci/controller/pci-xgene.c     |  33 +-
 include/linux/cpuhotplug.h             |   1 -
 kernel/irq/chip.c                      |   8 +-
 4 files changed, 187 insertions(+), 283 deletions(-)

-- 
2.39.2
Re: [PATCH v2 00/13] PCI: xgene: Fix and simplify the MSI driver
Posted by Lorenzo Pieralisi 2 months, 3 weeks ago
On Tue, 08 Jul 2025 18:33:51 +0100, Marc Zyngier wrote:
> Having recently dipped into the xgene-msi driver to bring it to use
> the MSI-parent concept, I have realised that some of it was slightly
> sub-par (read: downright broken).
> 
> The driver is playing horrible tricks behind the core code, missing
> proper affinity management, is terribly over-designed for no good
> reason, and despite what MAINTAINERS says, completely unmaintained.
> 
> [...]

Applied to controller/xgene, thanks!

[01/13] genirq: Teach handle_simple_irq() to resend an in-progress interrupt
        https://git.kernel.org/pci/pci/c/fad9efd72b5f
[02/13] PCI: xgene: Defer probing if the MSI widget driver hasn't probed yet
        https://git.kernel.org/pci/pci/c/b3ffac51b6a7
[03/13] PCI: xgene: Drop useless conditional compilation
        https://git.kernel.org/pci/pci/c/1ded8cc14884
[04/13] PCI: xgene: Drop XGENE_PCIE_IP_VER_UNKN
        https://git.kernel.org/pci/pci/c/14a347069f71
[05/13] PCI: xgene-msi: Make per-CPU interrupt setup robust
        https://git.kernel.org/pci/pci/c/84cb4108bf6f
[06/13] PCI: xgene-msi: Drop superfluous fields from xgene_msi structure
        https://git.kernel.org/pci/pci/c/61aeded55e5b
[07/13] PCI: xgene-msi: Use device-managed memory allocations
        https://git.kernel.org/pci/pci/c/a782a50689d6
[08/13] PCI: xgene-msi: Get rid of intermediate tracking structure
        https://git.kernel.org/pci/pci/c/9a7ca398f2d4
[09/13] PCI: xgene-msi: Sanitise MSI allocation and affinity setting
        https://git.kernel.org/pci/pci/c/7112647f6d19
[10/13] PCI: xgene-msi: Resend an MSI racing with itself on a different CPU
        https://git.kernel.org/pci/pci/c/b43fa1b0691b
[11/13] PCI: xgene-msi: Probe as a standard platform driver
        https://git.kernel.org/pci/pci/c/a435be2c3318
[12/13] PCI: xgene-msi: Restructure handler setup/teardown
        https://git.kernel.org/pci/pci/c/f7d447633452
[13/13] cpu/hotplug: Remove unused cpuhp_state CPUHP_PCI_XGENE_DEAD
        https://git.kernel.org/pci/pci/c/8db22d697c52

Thanks,
Lorenzo