Date: Fri, 30 Sep 2011 17:52:41 +0800 From: Adrian Chadd <adrian@freebsd.org> To: Joel Dahl <joel@vnode.se> Cc: current@freebsd.org Subject: Re: BETA2 panic Message-ID: <CAJ-Vmokpait2hLZnG5PEgWogKA6n_9SyavyZzDp0RWtj9KxGvg@mail.gmail.com> In-Reply-To: <09C13664-4FC0-41F3-8849-CE875B3A6CC0@vnode.se> References: <09C13664-4FC0-41F3-8849-CE875B3A6CC0@vnode.se>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi,
Would you please try this patch? Make sure that witness and the rest
of the lock debugging is enabled.
I've been working on this problem with someone else on the list (but I
can't trigger it myself; I think I need to get some dual-CPU wireless
test hardware.)
Thanks,
Adrian
[-- Attachment #2 --]
Index: net80211/ieee80211_sta.c
===================================================================
--- net80211/ieee80211_sta.c (revision 225772)
+++ net80211/ieee80211_sta.c (working copy)
@@ -109,6 +109,8 @@
{
struct ieee80211com *ic = vap->iv_ic;
+ IEEE80211_LOCK_ASSERT(ic);
+
KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning"));
KASSERT(vap->iv_state >= IEEE80211_S_RUN,
("wrong state %s", ieee80211_state_name[vap->iv_state]));
Index: net80211/ieee80211_tdma.c
===================================================================
--- net80211/ieee80211_tdma.c (revision 225772)
+++ net80211/ieee80211_tdma.c (working copy)
@@ -285,7 +285,10 @@
tdma_beacon_miss(struct ieee80211vap *vap)
{
struct ieee80211_tdma_state *ts = vap->iv_tdma;
+ struct ieee80211com *ic = vap->iv_ic;
+ IEEE80211_LOCK_ASSERT(ic);
+
KASSERT((vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning"));
KASSERT(vap->iv_state == IEEE80211_S_RUN,
("wrong state %d", vap->iv_state));
Index: net80211/ieee80211_proto.c
===================================================================
--- net80211/ieee80211_proto.c (revision 225772)
+++ net80211/ieee80211_proto.c (working copy)
@@ -193,7 +193,7 @@
vap->iv_rtsthreshold = IEEE80211_RTS_DEFAULT;
vap->iv_fragthreshold = IEEE80211_FRAG_DEFAULT;
vap->iv_bmiss_max = IEEE80211_BMISS_MAX;
- callout_init(&vap->iv_swbmiss, CALLOUT_MPSAFE);
+ callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0);
callout_init(&vap->iv_mgtsend, CALLOUT_MPSAFE);
TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap);
TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap);
@@ -1403,7 +1403,7 @@
struct ieee80211com *ic = arg;
struct ieee80211vap *vap;
- /* XXX locking */
+ IEEE80211_LOCK(ic);
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
/*
* We only pass events through for sta vap's in RUN state;
@@ -1415,18 +1415,21 @@
vap->iv_bmiss != NULL)
vap->iv_bmiss(vap);
}
+ IEEE80211_UNLOCK(ic);
}
static void
beacon_swmiss(void *arg, int npending)
{
struct ieee80211vap *vap = arg;
+ struct ieee80211com *ic = vap->iv_ic;
- if (vap->iv_state != IEEE80211_S_RUN)
- return;
-
- /* XXX Call multiple times if npending > zero? */
- vap->iv_bmiss(vap);
+ IEEE80211_LOCK(ic);
+ if (vap->iv_state == IEEE80211_S_RUN) {
+ /* XXX Call multiple times if npending > zero? */
+ vap->iv_bmiss(vap);
+ }
+ IEEE80211_UNLOCK(ic);
}
/*
@@ -1440,6 +1443,8 @@
struct ieee80211vap *vap = arg;
struct ieee80211com *ic = vap->iv_ic;
+ IEEE80211_LOCK_ASSERT(ic);
+
/* XXX sleep state? */
KASSERT(vap->iv_state == IEEE80211_S_RUN,
("wrong state %d", vap->iv_state));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmokpait2hLZnG5PEgWogKA6n_9SyavyZzDp0RWtj9KxGvg>
