Use taskqueue_drain() to wait for any pending tasks to complete rather

than just pausing for a second.
This commit is contained in:
John Baldwin 2007-02-27 18:45:37 +00:00
parent 8410d79dd1
commit 3d4c1b5744
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167088

View file

@ -1365,6 +1365,8 @@ re_detach(dev)
re_stop(sc);
RL_UNLOCK(sc);
callout_drain(&sc->rl_stat_callout);
taskqueue_drain(taskqueue_fast, &sc->rl_inttask);
taskqueue_drain(taskqueue_fast, &sc->rl_txtask);
/*
* Force off the IFF_UP flag here, in case someone
* still had a BPF descriptor attached to this
@ -1398,10 +1400,6 @@ re_detach(dev)
if (sc->rl_res)
bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res);
/* Yield the CPU long enough for any tasks to drain */
tsleep(sc, PPAUSE, "rewait", hz);
/* Unload and free the RX DMA ring memory and map */
if (sc->rl_ldata.rl_rx_list_tag) {