Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Aug 2014 00:57:33 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270254 - head/sys/dev/ep
Message-ID:  <201408210057.s7L0vX95029823@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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