From owner-svn-src-head@FreeBSD.ORG Thu Aug 21 00:57:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7C7CD3; Thu, 21 Aug 2014 00:57:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93A6F3BEA; Thu, 21 Aug 2014 00:57:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7L0vXw5029824; Thu, 21 Aug 2014 00:57:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7L0vX95029823; Thu, 21 Aug 2014 00:57:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201408210057.s7L0vX95029823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 21 Aug 2014 00:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270254 - head/sys/dev/ep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2014 00:57:33 -0000 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);