Skip to content

Commit

Permalink
usbnet: smsc95xx: Don't reset PHY behind PHY driver's back
Browse files Browse the repository at this point in the history
smsc95xx_reset() resets the PHY behind the PHY driver's back, which
seems like a bad idea generally.  Remove that portion of the function.

We're about to use PHY interrupts instead of polling to detect link
changes on SMSC LAN95xx chips.  Because smsc95xx_reset() is called from
usbnet_open(), PHY interrupt settings are lost whenever the net_device
is brought up.

There are two other callers of smsc95xx_reset(), namely smsc95xx_bind()
and smsc95xx_reset_resume(), and both may indeed benefit from a PHY
reset.  However they already perform one through their calls to
phy_connect_direct() and phy_init_hw().

Tested-by: Oleksij Rempel <[email protected]> # LAN9514/9512/9500
Tested-by: Ferry Toth <[email protected]> # LAN9514
Signed-off-by: Lukas Wunner <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Gabriel Hojda <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
l1k authored and davem330 committed May 13, 2022
1 parent 3108871 commit 14021da
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions drivers/net/usb/smsc95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,24 +887,6 @@ static int smsc95xx_reset(struct usbnet *dev)
return ret;
}

ret = smsc95xx_write_reg(dev, PM_CTRL, PM_CTL_PHY_RST_);
if (ret < 0)
return ret;

timeout = 0;
do {
msleep(10);
ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf);
if (ret < 0)
return ret;
timeout++;
} while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100));

if (timeout >= 100) {
netdev_warn(dev->net, "timeout waiting for PHY Reset\n");
return ret;
}

ret = smsc95xx_set_mac_address(dev);
if (ret < 0)
return ret;
Expand Down

0 comments on commit 14021da

Please sign in to comment.