Skip to content

Commit 5c1a974

Browse files
gregkhvijay-suman
authored andcommitted
Revert "net: phy: microchip: force IRQ polling mode for lan88xx"
This reverts commit 853e14cf36f6b16a372444a1eff54a3d7c6c1268 which is commit 30a41ed32d3088cd0d682a13d7f30b23baed7e93 upstream. It is reported to cause NFS boot problems on a Raspberry Pi 3b so revert it from this branch for now. Cc: Fiona Klute <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Paolo Abeni <[email protected]> Cc: Sasha Levin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reported-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 2edc296e2107a003e383f87cdc7e29bddcb6b17e) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 7c6bfc9 commit 5c1a974

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

drivers/net/phy/microchip.c

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,47 @@ static int lan88xx_write_page(struct phy_device *phydev, int page)
3131
return __phy_write(phydev, LAN88XX_EXT_PAGE_ACCESS, page);
3232
}
3333

34+
static int lan88xx_phy_config_intr(struct phy_device *phydev)
35+
{
36+
int rc;
37+
38+
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
39+
/* unmask all source and clear them before enable */
40+
rc = phy_write(phydev, LAN88XX_INT_MASK, 0x7FFF);
41+
rc = phy_read(phydev, LAN88XX_INT_STS);
42+
rc = phy_write(phydev, LAN88XX_INT_MASK,
43+
LAN88XX_INT_MASK_MDINTPIN_EN_ |
44+
LAN88XX_INT_MASK_LINK_CHANGE_);
45+
} else {
46+
rc = phy_write(phydev, LAN88XX_INT_MASK, 0);
47+
if (rc)
48+
return rc;
49+
50+
/* Ack interrupts after they have been disabled */
51+
rc = phy_read(phydev, LAN88XX_INT_STS);
52+
}
53+
54+
return rc < 0 ? rc : 0;
55+
}
56+
57+
static irqreturn_t lan88xx_handle_interrupt(struct phy_device *phydev)
58+
{
59+
int irq_status;
60+
61+
irq_status = phy_read(phydev, LAN88XX_INT_STS);
62+
if (irq_status < 0) {
63+
phy_error(phydev);
64+
return IRQ_NONE;
65+
}
66+
67+
if (!(irq_status & LAN88XX_INT_STS_LINK_CHANGE_))
68+
return IRQ_NONE;
69+
70+
phy_trigger_machine(phydev);
71+
72+
return IRQ_HANDLED;
73+
}
74+
3475
static int lan88xx_suspend(struct phy_device *phydev)
3576
{
3677
struct lan88xx_priv *priv = phydev->priv;
@@ -347,9 +388,8 @@ static struct phy_driver microchip_phy_driver[] = {
347388
.config_aneg = lan88xx_config_aneg,
348389
.link_change_notify = lan88xx_link_change_notify,
349390

350-
/* Interrupt handling is broken, do not define related
351-
* functions to force polling.
352-
*/
391+
.config_intr = lan88xx_phy_config_intr,
392+
.handle_interrupt = lan88xx_handle_interrupt,
353393

354394
.suspend = lan88xx_suspend,
355395
.resume = genphy_resume,

0 commit comments

Comments
 (0)