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

Adrian Chadd adrian at freebsd.org
Thu Aug 21 01:48:29 UTC 2014


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 <adrian at freebsd.org> 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);
>


More information about the svn-src-head mailing list