Skip to contentSkip to conversation

PCI/LINK: Request a one-shot IRQ with NULL handler

PATCH In review Borislav Petkov 2 participants 2 messages Mar 25, 2019 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/LINK: Request a one-shot IRQ with NULL handler

From: Borislav Petkov <[email protected]>

Booting v5.1-rc1 causes these new messages in dmesg here:

genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 24
pcie_bw_notification: probe of 0000:00:02.0:pcie010 failed with error -22

because requesting a threaded IRQ with NULL handler needs to be oneshot. Otherwise a level-triggered interrupt endless loop can happen, see the detailed explanation above the "Threaded irq... " error message in kernel/irq/manage.c.

And PCI-MSI type interrupts are one-shot safe but not in the IOAPIC case:

  24: ... IO-APIC   28-fasteoi   PCIe BW notif, PCIe BW notif, PCIe BW notif
  25: ... IO-APIC   29-fasteoi   PCIe BW notif, PCIe BW notif

Make the BW notification handler oneshot too.

Fixes e8303bb7a75c ("PCI/LINK: Report degraded links via link bandwidth notification")
Cc Bjorn Helgaas <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Alexandru Gagniuc <[email protected]>
---
 drivers/pci/pcie/bw_notification.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/bw_notification.c +1 -1
index d2eae3b7cc0f..16e11c09f6bd 100644
@@ -81,7 +81,7 @@ static int pcie_bandwidth_notification_probe(struct pcie_device *srv)
 		return -ENODEV;
 
 	ret = request_threaded_irq(srv->irq, NULL, pcie_bw_notification_handler,
-				   IRQF_SHARED, "PCIe BW notif", srv);
+				   IRQF_SHARED | IRQF_ONESHOT, "PCIe BW notif", srv);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.21.0
#1 lore raw

Hi Borislav,

Thanks for the update. We've settled on a different fix [1], since Lukas was not happy with IRQF_ONESHOT [2].

Alex

[1] https://lore.kernel.org/linux-pci/[email protected]/
[2] https://lore.kernel.org/linux-pci/[email protected]/

Quoted 45 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>

Booting v5.1-rc1 causes these new messages in dmesg here:

genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 24
pcie_bw_notification: probe of 0000:00:02.0:pcie010 failed with error -22

because requesting a threaded IRQ with NULL handler needs to be oneshot. Otherwise a level-triggered interrupt endless loop can happen, see the detailed explanation above the "Threaded irq... " error message in kernel/irq/manage.c.

And PCI-MSI type interrupts are one-shot safe but not in the IOAPIC case:

   24: ... IO-APIC   28-fasteoi   PCIe BW notif, PCIe BW notif, PCIe BW notif
   25: ... IO-APIC   29-fasteoi   PCIe BW notif, PCIe BW notif

Make the BW notification handler oneshot too.

Fixes e8303bb7a75c ("PCI/LINK: Report degraded links via link bandwidth notification")
Cc Bjorn Helgaas <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Alexandru Gagniuc <[email protected]>
---
  drivers/pci/pcie/bw_notification.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/bw_notification.c +1 -1
index d2eae3b7cc0f..16e11c09f6bd 100644
@@ -81,7 +81,7 @@ static int pcie_bandwidth_notification_probe(struct pcie_device *srv)
  		return -ENODEV;
 
  	ret = request_threaded_irq(srv->irq, NULL, pcie_bw_notification_handler,
-				   IRQF_SHARED, "PCIe BW notif", srv);
+				   IRQF_SHARED | IRQF_ONESHOT, "PCIe BW notif", srv);
  	if (ret)
  		return ret;