--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -2149,56 +2149,40 @@ static void ath9k_set_coverage_class(str
+@@ -2149,56 +2149,42 @@ static void ath9k_set_coverage_class(str
static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
{
- }
+ if (drop)
+ timeout = 1;
++
++ for (j = 0; j < timeout; j++) {
++ int npend = 0;
++
++ if (j)
++ usleep_range(1000, 2000);
- if (drop || ath9k_has_pending_frames(sc, txq)) {
- ath_dbg(common, ATH_DBG_QUEUE, "Drop frames from hw queue:%d\n",
- ath9k_ps_restore(sc);
- if (npend)
- break;
-+ for (j = 0; j < timeout; j++) {
-+ int npend = 0;
+ for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
+ if (!ATH_TXQ_SETUP(sc, i))
+ continue;
+
+ if (!npend)
+ goto out;
-+
-+ usleep_range(1000, 2000);
}
- if (npend) {