Skip to content

genirq/msi, PCI/MSI: Spring cleaning - Part 1

Thomas Gleixner ath11k linux-hyperv linux-mips linux-pci linuxppc-dev lkml sparclinux xen-devel 1 version Applied

Status from this message: The following commit has been merged into the irq/msi branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest22 patches 15 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/22powerpc/4xx: Remove MSI support which never workedarch/powerpc/platforms/4xx/Makefile arch/powerpc/platforms/4xx/msi.c arch/powerpc/sysdev/Kconfig+0 -2880 replies
2/22PCI/MSI: Fix pci_irq_vector()/pci_irq_get_attinity()drivers/pci/msi.c+18 -80 replies
3/22genirq/msi: Guard sysfs codeinclude/linux/msi.h kernel/irq/msi.c+12 -00 replies
4/22genirq/msi: Remove unused domain callbacksinclude/linux/msi.h kernel/irq/msi.c+4 -120 replies
5/22genirq/msi: Fixup includesinclude/linux/msi.h kernel/irq/msi.c+1 -17 replies
6/22PCI/MSI: Make pci_msi_domain_write_msg() staticdrivers/irqchip/irq-gic-v2m.c drivers/irqchip/irq-gic-v3-its-pci-msi.c drivers/irqchip/irq-gic-v3-mbi.c +2 more+1 -50 replies
7/22PCI/MSI: Remove msi_desc_to_pci_sysdata()drivers/pci/msi.c include/linux/msi.h+0 -130 replies
8/22PCI/sysfs: Use pci_irq_vector()drivers/pci/pci-sysfs.c+2 -50 replies
9/22MIPS: Octeon: Use arch_setup_msi_irq()arch/mips/pci/msi-octeon.c+3 -291 reply
10/22genirq/msi, treewide: Use a named struct for PCI/MSI attributesarch/powerpc/platforms/cell/axon_msi.c arch/powerpc/platforms/powernv/pci-ioda.c arch/powerpc/platforms/pseries/msi.c +8 more+115 -1171 reply
11/22x86/hyperv: Refactor hv_msi_domain_free_irqs()arch/x86/hyperv/irqdomain.c+17 -381 reply
12/22PCI/MSI: Make arch_restore_msi_irqs() less horrible.arch/s390/pci/pci_irq.c arch/x86/include/asm/x86_init.h arch/x86/include/asm/xen/hypervisor.h +5 more+45 -650 replies
13/22PCI/MSI: Cleanup include zoodrivers/pci/msi.c+4 -120 replies
14/22PCI/MSI: Make msix_update_entries() smarterdrivers/pci/msi.c+2 -20 replies
15/22PCI/MSI: Move code into a separate directoryDocumentation/driver-api/pci/pci.rst drivers/pci/Makefile drivers/pci/msi.c +2 more+1539 -15340 replies
16/22PCI/MSI: Split out CONFIG_PCI_MSI independent partdrivers/pci/msi/Makefile drivers/pci/msi/msi.c drivers/pci/msi/pcidev_msi.c+45 -400 replies
17/22PCI/MSI: Split out !IRQDOMAIN codedrivers/pci/msi/Makefile drivers/pci/msi/legacy.c drivers/pci/msi/msi.c+54 -482 replies
18/22PCI/MSI: Split out irqdomain codedrivers/pci/msi/Makefile drivers/pci/msi/irqdomain.c drivers/pci/msi/legacy.c +3 more+339 -3200 replies
19/22PCI/MSI: Sanitize MSIX table map handlingdrivers/pci/msi/msi.c include/linux/pci.h+9 -100 replies
20/22PCI/MSI: Make pci_msi_domain_check_cap() staticdrivers/pci/msi/irqdomain.c include/linux/msi.h+3 -40 replies
21/22genirq/msi: Handle PCI/MSI allocation fail in core codedrivers/pci/msi/irqdomain.c include/linux/msi.h kernel/irq/msi.c+26 -210 replies
22/22PCI/MSI: Move descriptor counting on allocation fail to the legacy codedrivers/pci/msi/legacy.c drivers/pci/msi/msi.c+20 -190 replies

Reviews trailers per patch

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

PatchJason GunthorpeJuergen GrossKalle ValoThomas BogendoerferWei Liu
SeriesR-b T-b
1/22
2/22
3/22
4/22
5/22
6/22
7/22
8/22
9/22A-b
10/22A-b
11/22A-b
12/22
13/22
14/22
15/22
16/22
17/22
18/22
19/22
20/22
21/22
22/22

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 v1 thread

Cover letter [patch 00/22] genirq/msi, PCI/MSI: Spring cleaning - Part 1

The [PCI] MSI code has gained quite some warts over time. A recent discussion unearthed a shortcoming: the lack of support for expanding PCI/MSI-X vectors after initialization of MSI-X.

PCI/MSI-X has no requirement to setup all vectors when MSI-X is enabled in the device. The non-used vectors have just to be masked in the vector table. For PCI/MSI this is not possible because the number of vectors cannot be changed after initialization.

The PCI/MSI code, but also the core MSI irq domain code are built around the assumption that all required vectors are installed at initialization time and freed when the device is shut down by the driver.

Supporting dynamic expansion at least for MSI-X is important for VFIO so that the host side interrupts for passthrough devices can be installed on demand.

This is the first part of a large (total 101 patches) series which refactors the [PCI]MSI infrastructure to make runtime expansion of MSI-X vectors possible. The last part (10 patches) provide this functionality.

The first part is mostly a cleanup which consolidates code, moves the PCI MSI code into a separate directory and splits it up into several parts.

No functional change intended except for patch 2/N which changes the behaviour of pci_get_vector()/affinity() to get rid of the assumption that the provided index is the "index" into the descriptor list instead of using it as the actual MSI[X] index as seen by the hardware. This would break users of sparse allocated MSI-X entries, but non of them use these functions.

This series is based on 5.16-rc2 and also available via git:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-1

For the curious who can't wait for the next part to arrive the full series is available via:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-4

Thanks,

tglx

---
 arch/powerpc/platforms/4xx/msi.c            |  281 ------------
 b/Documentation/driver-api/pci/pci.rst      |    2 
 b/arch/mips/pci/msi-octeon.c                |   32 -
 b/arch/powerpc/platforms/4xx/Makefile       |    1 
 b/arch/powerpc/platforms/cell/axon_msi.c    |    2 
 b/arch/powerpc/platforms/powernv/pci-ioda.c |    4 
 b/arch/powerpc/platforms/pseries/msi.c      |    6 
 b/arch/powerpc/sysdev/Kconfig               |    6 
 b/arch/s390/pci/pci_irq.c                   |    4 
 b/arch/sparc/kernel/pci_msi.c               |    4 
 b/arch/x86/hyperv/irqdomain.c               |   55 --
 b/arch/x86/include/asm/x86_init.h           |    6 
 b/arch/x86/include/asm/xen/hypervisor.h     |    8 
 b/arch/x86/kernel/apic/msi.c                |    8 
 b/arch/x86/kernel/x86_init.c                |   12 
 b/arch/x86/pci/xen.c                        |   19 
 b/drivers/irqchip/irq-gic-v2m.c             |    1 
 b/drivers/irqchip/irq-gic-v3-its-pci-msi.c  |    1 
 b/drivers/irqchip/irq-gic-v3-mbi.c          |    1 
 b/drivers/net/wireless/ath/ath11k/pci.c     |    2 
 b/drivers/pci/Makefile                      |    3 
 b/drivers/pci/msi/Makefile                  |    7 
 b/drivers/pci/msi/irqdomain.c               |  267 +++++++++++
 b/drivers/pci/msi/legacy.c                  |   79 +++
 b/drivers/pci/msi/msi.c                     |  645 ++++------------------------
 b/drivers/pci/msi/msi.h                     |   39 +
 b/drivers/pci/msi/pcidev_msi.c              |   43 +
 b/drivers/pci/pci-sysfs.c                   |    7 
 b/drivers/pci/xen-pcifront.c                |    2 
 b/include/linux/msi.h                       |  135 ++---
 b/include/linux/pci.h                       |    1 
 b/kernel/irq/msi.c                          |   41 +
 32 files changed, 696 insertions(+), 1028 deletions(-)
Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k