Skip to contentSkip to conversation

PCI/bwctrl: Remove IRQF_ONESHOT and handle hardirqs instead

PATCH In review Ilpo Järvinen 3 participants 5 messages Nov 15, 2024 – Nov 16, 2024

Subsystems (2)
lore
Share & tools
lore

Ilpo Järvinen

author maintainer
#0 lore raw

PATCH 1/1 PCI/bwctrl: Remove IRQF_ONESHOT and handle hardirqs instead

bwctrl cannot use IRQF_ONESHOT because it shares interrupt with other service drivers that are not using IRQF_ONESHOT nor compatible with it.

Remove IRQF_ONESHOT from bwctrl and convert the irq thread to hardirq handler. Rename the handler to pcie_bwnotif_irq() to indicate its new purpose.

The IRQ handler is simple enough to not require not require other changes.

Fixes 058a4cb11620 ("PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller")
---
 drivers/pci/pcie/bwctrl.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pci/pcie/bwctrl.c +3 -5
index ff5d12e01f9c..a6c65bbe3735 100644
@@ -230,7 +230,7 @@ static void pcie_bwnotif_disable(struct pci_dev *port)
 				   PCI_EXP_LNKCTL_LBMIE | PCI_EXP_LNKCTL_LABIE);
 }
 
-static irqreturn_t pcie_bwnotif_irq_thread(int irq, void *context)
+static irqreturn_t pcie_bwnotif_irq(int irq, void *context)
 {
 	struct pcie_device *srv = context;
 	struct pcie_bwctrl_data *data = srv->port->link_bwctrl;
@@ -302,10 +302,8 @@ static int pcie_bwnotif_probe(struct pcie_device *srv)
 	if (ret)
 		return ret;
 
-	ret = devm_request_threaded_irq(&srv->device, srv->irq, NULL,
-					pcie_bwnotif_irq_thread,
-					IRQF_SHARED | IRQF_ONESHOT,
-					"PCIe bwctrl", srv);
+	ret = devm_request_irq(&srv->device, srv->irq, pcie_bwnotif_irq,
+			       IRQF_SHARED, "PCIe bwctrl", srv);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.39.5
Tested-by on v1 1/1
#1 lore raw

Hi,

Am 15.11.24 um 17:57 schrieb Ilpo Järvinen:

Quoted 7 lines

bwctrl cannot use IRQF_ONESHOT because it shares interrupt with other service drivers that are not using IRQF_ONESHOT nor compatible with it.

Remove IRQF_ONESHOT from bwctrl and convert the irq thread to hardirq handler. Rename the handler to pcie_bwnotif_irq() to indicate its new purpose.

Quoted 7 lines

The IRQ handler is simple enough to not require not require other changes.

Fixes 058a4cb11620 ("PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller")

this fixed the probing issue. Thanks

Is there anything more I can/should test?

Quoted 30 lines
---
  drivers/pci/pcie/bwctrl.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pci/pcie/bwctrl.c +3 -5
index ff5d12e01f9c..a6c65bbe3735 100644
@@ -230,7 +230,7 @@ static void pcie_bwnotif_disable(struct pci_dev *port)
  				   PCI_EXP_LNKCTL_LBMIE | PCI_EXP_LNKCTL_LABIE);
  }
 
-static irqreturn_t pcie_bwnotif_irq_thread(int irq, void *context)
+static irqreturn_t pcie_bwnotif_irq(int irq, void *context)
  {
  	struct pcie_device *srv = context;
  	struct pcie_bwctrl_data *data = srv->port->link_bwctrl;
@@ -302,10 +302,8 @@ static int pcie_bwnotif_probe(struct pcie_device *srv)
  	if (ret)
  		return ret;
 
-	ret = devm_request_threaded_irq(&srv->device, srv->irq, NULL,
-					pcie_bwnotif_irq_thread,
-					IRQF_SHARED | IRQF_ONESHOT,
-					"PCIe bwctrl", srv);
+	ret = devm_request_irq(&srv->device, srv->irq, pcie_bwnotif_irq,
+			       IRQF_SHARED, "PCIe bwctrl", srv);
  	if (ret)
  		return ret;
 
#2 lore raw
In reply to Ilpo Järvinen
Quoted 7 lines · Ilpo Järvinen

bwctrl cannot use IRQF_ONESHOT because it shares interrupt with other service drivers that are not using IRQF_ONESHOT nor compatible with it.

Remove IRQF_ONESHOT from bwctrl and convert the irq thread to hardirq handler. Rename the handler to pcie_bwnotif_irq() to indicate its new purpose.

Quoted 7 lines

The IRQ handler is simple enough to not require not require other changes.

Fixes 058a4cb11620 ("PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller")

Squashed into 058a4cb11620, thanks!

Also added your tested-by, Stefan, thanks very much for doing that!

Quoted 33 lines
---
 drivers/pci/pcie/bwctrl.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pci/pcie/bwctrl.c +3 -5
index ff5d12e01f9c..a6c65bbe3735 100644
@@ -230,7 +230,7 @@ static void pcie_bwnotif_disable(struct pci_dev *port)
 				   PCI_EXP_LNKCTL_LBMIE | PCI_EXP_LNKCTL_LABIE);
 }
 
-static irqreturn_t pcie_bwnotif_irq_thread(int irq, void *context)
+static irqreturn_t pcie_bwnotif_irq(int irq, void *context)
 {
 	struct pcie_device *srv = context;
 	struct pcie_bwctrl_data *data = srv->port->link_bwctrl;
@@ -302,10 +302,8 @@ static int pcie_bwnotif_probe(struct pcie_device *srv)
 	if (ret)
 		return ret;
 
-	ret = devm_request_threaded_irq(&srv->device, srv->irq, NULL,
-					pcie_bwnotif_irq_thread,
-					IRQF_SHARED | IRQF_ONESHOT,
-					"PCIe bwctrl", srv);
+	ret = devm_request_irq(&srv->device, srv->irq, pcie_bwnotif_irq,
+			       IRQF_SHARED, "PCIe bwctrl", srv);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.39.5
author maintainer
#3 lore raw
Quoted 11 lines · Bjorn Helgaas
Quoted 10 lines · Ilpo Järvinen

bwctrl cannot use IRQF_ONESHOT because it shares interrupt with other service drivers that are not using IRQF_ONESHOT nor compatible with it.

Remove IRQF_ONESHOT from bwctrl and convert the irq thread to hardirq handler. Rename the handler to pcie_bwnotif_irq() to indicate its new purpose.

The IRQ handler is simple enough to not require not require other changes.

Quoted 8 lines
Quoted 4 lines
Fixes 058a4cb11620 ("PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller")

Squashed into 058a4cb11620, thanks!

Also added your tested-by, Stefan, thanks very much for doing that!

Hi Bjorn,

You might want to also remove "3) ..." part from the commit message as it still refers to threaded IRQ and IRQF_ONESHOT so it won't confuse anybody when looking at this years from now :-).

Signature · 1 line
 i.
Quoted 34 lines
Quoted 33 lines
---
 drivers/pci/pcie/bwctrl.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/pci/pcie/bwctrl.c +3 -5
index ff5d12e01f9c..a6c65bbe3735 100644
@@ -230,7 +230,7 @@ static void pcie_bwnotif_disable(struct pci_dev *port)
 				   PCI_EXP_LNKCTL_LBMIE | PCI_EXP_LNKCTL_LABIE);
 }
 
-static irqreturn_t pcie_bwnotif_irq_thread(int irq, void *context)
+static irqreturn_t pcie_bwnotif_irq(int irq, void *context)
 {
 	struct pcie_device *srv = context;
 	struct pcie_bwctrl_data *data = srv->port->link_bwctrl;
@@ -302,10 +302,8 @@ static int pcie_bwnotif_probe(struct pcie_device *srv)
 	if (ret)
 		return ret;
 
-	ret = devm_request_threaded_irq(&srv->device, srv->irq, NULL,
-					pcie_bwnotif_irq_thread,
-					IRQF_SHARED | IRQF_ONESHOT,
-					"PCIe bwctrl", srv);
+	ret = devm_request_irq(&srv->device, srv->irq, pcie_bwnotif_irq,
+			       IRQF_SHARED, "PCIe bwctrl", srv);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.39.5
#4 lore raw
Quoted 20 lines · Ilpo Järvinen
Quoted 18 lines · Bjorn Helgaas
Quoted 7 lines · Ilpo Järvinen

bwctrl cannot use IRQF_ONESHOT because it shares interrupt with other service drivers that are not using IRQF_ONESHOT nor compatible with it.

Remove IRQF_ONESHOT from bwctrl and convert the irq thread to hardirq handler. Rename the handler to pcie_bwnotif_irq() to indicate its new purpose.

Quoted 7 lines

The IRQ handler is simple enough to not require not require other changes.

Fixes 058a4cb11620 ("PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller")

Squashed into 058a4cb11620, thanks!

Quoted 7 lines
Quoted 1 line

Also added your tested-by, Stefan, thanks very much for doing that!

Hi Bjorn,

You might want to also remove "3) ..." part from the commit message as it still refers to threaded IRQ and IRQF_ONESHOT so it won't confuse anybody when looking at this years from now :-).

Removed, thanks for that!