From owner-svn-src-all@FreeBSD.ORG Thu Aug 21 01:48:29 2014 Return-Path: Delivered-To: svn-src-all@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 89EE9A7C; Thu, 21 Aug 2014 01:48:29 +0000 (UTC) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 299B03082; Thu, 21 Aug 2014 01:48:29 +0000 (UTC) Received: by mail-qg0-f43.google.com with SMTP id a108so8398138qge.30 for ; Wed, 20 Aug 2014 18:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=BLKt6bf7EW9MlLPSiqTwr8eRKa6vH2RfV+UFYI6rigA=; b=EkwW9WltNa+hOgXLA/QfkO+zh3HdisWiJRqKdRibIad1h09hGzXOH4baZMJUcrFN3l Th9f67y5OXr1X8YDgejTNbwdnnht9/pZdsszwNLFO2fN1waGPgkWbucM6pZsDuTohclJ kjgnIK0sHnv+qq5+hXxgT76E43nlZxJiUblDeTKzm0P5STQMrPvA9sRk2aUQXyXr3UU0 Px8nRFgBOEiCFH4UuoBlCmMiMdtssq/Dcv7x8sr7HbYY1mE7vhgfc0y4C/6hQ65Id4w0 hpf9eUOT4/AYPPtcTdYVn/lc8VZOOnExaSAPNxdfkNBLVOhKTnbyglvIG0If1CAPetcp qc0A== MIME-Version: 1.0 X-Received: by 10.224.75.73 with SMTP id x9mr46612858qaj.63.1408585708307; Wed, 20 Aug 2014 18:48:28 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Wed, 20 Aug 2014 18:48:28 -0700 (PDT) In-Reply-To: <201408210057.s7L0vX95029823@svn.freebsd.org> References: <201408210057.s7L0vX95029823@svn.freebsd.org> Date: Wed, 20 Aug 2014 18:48:28 -0700 X-Google-Sender-Auth: VMXIsP_tPOWMAXxZ-d2KLlkz7AY Message-ID: Subject: Re: svn commit: r270254 - head/sys/dev/ep From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2014 01:48:29 -0000 Also, I have no plans to MFC this, but it likely should be. So if you're .. bored, please feel free to MFC this as appropriate. -a On 20 August 2014 17:57, Adrian Chadd wrote: > 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); >