Skip to content

Commit

Permalink
Merge tag 'irq-msi-2022-01-13' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/tip/tip

Pull MSI irq updates from Thomas Gleixner:
 "Rework of the MSI interrupt infrastructure.

  This is a treewide cleanup and consolidation of MSI interrupt handling
  in preparation for further changes in this area which are necessary
  to:

   - address existing shortcomings in the VFIO area

   - support the upcoming Interrupt Message Store functionality which
     decouples the message store from the PCI config/MMIO space"

* tag 'irq-msi-2022-01-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (94 commits)
  genirq/msi: Populate sysfs entry only once
  PCI/MSI: Unbreak pci_irq_get_affinity()
  genirq/msi: Convert storage to xarray
  genirq/msi: Simplify sysfs handling
  genirq/msi: Add abuse prevention comment to msi header
  genirq/msi: Mop up old interfaces
  genirq/msi: Convert to new functions
  genirq/msi: Make interrupt allocation less convoluted
  platform-msi: Simplify platform device MSI code
  platform-msi: Let core code handle MSI descriptors
  bus: fsl-mc-msi: Simplify MSI descriptor handling
  soc: ti: ti_sci_inta_msi: Remove ti_sci_inta_msi_domain_free_irqs()
  soc: ti: ti_sci_inta_msi: Rework MSI descriptor allocation
  NTB/msi: Convert to msi_on_each_desc()
  PCI: hv: Rework MSI handling
  powerpc/mpic_u3msi: Use msi_for_each-desc()
  powerpc/fsl_msi: Use msi_for_each_desc()
  powerpc/pasemi/msi: Convert to msi_on_each_dec()
  powerpc/cell/axon_msi: Convert to msi_on_each_desc()
  powerpc/4xx/hsta: Rework MSI handling
  ...
  • Loading branch information
Linus Torvalds committed Jan 13, 2022
2 parents fd04899 + 74a5257 commit feb7a43
Show file tree
Hide file tree
Showing 73 changed files with 1,773 additions and 2,078 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ ForEachMacros:
- 'for_each_migratetype_order'
- 'for_each_msi_entry'
- 'for_each_msi_entry_safe'
- 'for_each_msi_vector'
- 'for_each_net'
- 'for_each_net_continue_reverse'
- 'for_each_netdev'
Expand Down
2 changes: 1 addition & 1 deletion Documentation/driver-api/pci/pci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PCI Support Library
.. kernel-doc:: drivers/pci/search.c
:export:

.. kernel-doc:: drivers/pci/msi.c
.. kernel-doc:: drivers/pci/msi/msi.c
:export:

.. kernel-doc:: drivers/pci/bus.c
Expand Down
32 changes: 3 additions & 29 deletions arch/mips/pci/msi-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
u64 search_mask;
int index;

if (desc->pci.msi_attrib.is_msix)
return -EINVAL;

/*
* Read the MSI config to figure out how many IRQs this device
* wants. Most devices only want 1, which will give
Expand Down Expand Up @@ -182,35 +185,6 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
return 0;
}

int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{
struct msi_desc *entry;
int ret;

/*
* MSI-X is not supported.
*/
if (type == PCI_CAP_ID_MSIX)
return -EINVAL;

/*
* If an architecture wants to support multiple MSI, it needs to
* override arch_setup_msi_irqs()
*/
if (type == PCI_CAP_ID_MSI && nvec > 1)
return 1;

for_each_pci_msi_entry(entry, dev) {
ret = arch_setup_msi_irq(dev, entry);
if (ret < 0)
return ret;
if (ret > 0)
return -ENOSPC;
}

return 0;
}

/**
* Called when a device no longer needs its MSI interrupts. All
* MSI interrupts for the device are freed.
Expand Down
25 changes: 0 additions & 25 deletions arch/powerpc/boot/dts/bluestone.dts
Original file line number Diff line number Diff line change
Expand Up @@ -366,30 +366,5 @@
0x0 0x0 0x0 0x3 &UIC3 0xe 0x4 /* swizzled int C */
0x0 0x0 0x0 0x4 &UIC3 0xf 0x4 /* swizzled int D */>;
};

MSI: ppc4xx-msi@C10000000 {
compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
reg = < 0xC 0x10000000 0x100
0xC 0x10000000 0x100>;
sdr-base = <0x36C>;
msi-data = <0x00004440>;
msi-mask = <0x0000ffe0>;
interrupts =<0 1 2 3 4 5 6 7>;
interrupt-parent = <&MSI>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
msi-available-ranges = <0x0 0x100>;
interrupt-map = <
0 &UIC3 0x18 1
1 &UIC3 0x19 1
2 &UIC3 0x1A 1
3 &UIC3 0x1B 1
4 &UIC3 0x1C 1
5 &UIC3 0x1D 1
6 &UIC3 0x1E 1
7 &UIC3 0x1F 1
>;
};
};
};
18 changes: 0 additions & 18 deletions arch/powerpc/boot/dts/canyonlands.dts
Original file line number Diff line number Diff line change
Expand Up @@ -544,23 +544,5 @@
0x0 0x0 0x0 0x3 &UIC3 0x12 0x4 /* swizzled int C */
0x0 0x0 0x0 0x4 &UIC3 0x13 0x4 /* swizzled int D */>;
};

MSI: ppc4xx-msi@C10000000 {
compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
reg = < 0xC 0x10000000 0x100>;
sdr-base = <0x36C>;
msi-data = <0x00000000>;
msi-mask = <0x44440000>;
interrupt-count = <3>;
interrupts = <0 1 2 3>;
interrupt-parent = <&UIC3>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupt-map = <0 &UIC3 0x18 1
1 &UIC3 0x19 1
2 &UIC3 0x1A 1
3 &UIC3 0x1B 1>;
};
};
};
18 changes: 0 additions & 18 deletions arch/powerpc/boot/dts/katmai.dts
Original file line number Diff line number Diff line change
Expand Up @@ -442,24 +442,6 @@
0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /* swizzled int D */>;
};

MSI: ppc4xx-msi@400300000 {
compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
reg = < 0x4 0x00300000 0x100>;
sdr-base = <0x3B0>;
msi-data = <0x00000000>;
msi-mask = <0x44440000>;
interrupt-count = <3>;
interrupts =<0 1 2 3>;
interrupt-parent = <&UIC0>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupt-map = <0 &UIC0 0xC 1
1 &UIC0 0x0D 1
2 &UIC0 0x0E 1
3 &UIC0 0x0F 1>;
};

I2O: i2o@400100000 {
compatible = "ibm,i2o-440spe";
reg = <0x00000004 0x00100000 0x100>;
Expand Down
28 changes: 0 additions & 28 deletions arch/powerpc/boot/dts/kilauea.dts
Original file line number Diff line number Diff line change
Expand Up @@ -403,33 +403,5 @@
0x0 0x0 0x0 0x3 &UIC2 0xd 0x4 /* swizzled int C */
0x0 0x0 0x0 0x4 &UIC2 0xe 0x4 /* swizzled int D */>;
};

MSI: ppc4xx-msi@C10000000 {
compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
reg = <0xEF620000 0x100>;
sdr-base = <0x4B0>;
msi-data = <0x00000000>;
msi-mask = <0x44440000>;
interrupt-count = <12>;
interrupts = <0 1 2 3 4 5 6 7 8 9 0xA 0xB 0xC 0xD>;
interrupt-parent = <&UIC2>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupt-map = <0 &UIC2 0x10 1
1 &UIC2 0x11 1
2 &UIC2 0x12 1
2 &UIC2 0x13 1
2 &UIC2 0x14 1
2 &UIC2 0x15 1
2 &UIC2 0x16 1
2 &UIC2 0x17 1
2 &UIC2 0x18 1
2 &UIC2 0x19 1
2 &UIC2 0x1A 1
2 &UIC2 0x1B 1
2 &UIC2 0x1C 1
3 &UIC2 0x1D 1>;
};
};
};
19 changes: 0 additions & 19 deletions arch/powerpc/boot/dts/redwood.dts
Original file line number Diff line number Diff line change
Expand Up @@ -358,25 +358,6 @@
0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /* swizzled int D */>;
};

MSI: ppc4xx-msi@400300000 {
compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
reg = < 0x4 0x00300000 0x100
0x4 0x00300000 0x100>;
sdr-base = <0x3B0>;
msi-data = <0x00000000>;
msi-mask = <0x44440000>;
interrupt-count = <3>;
interrupts =<0 1 2 3>;
interrupt-parent = <&UIC0>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupt-map = <0 &UIC0 0xC 1
1 &UIC0 0x0D 1
2 &UIC0 0x0E 1
3 &UIC0 0x0F 1>;
};

};


Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/40x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ config KILAUEA
select PPC4xx_PCI_EXPRESS
select FORCE_PCI
select PCI_MSI
select PPC4xx_MSI
help
This option enables support for the AMCC PPC405EX evaluation board.

Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/44x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ config BLUESTONE
select APM821xx
select FORCE_PCI
select PCI_MSI
select PPC4xx_MSI
select PPC4xx_PCI_EXPRESS
select IBM_EMAC_RGMII if IBM_EMAC
help
Expand Down Expand Up @@ -73,7 +72,6 @@ config KATMAI
select FORCE_PCI
select PPC4xx_PCI_EXPRESS
select PCI_MSI
select PPC4xx_MSI
help
This option enables support for the AMCC PPC440SPe evaluation board.

Expand Down Expand Up @@ -115,7 +113,6 @@ config CANYONLANDS
select FORCE_PCI
select PPC4xx_PCI_EXPRESS
select PCI_MSI
select PPC4xx_MSI
select IBM_EMAC_RGMII if IBM_EMAC
select IBM_EMAC_ZMII if IBM_EMAC
help
Expand All @@ -141,7 +138,6 @@ config REDWOOD
select FORCE_PCI
select PPC4xx_PCI_EXPRESS
select PCI_MSI
select PPC4xx_MSI
help
This option enables support for the AMCC PPC460SX Redwood board.

Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/4xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ obj-y += uic.o machine_check.o
obj-$(CONFIG_4xx_SOC) += soc.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_PPC4xx_HSTA_MSI) += hsta_msi.o
obj-$(CONFIG_PPC4xx_MSI) += msi.o
obj-$(CONFIG_PPC4xx_CPM) += cpm.o
obj-$(CONFIG_PPC4xx_GPIO) += gpio.o
7 changes: 2 additions & 5 deletions arch/powerpc/platforms/4xx/hsta_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static int hsta_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
return -EINVAL;
}

for_each_pci_msi_entry(entry, dev) {
msi_for_each_desc(entry, &dev->dev, MSI_DESC_NOTASSOCIATED) {
irq = msi_bitmap_alloc_hwirqs(&ppc4xx_hsta_msi.bmp, 1);
if (irq < 0) {
pr_debug("%s: Failed to allocate msi interrupt\n",
Expand Down Expand Up @@ -105,10 +105,7 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev)
struct msi_desc *entry;
int irq;

for_each_pci_msi_entry(entry, dev) {
if (!entry->irq)
continue;

msi_for_each_desc(entry, &dev->dev, MSI_DESC_ASSOCIATED) {
irq = hsta_find_hwirq_offset(entry->irq);

/* entry->irq should always be in irq_map */
Expand Down
Loading

0 comments on commit feb7a43

Please sign in to comment.