Author: emaste
Date: Mon Apr 30 01:58:24 2018
New Revision: 333095
URL: https://svnweb.freebsd.org/changeset/base/333095

Log:
  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

Modified:
  head/sys/dev/usb/net/if_smsc.c

Modified: head/sys/dev/usb/net/if_smsc.c
==============================================================================
--- head/sys/dev/usb/net/if_smsc.c      Mon Apr 30 00:07:41 2018        
(r333094)
+++ head/sys/dev/usb/net/if_smsc.c      Mon Apr 30 01:58:24 2018        
(r333095)
@@ -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");
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to