Skip to content

Commit 58aac3a

Browse files
hkallweitkuba-moo
authored andcommitted
net: phy: smsc: fix link up detection in forced irq mode
Currently link up can't be detected in forced mode if polling isn't used. Only link up interrupt source we have is aneg complete which isn't applicable in forced mode. Therefore we have to use energy-on as link up indicator. Fixes: 7365494 ("net: phy: smsc: skip ENERGYON interrupt if disabled") Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 89b59a8 commit 58aac3a

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/net/phy/smsc.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ static struct smsc_hw_stat smsc_hw_stats[] = {
4444
};
4545

4646
struct smsc_phy_priv {
47-
u16 intmask;
4847
bool energy_enable;
4948
};
5049

@@ -57,22 +56,16 @@ static int smsc_phy_ack_interrupt(struct phy_device *phydev)
5756

5857
static int smsc_phy_config_intr(struct phy_device *phydev)
5958
{
60-
struct smsc_phy_priv *priv = phydev->priv;
6159
int rc;
6260

6361
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
6462
rc = smsc_phy_ack_interrupt(phydev);
6563
if (rc)
6664
return rc;
6765

68-
priv->intmask = MII_LAN83C185_ISF_INT4 | MII_LAN83C185_ISF_INT6;
69-
if (priv->energy_enable)
70-
priv->intmask |= MII_LAN83C185_ISF_INT7;
71-
72-
rc = phy_write(phydev, MII_LAN83C185_IM, priv->intmask);
66+
rc = phy_write(phydev, MII_LAN83C185_IM,
67+
MII_LAN83C185_ISF_INT_PHYLIB_EVENTS);
7368
} else {
74-
priv->intmask = 0;
75-
7669
rc = phy_write(phydev, MII_LAN83C185_IM, 0);
7770
if (rc)
7871
return rc;
@@ -85,7 +78,6 @@ static int smsc_phy_config_intr(struct phy_device *phydev)
8578

8679
static irqreturn_t smsc_phy_handle_interrupt(struct phy_device *phydev)
8780
{
88-
struct smsc_phy_priv *priv = phydev->priv;
8981
int irq_status;
9082

9183
irq_status = phy_read(phydev, MII_LAN83C185_ISF);
@@ -96,7 +88,7 @@ static irqreturn_t smsc_phy_handle_interrupt(struct phy_device *phydev)
9688
return IRQ_NONE;
9789
}
9890

99-
if (!(irq_status & priv->intmask))
91+
if (!(irq_status & MII_LAN83C185_ISF_INT_PHYLIB_EVENTS))
10092
return IRQ_NONE;
10193

10294
phy_trigger_machine(phydev);

0 commit comments

Comments
 (0)