svn commit: r270254 - head/sys/dev/ep

Adrian Chadd adrian at FreeBSD.org
Thu Aug 21 00:57:33 UTC 2014


Author: adrian
Date: Thu Aug 21 00:57:32 2014
New Revision: 270254
URL: http://svnweb.freebsd.org/changeset/base/270254

Log:
  Add missing locking.
  
  Whilst here, assert that the lock is held when calling epstop().
  
  Tested:
  
  ep0: <3com Megahertz 574B>

Modified:
  head/sys/dev/ep/if_ep.c

Modified: head/sys/dev/ep/if_ep.c
==============================================================================
--- head/sys/dev/ep/if_ep.c	Wed Aug 20 23:37:44 2014	(r270253)
+++ head/sys/dev/ep/if_ep.c	Thu Aug 21 00:57:32 2014	(r270254)
@@ -343,7 +343,9 @@ ep_attach(struct ep_softc *sc)
 	EP_FSET(sc, F_RX_FIRST);
 	sc->top = sc->mcur = 0;
 
+	EP_LOCK(sc);
 	epstop(sc);
+	EP_UNLOCK(sc);
 
 	return (0);
 }
@@ -1000,6 +1002,9 @@ epwatchdog(struct ep_softc *sc)
 static void
 epstop(struct ep_softc *sc)
 {
+
+	EP_ASSERT_LOCKED(sc);
+
 	CSR_WRITE_2(sc, EP_COMMAND, RX_DISABLE);
 	CSR_WRITE_2(sc, EP_COMMAND, RX_DISCARD_TOP_PACK);
 	EP_BUSY_WAIT(sc);


More information about the svn-src-head mailing list