[PATCH] phy: request shared IRQ

Subsystems: ethernet phy library, networking drivers, the rest

STALE3666d REVIEWED: 2 (0M)

2 review trailers.

5 messages, 3 authors, 2016-08-26 · open the first message on its own page

[PATCH] phy: request shared IRQ

From: Xander Huff <hidden>
Date: 2016-08-24 17:54:33

From: Nathan Sullivan <redacted>

On hardware with multiple PHY devices hooked up to the same IRQ line, allow
them to share it.

Signed-off-by: Nathan Sullivan <redacted>
Signed-off-by: Xander Huff <redacted>
Acked-by: Ben Shelton <redacted>
Acked-by: Jaeden Amero <redacted>
---
 drivers/net/phy/phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c5dc2c36..0050531 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -722,8 +722,8 @@ phy_err:
 int phy_start_interrupts(struct phy_device *phydev)
 {
 	atomic_set(&phydev->irq_disable, 0);
-	if (request_irq(phydev->irq, phy_interrupt, 0, "phy_interrupt",
-			phydev) < 0) {
+	if (request_irq(phydev->irq, phy_interrupt, IRQF_SHARED,
+			"phy_interrupt", phydev) < 0) {
 		pr_warn("%s: Can't get IRQ %d (PHY)\n",
 			phydev->mdio.bus->name, phydev->irq);
 		phydev->irq = PHY_POLL;
-- 
1.9.1

Re: [PATCH] phy: request shared IRQ

From: Sergei Shtylyov <hidden>
Date: 2016-08-24 18:48:31

Hello.

On 08/24/2016 08:53 PM, Xander Huff wrote:
From: Nathan Sullivan <redacted>

On hardware with multiple PHY devices hooked up to the same IRQ line, allow
them to share it.
    Note that it had been allowed until my (erroneous?) commit 
33c133cc7598e60976a069344910d63e56cc4401 ("phy: IRQ cannot be shared"), so I'd 
like this commit just reverted instead...
    I'm not sure now what was the reason I concluded that the IRQ sharing was 
impossible... most probably I thought that the kernel IRQ handling code exited 
the loop over the IRQ actions once IRQ_HANDLED was returned -- which is 
obviously not so in reality...
Signed-off-by: Nathan Sullivan <redacted>
Signed-off-by: Xander Huff <redacted>
Acked-by: Ben Shelton <redacted>
Acked-by: Jaeden Amero <redacted>
[...]

MBR, Sergei

Re: [PATCH] phy: request shared IRQ

From: Xander Huff <hidden>
Date: 2016-08-24 22:00:38

On 8/24/2016 1:41 PM, Sergei Shtylyov wrote:
Hello.

On 08/24/2016 08:53 PM, Xander Huff wrote:
quoted
From: Nathan Sullivan <redacted>

On hardware with multiple PHY devices hooked up to the same IRQ line, allow
them to share it.
    Note that it had been allowed until my (erroneous?) commit
33c133cc7598e60976a069344910d63e56cc4401 ("phy: IRQ cannot be shared"), so I'd
like this commit just reverted instead...
    I'm not sure now what was the reason I concluded that the IRQ sharing was
impossible... most probably I thought that the kernel IRQ handling code exited
the loop over the IRQ actions once IRQ_HANDLED was returned -- which is
obviously not so in reality...

MBR, Sergei
Thanks for the suggestion, Sergei. I'll do just that.

-- 
Xander Huff
Staff Software Engineer
National Instruments

[PATCH v2] Revert "phy: IRQ cannot be shared"

From: Xander Huff <hidden>
Date: 2016-08-24 22:02:39

This reverts:
  commit 33c133cc7598 ("phy: IRQ cannot be shared")

On hardware with multiple PHY devices hooked up to the same IRQ line, allow
them to share it.

Sergei Shtylyov says:
  "I'm not sure now what was the reason I concluded that the IRQ sharing
  was impossible... most probably I thought that the kernel IRQ handling
  code exited the loop over the IRQ actions once IRQ_HANDLED was returned
  -- which is obviously not so in reality..."

Signed-off-by: Xander Huff <redacted>
Signed-off-by: Nathan Sullivan <redacted>
---
Note: this reverted code fails "CHECK: Alignment should match open
parentesis"
---
 drivers/net/phy/phy.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c5dc2c36..c6f6683 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -722,8 +722,10 @@ phy_err:
 int phy_start_interrupts(struct phy_device *phydev)
 {
 	atomic_set(&phydev->irq_disable, 0);
-	if (request_irq(phydev->irq, phy_interrupt, 0, "phy_interrupt",
-			phydev) < 0) {
+	if (request_irq(phydev->irq, phy_interrupt,
+				IRQF_SHARED,
+				"phy_interrupt",
+				phydev) < 0) {
 		pr_warn("%s: Can't get IRQ %d (PHY)\n",
 			phydev->mdio.bus->name, phydev->irq);
 		phydev->irq = PHY_POLL;
-- 
1.9.1

Re: [PATCH v2] Revert "phy: IRQ cannot be shared"

From: David Miller <hidden>
Date: 2016-08-26 00:16:59

From: Xander Huff <redacted>
Date: Wed, 24 Aug 2016 16:47:53 -0500
This reverts:
  commit 33c133cc7598 ("phy: IRQ cannot be shared")

On hardware with multiple PHY devices hooked up to the same IRQ line, allow
them to share it.

Sergei Shtylyov says:
  "I'm not sure now what was the reason I concluded that the IRQ sharing
  was impossible... most probably I thought that the kernel IRQ handling
  code exited the loop over the IRQ actions once IRQ_HANDLED was returned
  -- which is obviously not so in reality..."

Signed-off-by: Xander Huff <redacted>
Signed-off-by: Nathan Sullivan <redacted>
---
Note: this reverted code fails "CHECK: Alignment should match open
parentesis"
That's fine, we can fix up the indentation later.

Applied and queued up for -stable, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help