All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: request shared IRQ
@ 2016-08-24 17:53 Xander Huff
  2016-08-24 18:41 ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Xander Huff @ 2016-08-24 17:53 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, linux-kernel, brad.mouring, Nathan Sullivan, xander.huff

From: Nathan Sullivan <nathan.sullivan@ni.com>

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

Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
Signed-off-by: Xander Huff <xander.huff@ni.com>
Acked-by: Ben Shelton <ben.shelton@ni.com>
Acked-by: Jaeden Amero <jaeden.amero@ni.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: request shared IRQ
  2016-08-24 17:53 [PATCH] phy: request shared IRQ Xander Huff
@ 2016-08-24 18:41 ` Sergei Shtylyov
  2016-08-24 21:15   ` Xander Huff
  2016-08-24 21:47   ` [PATCH v2] Revert "phy: IRQ cannot be shared" Xander Huff
  0 siblings, 2 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2016-08-24 18:41 UTC (permalink / raw)
  To: Xander Huff, f.fainelli
  Cc: netdev, linux-kernel, brad.mouring, Nathan Sullivan

Hello.

On 08/24/2016 08:53 PM, Xander Huff wrote:

> From: Nathan Sullivan <nathan.sullivan@ni.com>
>
> 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 <nathan.sullivan@ni.com>
> Signed-off-by: Xander Huff <xander.huff@ni.com>
> Acked-by: Ben Shelton <ben.shelton@ni.com>
> Acked-by: Jaeden Amero <jaeden.amero@ni.com>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: request shared IRQ
  2016-08-24 18:41 ` Sergei Shtylyov
@ 2016-08-24 21:15   ` Xander Huff
  2016-08-24 21:47   ` [PATCH v2] Revert "phy: IRQ cannot be shared" Xander Huff
  1 sibling, 0 replies; 5+ messages in thread
From: Xander Huff @ 2016-08-24 21:15 UTC (permalink / raw)
  To: Sergei Shtylyov, f.fainelli
  Cc: netdev, linux-kernel, brad.mouring, Nathan Sullivan

On 8/24/2016 1:41 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 08/24/2016 08:53 PM, Xander Huff wrote:
>
>> From: Nathan Sullivan <nathan.sullivan@ni.com>
>>
>> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] Revert "phy: IRQ cannot be shared"
  2016-08-24 18:41 ` Sergei Shtylyov
  2016-08-24 21:15   ` Xander Huff
@ 2016-08-24 21:47   ` Xander Huff
  2016-08-25 23:54     ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Xander Huff @ 2016-08-24 21:47 UTC (permalink / raw)
  To: f.fainelli, sergei.shtylyov
  Cc: netdev, brad.mouring, Xander Huff, linux-kernel, Nathan Sullivan

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 <xander.huff@ni.com>
Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
---
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Revert "phy: IRQ cannot be shared"
  2016-08-24 21:47   ` [PATCH v2] Revert "phy: IRQ cannot be shared" Xander Huff
@ 2016-08-25 23:54     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-08-25 23:54 UTC (permalink / raw)
  To: xander.huff
  Cc: f.fainelli, sergei.shtylyov, netdev, brad.mouring, linux-kernel,
	nathan.sullivan

From: Xander Huff <xander.huff@ni.com>
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 <xander.huff@ni.com>
> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
> ---
> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-26  0:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24 17:53 [PATCH] phy: request shared IRQ Xander Huff
2016-08-24 18:41 ` Sergei Shtylyov
2016-08-24 21:15   ` Xander Huff
2016-08-24 21:47   ` [PATCH v2] Revert "phy: IRQ cannot be shared" Xander Huff
2016-08-25 23:54     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.