netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH v2 net-next 2/5] net: phy: Use threaded IRQ, to allow IRQ from sleeping devices
Date: Sun, 16 Oct 2016 19:56:50 +0200	[thread overview]
Message-ID: <1476640613-25365-3-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1476640613-25365-1-git-send-email-andrew@lunn.ch>

The interrupt lines from PHYs maybe connected to I2C bus expanders, or
from switches on MDIO busses. Such interrupts are sourced from devices
which sleep, so use threaded interrupts. Threaded interrupts require
that the interrupt requester also uses the threaded API. Change the
phylib to use the threaded API, which is backwards compatible with
none-threaded IRQs.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
v2: Add back IRQF_SHARED
---
 drivers/net/phy/phy.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f424b867f73e..25f2b296aaba 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -739,10 +739,10 @@ static int phy_disable_interrupts(struct phy_device *phydev)
 int phy_start_interrupts(struct phy_device *phydev)
 {
 	atomic_set(&phydev->irq_disable, 0);
-	if (request_irq(phydev->irq, phy_interrupt,
-				IRQF_SHARED,
-				"phy_interrupt",
-				phydev) < 0) {
+	if (request_threaded_irq(phydev->irq, NULL, phy_interrupt,
+				 IRQF_ONESHOT | 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;
-- 
2.9.3

  parent reply	other threads:[~2016-10-16 17:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-16 17:56 [PATCH v2 net-next 0/5] Interrupt support for mv88e6xxx Andrew Lunn
2016-10-16 17:56 ` [PATCH v2 net-next 1/5] net: dsa: mv88e6xxx: Implement interrupt support Andrew Lunn
2016-10-16 17:56 ` Andrew Lunn [this message]
2016-10-16 17:56 ` [PATCH v2 net-next 3/5] net: phy: Threaded interrupts allow some simplification Andrew Lunn
2016-10-16 17:56 ` [PATCH v2 net-next 4/5] net: phy: Use phy name when requesting the interrupt Andrew Lunn
2016-10-16 17:56 ` [PATCH v2 net-next 5/5] arm: vf610: zii devel b: Add support for switch interrupts Andrew Lunn
2016-10-17 15:18 ` [PATCH v2 net-next 0/5] Interrupt support for mv88e6xxx David Miller
2016-10-18 18:51 ` Vivien Didelot
2016-10-18 18:57   ` Andrew Lunn
2016-10-18 19:20     ` Vivien Didelot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476640613-25365-3-git-send-email-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).