kernel: Use callout_stop_sync() in a number of drivers.
authorSascha Wildner <saw@online.de>
Sat, 8 Feb 2014 07:49:17 +0000 (08:49 +0100)
committerSascha Wildner <saw@online.de>
Sat, 8 Feb 2014 07:49:17 +0000 (08:49 +0100)
sys/dev/crypto/glxsb/glxsb.c
sys/dev/disk/sdhci/sdhci.c
sys/dev/netif/ath/ath/if_ath.c
sys/dev/netif/ndis/if_ndis.c
sys/dev/raid/aac/aac.c
sys/dev/raid/ciss/ciss.c
sys/dev/raid/mfi/mfi.c
sys/dev/raid/mps/mps.c
sys/dev/raid/twa/tw_osl_freebsd.c
sys/netproto/802_11/wlan/ieee80211_sta.c
sys/netproto/802_11/wlan/ieee80211_wds.c

index 80db5ec..2efb1ec 100644 (file)
@@ -370,10 +370,7 @@ glxsb_detach(device_t dev)
        }
        spin_unlock(&sc->sc_sessions_lock);
        crypto_unregister_all(sc->sc_cid);
-#if 0
-       /* XXX: need implementation of callout_drain or workaround */
-       callout_drain(&sc->sc_rngco);
-#endif
+       callout_stop_sync(&sc->sc_rngco);
 
        /* XXX: thread taskqueues ? */
        /* XXX: need implementation of taskqueue_drain or workaround */
index 73ac442..ea352a9 100644 (file)
@@ -784,10 +784,7 @@ sdhci_detach(device_t dev)
                struct sdhci_slot *slot = &sc->slots[i];
                device_t d;
 
-#if 0
-               /* XXX: need implementation of callout_drain or workaround */
-               callout_drain(&slot->card_callout);
-#endif
+               callout_stop_sync(&slot->card_callout);
                taskqueue_drain(taskqueue_swi, &slot->card_task);
 
                SDHCI_LOCK(slot);
index 92c72d6..8cd59e2 100644 (file)
@@ -5423,7 +5423,7 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
                csa_run_transition = 1;
 
        wlan_serialize_exit();
-       callout_drain(&sc->sc_cal_ch);
+       callout_stop_sync(&sc->sc_cal_ch);
        wlan_serialize_enter();
        ath_hal_setledstate(ah, leds[nstate]);  /* set LED */
 
index e77f2e7..b0c5e25 100644 (file)
@@ -1035,7 +1035,7 @@ ndis_vap_delete(struct ieee80211vap *vap)
        struct ndis_softc *sc = ifp->if_softc;
 
        ndis_stop(sc);
-       callout_stop(&sc->ndis_scan_callout); /* XXX swildner callout_drain() */
+       callout_stop_sync(&sc->ndis_scan_callout);
        ieee80211_vap_detach(vap);
        kfree(nvp, M_80211_VAP);
 }
@@ -3104,7 +3104,7 @@ ndis_stop(struct ndis_softc *sc)
        int                     i;
 
        ifp = sc->ifp;
-       callout_stop(&sc->ndis_stat_callout); /* XXX swildner callout_drain() */
+       callout_stop_sync(&sc->ndis_stat_callout);
 
        NDIS_LOCK(sc);
        sc->ndis_tx_timer = 0;
index 29aa37f..b5613ae 100644 (file)
@@ -675,11 +675,7 @@ aac_detach(device_t dev)
        sc = device_get_softc(dev);
        fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
 
-#if 0 /* XXX swildner */
-       callout_drain(&sc->aac_daemontime);
-#else
-       callout_stop(&sc->aac_daemontime);
-#endif
+       callout_stop_sync(&sc->aac_daemontime);
 
        lockmgr(&sc->aac_io_lock, LK_EXCLUSIVE);
        while (sc->aifflags & AAC_AIFFLAGS_RUNNING) {
index a0928e6..5ec98cd 100644 (file)
@@ -1913,11 +1913,7 @@ ciss_free(struct ciss_softc *sc)
        destroy_dev(sc->ciss_dev_t);
 
     /* Final cleanup of the callout. */
-#if 0 /* XXX swildner callout_drain */
-    callout_drain(&sc->ciss_periodic);
-#else
-    callout_stop(&sc->ciss_periodic);
-#endif
+    callout_stop_sync(&sc->ciss_periodic);
     lockuninit(&sc->ciss_lock);
 
     /* free the controller data */
index 070b3ac..18f5bf2 100644 (file)
@@ -1085,7 +1085,7 @@ mfi_free(struct mfi_softc *sc)
        struct mfi_command *cm;
        int i;
 
-       callout_stop(&sc->mfi_watchdog_callout); /* XXX callout_drain() */
+       callout_stop_sync(&sc->mfi_watchdog_callout);
 
        if (sc->mfi_cdev != NULL)
                destroy_dev(sc->mfi_cdev);
index 61c982a..6344ff0 100644 (file)
@@ -1324,12 +1324,7 @@ mps_free(struct mps_softc *sc)
        mps_lock(sc);
        sc->mps_flags |= MPS_FLAGS_SHUTDOWN;
        mps_unlock(sc);
-#if 0 /* XXX swildner */
-       /* Lock must not be held for this */
-       callout_drain(&sc->periodic);
-#else
-       callout_stop(&sc->periodic);
-#endif
+       callout_stop_sync(&sc->periodic);
 
        if (((error = mps_detach_log(sc)) != 0) ||
            ((error = mps_detach_sas(sc)) != 0))
index ac3ae08..1d403db 100644 (file)
@@ -885,13 +885,8 @@ twa_shutdown(device_t dev)
        error = twa_teardown_intr(sc);
 
        /* Stop watchdog task. */
-#if 0 /* XXX swildner */
-       callout_drain(&(sc->watchdog_callout[0]));
-       callout_drain(&(sc->watchdog_callout[1]));
-#else
-       callout_stop(&(sc->watchdog_callout[0]));
-       callout_stop(&(sc->watchdog_callout[1]));
-#endif
+       callout_stop_sync(&(sc->watchdog_callout[0]));
+       callout_stop_sync(&(sc->watchdog_callout[1]));
 
        /* Disconnect from the controller. */
        if ((error = tw_cl_shutdown_ctlr(&(sc->ctlr_handle), 0))) {
index c58942b..5d97c09 100644 (file)
@@ -213,7 +213,7 @@ sta_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
            __func__, ieee80211_state_name[ostate],
            ieee80211_state_name[nstate], arg);
        vap->iv_state = nstate;                 /* state transition */
-       callout_stop(&vap->iv_mgtsend);         /* XXX callout_drain */
+       callout_stop_sync(&vap->iv_mgtsend);
        if (ostate != IEEE80211_S_SCAN)
                ieee80211_cancel_scan(vap);     /* background scan */
        ni = vap->iv_bss;                       /* NB: no reference held */
index a5779a8..052185c 100644 (file)
@@ -347,7 +347,7 @@ wds_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
        IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s\n", __func__,
                ieee80211_state_name[ostate], ieee80211_state_name[nstate]);
        vap->iv_state = nstate;                 /* state transition */
-       callout_stop(&vap->iv_mgtsend);         /* XXX callout_drain */
+       callout_stop_sync(&vap->iv_mgtsend);
        if (ostate != IEEE80211_S_SCAN)
                ieee80211_cancel_scan(vap);     /* background scan */
        error = 0;