wlan - Fix serializer in destroy path, update docs
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 8 Sep 2010 22:26:54 +0000 (15:26 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 8 Sep 2010 22:26:54 +0000 (15:26 -0700)
* Update the README.DRAGONFLY to include tidbits no tsleeps and
  firmware loading.

* Fix an issue when a low level driver attempts to destroy a wlan
  interface.

sys/netproto/802_11/README.DRAGONFLY
sys/netproto/802_11/wlan/ieee80211_dragonfly.c

index 28c02c8..ba5034d 100644 (file)
@@ -71,6 +71,19 @@ ieee80211_ioctl()
                The kernel will acquire if_serializer when making
                ifp->if_ioctl() calls.
 
+tsleep         Low level drivers sometimes call tsleep() to wait for
+               an interrupt driven event to wake them up.  In these
+               cases the interrupt will be blocked on the wlan
+               serializer and the tsleep will timeout.  To fix the
+               problem use zsleep() to release the &wlan_global_serializer
+               across the sleep operation.
+
+firmware       The firmware loader uses a taskq to defer certain
+               operations which can then deadlock against the wlan
+               serializer.  Thus it is usually a good idea to
+               release the serializer (wlan_serialize_exit/enter)
+               around the call to firmware_get().
+
 Low level device drivers
                Don't forget that low level device drivers such as ath
                have callouts, taskq, sysctl, and other elements also!
index 0a8495d..67fc38e 100644 (file)
@@ -230,7 +230,10 @@ wlan_cv_signal(struct cv *cv, int broadcast)
 void
 ieee80211_vap_destroy(struct ieee80211vap *vap)
 {
+       wlan_assert_serialized();
+       wlan_serialize_exit();
        if_clone_destroy(vap->iv_ifp->if_xname);
+       wlan_serialize_enter();
 }
 
 /*