Skip to content

Commit 075b7d3

Browse files
committed
Revert "PCI/portdrv: Do not setup up IRQs if there are no users"
This reverts commit 0e8ae5a. 0e8ae5a ("PCI/portdrv: Do not setup up IRQs if there are no users") reduced usage of IRQs when we don't think we need them. But Joey, Sergiu, and David reported choppy GUI rendering, systems that became unresponsive every few seconds, incorrect values reported by cpufreq, and high IRQ 16 CPU usage. Joey bisected the issues to 0e8ae5a, so revert it until we figure out a better solution. Link: https://lore.kernel.org/r/20220210222717.GA658201@bhelgaas Link: https://bugzilla.kernel.org/show_bug.cgi?id=215533 Link: https://bugzilla.kernel.org/show_bug.cgi?id=215546 Reported-by: Joey Corleone <[email protected]> Reported-by: Sergiu Deitsch <[email protected]> Reported-by: David Spencer <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: [email protected] # v5.16+ Cc: Jan Kiszka <[email protected]>
1 parent e783362 commit 075b7d3

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)