Skip to content

Commit adccc16

Browse files
committed
Merge tag 'pci-v5.17-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull pci fix from Bjorn Helgaas: "Revert a commit that reduced the number of IRQs used but resulted in interrupt storms (Bjorn Helgaas)" * tag 'pci-v5.17-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: Revert "PCI/portdrv: Do not setup up IRQs if there are no users"
2 parents 1d41d2e + 075b7d3 commit adccc16

File tree

1 file changed

+17
-30
lines changed

1 file changed

+17
-30
lines changed

drivers/pci/pcie/portdrv_core.c

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ static int pcie_init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
166166
{
167167
int ret, i;
168168

169+
for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++)
170+
irqs[i] = -1;
171+
169172
/*
170173
* If we support PME but can't use MSI/MSI-X for it, we have to
171174
* fall back to INTx or other interrupts, e.g., a system shared
@@ -314,10 +317,8 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
314317
*/
315318
int pcie_port_device_register(struct pci_dev *dev)
316319
{
317-
int status, capabilities, irq_services, i, nr_service;
318-
int irqs[PCIE_PORT_DEVICE_MAXSERVICES] = {
319-
[0 ... PCIE_PORT_DEVICE_MAXSERVICES-1] = -1
320-
};
320+
int status, capabilities, i, nr_service;
321+
int irqs[PCIE_PORT_DEVICE_MAXSERVICES];
321322

322323
/* Enable PCI Express port device */
323324
status = pci_enable_device(dev);
@@ -330,32 +331,18 @@ int pcie_port_device_register(struct pci_dev *dev)
330331
return 0;
331332

332333
pci_set_master(dev);
333-
334-
irq_services = 0;
335-
if (IS_ENABLED(CONFIG_PCIE_PME))
336-
irq_services |= PCIE_PORT_SERVICE_PME;
337-
if (IS_ENABLED(CONFIG_PCIEAER))
338-
irq_services |= PCIE_PORT_SERVICE_AER;
339-
if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
340-
irq_services |= PCIE_PORT_SERVICE_HP;
341-
if (IS_ENABLED(CONFIG_PCIE_DPC))
342-
irq_services |= PCIE_PORT_SERVICE_DPC;
343-
irq_services &= capabilities;
344-
345-
if (irq_services) {
346-
/*
347-
* Initialize service IRQs. Don't use service devices that
348-
* require interrupts if there is no way to generate them.
349-
* However, some drivers may have a polling mode (e.g.
350-
* pciehp_poll_mode) that can be used in the absence of IRQs.
351-
* Allow them to determine if that is to be used.
352-
*/
353-
status = pcie_init_service_irqs(dev, irqs, irq_services);
354-
if (status) {
355-
irq_services &= PCIE_PORT_SERVICE_HP;
356-
if (!irq_services)
357-
goto error_disable;
358-
}
334+
/*
335+
* Initialize service irqs. Don't use service devices that
336+
* require interrupts if there is no way to generate them.
337+
* However, some drivers may have a polling mode (e.g. pciehp_poll_mode)
338+
* that can be used in the absence of irqs. Allow them to determine
339+
* if that is to be used.
340+
*/
341+
status = pcie_init_service_irqs(dev, irqs, capabilities);
342+
if (status) {
343+
capabilities &= PCIE_PORT_SERVICE_HP;
344+
if (!capabilities)
345+
goto error_disable;
359346
}
360347

361348
/* Allocate child services if any */

0 commit comments

Comments
 (0)