Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2019 14:33:49 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r353927 - stable/11/sys/dev/usb/net
Message-ID:  <201910231433.x9NEXnTH055125@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Oct 23 14:33:49 2019
New Revision: 353927
URL: https://svnweb.freebsd.org/changeset/base/353927

Log:
  MFC r333095: 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
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/11/sys/dev/usb/net/if_smsc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/net/if_smsc.c
==============================================================================
--- stable/11/sys/dev/usb/net/if_smsc.c	Wed Oct 23 14:16:34 2019	(r353926)
+++ stable/11/sys/dev/usb/net/if_smsc.c	Wed Oct 23 14:33:49 2019	(r353927)
@@ -1304,7 +1304,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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910231433.x9NEXnTH055125>