On Mon, Nov 19, 2012 at 11:29 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > From: Johannes Berg <johannes.berg@xxxxxxxxx> > > Sujith reported warnings with suspend/resume due to > channel contexts. When I looked into it, I realised > that the code was completely broken as it unassigned > the channel contexts when suspending, which actually > means they are destroyed. > > Fix this by calling just the driver method (if it is > implemented) instead of trying to use the mac80211 > channel context management code. > > Reported-by: Sujith Manoharan <sujith@xxxxxxxxxxx> > Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> > --- > net/mac80211/pm.c | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c > index 0f1c434..792d5ce 100644 > --- a/net/mac80211/pm.c > +++ b/net/mac80211/pm.c > @@ -139,8 +139,23 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) > rcu_access_pointer(sdata->u.ap.beacon)) > drv_stop_ap(local, sdata); > > - /* the interface is leaving the channel and is removed */ > - ieee80211_vif_release_channel(sdata); > + if (local->use_chanctx) { > + struct ieee80211_chanctx_conf *conf; > + struct ieee80211_chanctx *ctx; > + > + mutex_lock(&local->chanctx_mtx); > + conf = rcu_dereference_protected( > + sdata->vif.chanctx_conf, > + lockdep_is_held(&local->chanctx_mtx)); > + if (conf) { > + ctx = container_of(conf, > + struct ieee80211_chanctx, > + conf); > + drv_unassign_vif_chanctx(local, sdata, ctx); > + } > + > + mutex_unlock(&local->chanctx_mtx); > + } what about releasing the chanctx (drv_remove_chanctx)? Eliad. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html