From 1f714e292338e6124bccf96741b870a2a8cd0d51 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 8 Sep 2010 15:26:54 -0700 Subject: [PATCH] wlan - Fix serializer in destroy path, update docs * 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 | 13 +++++++++++++ sys/netproto/802_11/wlan/ieee80211_dragonfly.c | 3 +++ 2 files changed, 16 insertions(+) diff --git a/sys/netproto/802_11/README.DRAGONFLY b/sys/netproto/802_11/README.DRAGONFLY index 28c02c8bb2..ba5034dc21 100644 --- a/sys/netproto/802_11/README.DRAGONFLY +++ b/sys/netproto/802_11/README.DRAGONFLY @@ -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! diff --git a/sys/netproto/802_11/wlan/ieee80211_dragonfly.c b/sys/netproto/802_11/wlan/ieee80211_dragonfly.c index 0a8495d60e..67fc38e06b 100644 --- a/sys/netproto/802_11/wlan/ieee80211_dragonfly.c +++ b/sys/netproto/802_11/wlan/ieee80211_dragonfly.c @@ -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(); } /* -- 2.41.0