From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 21:35:24 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 612F6FD1; Sun, 15 Mar 2015 21:35:24 +0000 (UTC) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25B8FADB; Sun, 15 Mar 2015 21:35:24 +0000 (UTC) Received: by igad1 with SMTP id d1so26361563iga.0; Sun, 15 Mar 2015 14:35:23 -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=KXn16GAZSyGUeLolRl0Ujmbo3oqbkUR7Zks3Vmq62wI=; b=aCAo4z0NpZsFa/E+mXUMpUCyxXrzMttIpgNxQeLwtygjjvyjQVn51DV5BMHjp/tn9b tUI4SWYWmS7g/QT/8lRhci7iLhPfwPJYQmPi2miHXHfGcmEuZ3o7P/euxScR532hIEaL alFbvwYfCXx+jcAVuqmBr5Q0k9evsNX7nbMvQRKKE2+2SbPQusLEwet+wkVJ7Hy+LaOr SgHJdK7GjCZnz9+JI1rBh+cItOuO/u+OC/HQIPIddbG+Y3rAjMcGyP+zpS6XlMt3ApbH UL0kRso/l3iPTR4eGoYC4/e3TgmwJWMCb2Z3bBFry4GgZYy67suU+plmCRMVpa/YUuga DoVQ== MIME-Version: 1.0 X-Received: by 10.107.5.211 with SMTP id 202mr68518856iof.88.1426455323694; Sun, 15 Mar 2015 14:35:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Sun, 15 Mar 2015 14:35:23 -0700 (PDT) In-Reply-To: <201503152132.t2FLWBaw095774@svn.freebsd.org> References: <201503152132.t2FLWBaw095774@svn.freebsd.org> Date: Sun, 15 Mar 2015 14:35:23 -0700 X-Google-Sender-Auth: 6UgcfewR5CpJcwJsQ--mV6ZjoIk Message-ID: Subject: Re: svn commit: r280120 - head/sys/dev/wpi From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "freebsd-wireless@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Sun, 15 Mar 2015 21:35:24 -0000 .. promise I'm done for now. (God, it'd be nice to use git, or some web ui that lets me batch review and commit things like this.) -a On 15 March 2015 at 14:32, Adrian Chadd wrote: > Author: adrian > Date: Sun Mar 15 21:32:11 2015 > New Revision: 280120 > URL: https://svnweb.freebsd.org/changeset/base/280120 > > Log: > Add a new taskqueue (device specific, not net80211 ic->tq); use it for > device restart. > > (Committers note - once scan overhaul and a few other things have been > fixed in net80211 to not block things in the taskqueue, this can disappear > and the device specific taskqueues in other drivers can also go away.) > > PR: kern/197143 > Submitted by: Andriy Voskoboinyk > > Modified: > head/sys/dev/wpi/if_wpi.c > head/sys/dev/wpi/if_wpivar.h > > Modified: head/sys/dev/wpi/if_wpi.c > ============================================================================== > --- head/sys/dev/wpi/if_wpi.c Sun Mar 15 21:30:20 2015 (r280119) > +++ head/sys/dev/wpi/if_wpi.c Sun Mar 15 21:32:11 2015 (r280120) > @@ -532,6 +532,14 @@ wpi_attach(device_t dev) > TASK_INIT(&sc->sc_radioon_task, 0, wpi_radio_on, sc); > TASK_INIT(&sc->sc_start_task, 0, wpi_start_task, sc); > > + sc->sc_tq = taskqueue_create("wpi_taskq", M_WAITOK, > + taskqueue_thread_enqueue, &sc->sc_tq); > + error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "wpi_taskq"); > + if (error != 0) { > + device_printf(dev, "can't start threads, error %d\n", error); > + goto fail; > + } > + > wpi_sysctlattach(sc); > > /* > @@ -688,6 +696,9 @@ wpi_detach(device_t dev) > > wpi_stop(sc); > > + taskqueue_drain_all(sc->sc_tq); > + taskqueue_free(sc->sc_tq); > + > callout_drain(&sc->watchdog_rfkill); > callout_drain(&sc->tx_timeout); > callout_drain(&sc->scan_timeout); > @@ -2387,8 +2398,6 @@ wpi_intr(void *arg) > WPI_WRITE(sc, WPI_FH_INT, r2); > > if (r1 & (WPI_INT_SW_ERR | WPI_INT_HW_ERR)) { > - struct ieee80211com *ic = ifp->if_l2com; > - > device_printf(sc->sc_dev, "fatal firmware error\n"); > #ifdef WPI_DEBUG > wpi_debug_registers(sc); > @@ -2397,7 +2406,7 @@ wpi_intr(void *arg) > DPRINTF(sc, WPI_DEBUG_HW, > "(%s)\n", (r1 & WPI_INT_SW_ERR) ? "(Software Error)" : > "(Hardware Error)"); > - ieee80211_runtask(ic, &sc->sc_reinittask); > + taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); > goto end; > } > > @@ -2950,10 +2959,9 @@ wpi_scan_timeout(void *arg) > { > struct wpi_softc *sc = arg; > struct ifnet *ifp = sc->sc_ifp; > - struct ieee80211com *ic = ifp->if_l2com; > > if_printf(ifp, "scan timeout\n"); > - ieee80211_runtask(ic, &sc->sc_reinittask); > + taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); > } > > static void > @@ -2961,11 +2969,10 @@ wpi_tx_timeout(void *arg) > { > struct wpi_softc *sc = arg; > struct ifnet *ifp = sc->sc_ifp; > - struct ieee80211com *ic = ifp->if_l2com; > > if_printf(ifp, "device timeout\n"); > if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); > - ieee80211_runtask(ic, &sc->sc_reinittask); > + taskqueue_enqueue(sc->sc_tq, &sc->sc_reinittask); > } > > static int > > Modified: head/sys/dev/wpi/if_wpivar.h > ============================================================================== > --- head/sys/dev/wpi/if_wpivar.h Sun Mar 15 21:30:20 2015 (r280119) > +++ head/sys/dev/wpi/if_wpivar.h Sun Mar 15 21:32:11 2015 (r280120) > @@ -228,6 +228,9 @@ struct wpi_softc { > struct task sc_radioon_task; > struct task sc_start_task; > > + /* Taskqueue */ > + struct taskqueue *sc_tq; > + > /* Eeprom info. */ > uint8_t cap; > uint16_t rev; >