From: Sujith Manoharan Date: Fri, 17 Oct 2014 02:10:17 +0000 (+0530) Subject: ath9k: Fix offchannel flush timeout X-Git-Tag: v3.19-rc1~118^2~234^2~56 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=290c8a77e8a9c719bbb11862138e76c9c1dfda61;p=karo-tx-linux.git ath9k: Fix offchannel flush timeout An offchannel operation also needs to have a flush timeout that doesn't exceed the NoA absence duration of a GO context, so use channel_switch_time. The first offchannel operation is set a flush timeout of 10ms since channel_switch_time will be zero. Signed-off-by: Sujith Manoharan Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index 7e518aad37ea..abc3e2e77ba6 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -207,6 +207,26 @@ void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx) if (!ctx) return; + if (ctx == &sc->offchannel.chan) { + spin_lock_bh(&sc->chan_lock); + + if (likely(sc->sched.channel_switch_time)) + ctx->flush_timeout = + usecs_to_jiffies(sc->sched.channel_switch_time); + else + ctx->flush_timeout = + msecs_to_jiffies(10); + + spin_unlock_bh(&sc->chan_lock); + + /* + * There is no need to iterate over the + * active/assigned channel contexts if + * the current context is offchannel. + */ + return; + } + ictx = ctx; list_for_each_entry(avp, &ctx->vifs, list) {