From efaaa8b8414e0ab4ba09aaaf79ab92a34b75797b Mon Sep 17 00:00:00 2001 From: Amitkumar Karwar Date: Wed, 12 Oct 2011 20:28:06 -0700 Subject: mwifiex: use separate wait condition for each command node Currently global wait condition (adapter->cmd_wait_q.condition) is used while sending synchronous commands to FW. When two threads enter in mwifiex_send_cmd_sync() routine at the same time, both the threads wait for their command responses. Since wait condition is same for both, they wake up simultaneously after getting response of 1st command. After this when a thread is waiting for command response of 3rd command, it wakes up after getting response of 2nd command and so on. Therefore we don't wait for the response of last command(0xaa) during unload. Hence while next time loading the driver command time out is seen for INIT command. This problem is resolved by having separate wait condition flag for each command(except scan command). Since scan command is treated differently (by maintaining scan pending q etc.), newly defined flag (scan_wait_q_woken) is used as a scan wait condition. Signed-off-by: Amitkumar Karwar Signed-off-by: Yogesh Ashok Powar Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- drivers/net/wireless/mwifiex/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/mwifiex/main.c') diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 849144d..25ce86b 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -685,8 +685,8 @@ mwifiex_add_card(void *card, struct semaphore *sem, init_waitqueue_head(&adapter->hs_activate_wait_q); adapter->cmd_wait_q_required = false; init_waitqueue_head(&adapter->cmd_wait_q.wait); - adapter->cmd_wait_q.condition = false; adapter->cmd_wait_q.status = 0; + adapter->scan_wait_q_woken = false; adapter->workqueue = create_workqueue("MWIFIEX_WORK_QUEUE"); if (!adapter->workqueue) -- cgit v1.1