From 8c9b26c3c4cfa5571f2de796ccb46e0e6452f5d0 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 30 Apr 2018 01:58:24 +0000 Subject: [PATCH] if_smsc: fix reset check In smsc_phy_init function, when the driver was trying to reset PHY, it didn't poll for the correct bit (BMCR_RESET) to be cleared. Instead, it anded it with MII_BMCR (which is 0), so it just exited the loop. This issue was fixed in Linux in commit d94609200069. Submitted by: Arshan Khanifar MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/dev/usb/net/if_smsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c index 57d6a61f8f6d..85b9666dcecd 100644 --- a/sys/dev/usb/net/if_smsc.c +++ b/sys/dev/usb/net/if_smsc.c @@ -1306,7 +1306,7 @@ smsc_phy_init(struct smsc_softc *sc) do { uether_pause(&sc->sc_ue, hz / 100); bmcr = smsc_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); - } while ((bmcr & MII_BMCR) && ((ticks - start_ticks) < max_ticks)); + } while ((bmcr & BMCR_RESET) && ((ticks - start_ticks) < max_ticks)); if (((usb_ticks_t)(ticks - start_ticks)) >= max_ticks) { smsc_err_printf(sc, "PHY reset timed-out");