Skip to content

Commit 2002fba

Browse files
mwallekuba-moo
authored andcommitted
net: phy: micrel: fix shared interrupt on LAN8814
Since commit ece1950 ("net: phy: micrel: 1588 support for LAN8814 phy") the handler always returns IRQ_HANDLED, except in an error case. Before that commit, the interrupt status register was checked and if it was empty, IRQ_NONE was returned. Restore that behavior to play nice with the interrupt line being shared with others. Fixes: ece1950 ("net: phy: micrel: 1588 support for LAN8814 phy") Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Horatiu Vultur <[email protected]> Reviewed-by: Divya Koppera <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e738455 commit 2002fba

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

drivers/net/phy/micrel.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,16 +2679,19 @@ static int lan8804_config_init(struct phy_device *phydev)
26792679
static irqreturn_t lan8814_handle_interrupt(struct phy_device *phydev)
26802680
{
26812681
int irq_status, tsu_irq_status;
2682+
int ret = IRQ_NONE;
26822683

26832684
irq_status = phy_read(phydev, LAN8814_INTS);
2684-
if (irq_status > 0 && (irq_status & LAN8814_INT_LINK))
2685-
phy_trigger_machine(phydev);
2686-
26872685
if (irq_status < 0) {
26882686
phy_error(phydev);
26892687
return IRQ_NONE;
26902688
}
26912689

2690+
if (irq_status & LAN8814_INT_LINK) {
2691+
phy_trigger_machine(phydev);
2692+
ret = IRQ_HANDLED;
2693+
}
2694+
26922695
while (1) {
26932696
tsu_irq_status = lanphy_read_page_reg(phydev, 4,
26942697
LAN8814_INTR_STS_REG);
@@ -2697,12 +2700,15 @@ static irqreturn_t lan8814_handle_interrupt(struct phy_device *phydev)
26972700
(tsu_irq_status & (LAN8814_INTR_STS_REG_1588_TSU0_ |
26982701
LAN8814_INTR_STS_REG_1588_TSU1_ |
26992702
LAN8814_INTR_STS_REG_1588_TSU2_ |
2700-
LAN8814_INTR_STS_REG_1588_TSU3_)))
2703+
LAN8814_INTR_STS_REG_1588_TSU3_))) {
27012704
lan8814_handle_ptp_interrupt(phydev);
2702-
else
2705+
ret = IRQ_HANDLED;
2706+
} else {
27032707
break;
2708+
}
27042709
}
2705-
return IRQ_HANDLED;
2710+
2711+
return ret;
27062712
}
27072713

27082714
static int lan8814_ack_interrupt(struct phy_device *phydev)

0 commit comments

Comments
 (0)