aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-06-20 22:58:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-22 14:44:04 -0400
commitf931c7705bb3e21edd345a0fa748462fd3df4122 (patch)
tree1be2e22cade991e6661d82e43d5f838d302b7b93 /drivers/net/wireless
parent0fd66be4a369e4a93bfd559c931e689539cc8e5f (diff)
mwifiex: wake up main thread to handle Tx traffic if scan is delayed/aborted
This is a flaw in recently implemented logic to handle Tx traffic and scan operation simultaneously. We missed to wakeup main thread to handle Tx traffic if scan is delayed/aborted. For some cards (SD8797, for example), firmware will send SLEEP event if there is no activity for 50msec. While handling the SLEEP event, main thread will be woken up and Tx packet gets sent hence. In worst case Tx traffic will be delayed for 50msec. For other cards, such as USB8797, firmware won't send SLEEP event. So, Tx traffic gets stuck if no other event triggers the wakeup of main thread. This patch fixes above issues. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mwifiex/init.c1
-rw-r--r--drivers/net/wireless/mwifiex/main.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 0f18ef6a30c8..b543a4d82ff3 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -103,6 +103,7 @@ static void scan_delay_timer_fn(unsigned long data)
103 msecs_to_jiffies(MWIFIEX_SCAN_DELAY_MSEC)); 103 msecs_to_jiffies(MWIFIEX_SCAN_DELAY_MSEC));
104 adapter->scan_delay_cnt++; 104 adapter->scan_delay_cnt++;
105 } 105 }
106 queue_work(priv->adapter->workqueue, &priv->adapter->main_work);
106 } else { 107 } else {
107 /* 108 /*
108 * Tx data queue is empty. Get scan command from scan_pending_q 109 * Tx data queue is empty. Get scan command from scan_pending_q
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 0f06f07a70e6..f0219efc8953 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -190,7 +190,8 @@ process_start:
190 adapter->tx_lock_flag) 190 adapter->tx_lock_flag)
191 break; 191 break;
192 192
193 if (adapter->scan_processing || adapter->data_sent || 193 if ((adapter->scan_processing &&
194 !adapter->scan_delay_cnt) || adapter->data_sent ||
194 mwifiex_wmm_lists_empty(adapter)) { 195 mwifiex_wmm_lists_empty(adapter)) {
195 if (adapter->cmd_sent || adapter->curr_cmd || 196 if (adapter->cmd_sent || adapter->curr_cmd ||
196 (!is_command_pending(adapter))) 197 (!is_command_pending(adapter)))