312-ath9k-Fix-offchannel-flush-timeout.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From: Sujith Manoharan <[email protected]>
  2. Date: Fri, 17 Oct 2014 07:40:17 +0530
  3. Subject: [PATCH] ath9k: Fix offchannel flush timeout
  4. An offchannel operation also needs to have
  5. a flush timeout that doesn't exceed the NoA
  6. absence duration of a GO context, so use
  7. channel_switch_time. The first offchannel
  8. operation is set a flush timeout of 10ms since
  9. channel_switch_time will be zero.
  10. Signed-off-by: Sujith Manoharan <[email protected]>
  11. ---
  12. --- a/drivers/net/wireless/ath/ath9k/channel.c
  13. +++ b/drivers/net/wireless/ath/ath9k/channel.c
  14. @@ -207,6 +207,26 @@ void ath_chanctx_check_active(struct ath
  15. if (!ctx)
  16. return;
  17. + if (ctx == &sc->offchannel.chan) {
  18. + spin_lock_bh(&sc->chan_lock);
  19. +
  20. + if (likely(sc->sched.channel_switch_time))
  21. + ctx->flush_timeout =
  22. + usecs_to_jiffies(sc->sched.channel_switch_time);
  23. + else
  24. + ctx->flush_timeout =
  25. + msecs_to_jiffies(10);
  26. +
  27. + spin_unlock_bh(&sc->chan_lock);
  28. +
  29. + /*
  30. + * There is no need to iterate over the
  31. + * active/assigned channel contexts if
  32. + * the current context is offchannel.
  33. + */
  34. + return;
  35. + }
  36. +
  37. ictx = ctx;
  38. list_for_each_entry(avp, &ctx->vifs, list) {