Date: Tue, 5 Nov 2013 18:27:26 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257712 - head/sys/dev/usb/wlan Message-ID: <201311051827.rA5IRQJ5085436@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Tue Nov 5 18:27:25 2013 New Revision: 257712 URL: http://svnweb.freebsd.org/changeset/base/257712 Log: Protect the "ratectl_ch" callout in the "run" driver by the "run" softc's "sc->sc_mtx" mutex. Currently the callout was marked multi-processor safe, which is fine, but it is better to start/stop/reset callouts while holding the "run" drivers own mutex. While at it add a missing "ULL" at end of the 64-bit unsigned integer constant. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Tue Nov 5 17:19:51 2013 (r257711) +++ head/sys/dev/usb/wlan/if_run.c Tue Nov 5 18:27:25 2013 (r257712) @@ -700,7 +700,7 @@ run_attach(device_t self) TASK_INIT(&sc->cmdq_task, 0, run_cmdq_cb, sc); TASK_INIT(&sc->ratectl_task, 0, run_ratectl_cb, sc); - callout_init((struct callout *)&sc->ratectl_ch, 1); + usb_callout_init_mtx(&sc->ratectl_ch, &sc->sc_mtx, 0); if (bootverbose) ieee80211_announce(ic); @@ -1010,7 +1010,7 @@ run_load_microcode(struct run_softc *sc) /* cheap sanity check */ temp = fw->data; bytes = *temp; - if (bytes != be64toh(0xffffff0210280210)) { + if (bytes != be64toh(0xffffff0210280210ULL)) { device_printf(sc->sc_dev, "firmware checksum failed\n"); error = EINVAL; goto fail; @@ -2237,8 +2237,10 @@ run_ratectl_cb(void *arg, int pending) ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc); } + RUN_LOCK(sc); if(sc->ratectl_run != RUN_RATECTL_OFF) usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); + RUN_UNLOCK(sc); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311051827.rA5IRQJ5085436>