diff mbox

ath10k: move hw_scan worker queuing

Message ID 1441269825-344-1-git-send-email-michal.kazior@tieto.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Michal Kazior Sept. 3, 2015, 8:43 a.m. UTC
The remain_on_channel callback needs different
timeout. Calling ieee80211_queue_work() with a
shorter delay after calling it with a longer delay
will not change the timer. This caused the
offchannel timeout worker to not trigger in time
and caused the device to stay on channel longer
then expected. This could cause some problems and
was be easily reproduced with `iw offchannel`
command.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Kalle Valo Sept. 17, 2015, 11:01 a.m. UTC | #1
Michal Kazior <michal.kazior@tieto.com> writes:

> The remain_on_channel callback needs different
> timeout. Calling ieee80211_queue_work() with a
> shorter delay after calling it with a longer delay
> will not change the timer. This caused the
> offchannel timeout worker to not trigger in time
> and caused the device to stay on channel longer
> then expected. This could cause some problems and
> was be easily reproduced with `iw offchannel`
> command.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 64674c955d44..708fc2d2de2f 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3617,9 +3617,6 @@  static int ath10k_start_scan(struct ath10k *ar,
 	}
 	spin_unlock_bh(&ar->data_lock);
 
-	/* Add a 200ms margin to account for event/command processing */
-	ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
-				     msecs_to_jiffies(arg->max_scan_time+200));
 	return 0;
 }
 
@@ -4751,6 +4748,11 @@  static int ath10k_hw_scan(struct ieee80211_hw *hw,
 		spin_unlock_bh(&ar->data_lock);
 	}
 
+	/* Add a 200ms margin to account for event/command processing */
+	ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
+				     msecs_to_jiffies(arg.max_scan_time +
+						      200));
+
 exit:
 	mutex_unlock(&ar->conf_mutex);
 	return ret;