]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: phy: Use threaded IRQ, to allow IRQ from sleeping devices
authorAndrew Lunn <andrew@lunn.ch>
Sun, 16 Oct 2016 17:56:50 +0000 (19:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Oct 2016 15:18:08 +0000 (11:18 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c

index f424b867f73e0fb4675c16e565cdeab0af8af0c8..25f2b296aaba70e3fc5f578081f89c4c079792ac 100644 (file)
@@ -739,10 +739,10 @@ phy_err:
 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;