diff options
author | Dedy Lansky <qca_dlansky@qca.qualcomm.com> | 2014-09-10 09:34:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-11 15:27:38 -0400 |
commit | 595026472eb74e4b57f5389af8b7c588659df243 (patch) | |
tree | fde0a0e9ea7bc0f753a6e3926348ffd525f95a6c | |
parent | e0106adade2dd16fb776f53f25ffe50da0793f3d (diff) |
wil6210: introduce separate completion for WMI
re-use of wmi_ready for both FW ready event and for wmi_call was causing
false "FW not ready" indication in case wmi_call() was invoked while reset
took place.
add wmi_call completion variable instead of re-using wmi_ready.
Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 8 |
3 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index d2f2c1e98e9e..0857853f675c 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -286,6 +286,7 @@ int wil_priv_init(struct wil6210_priv *wil) | |||
286 | mutex_init(&wil->wmi_mutex); | 286 | mutex_init(&wil->wmi_mutex); |
287 | 287 | ||
288 | init_completion(&wil->wmi_ready); | 288 | init_completion(&wil->wmi_ready); |
289 | init_completion(&wil->wmi_call); | ||
289 | 290 | ||
290 | wil->pending_connect_cid = -1; | 291 | wil->pending_connect_cid = -1; |
291 | setup_timer(&wil->connect_timer, wil_connect_timer_fn, (ulong)wil); | 292 | setup_timer(&wil->connect_timer, wil_connect_timer_fn, (ulong)wil); |
@@ -536,6 +537,7 @@ int wil_reset(struct wil6210_priv *wil) | |||
536 | /* init after reset */ | 537 | /* init after reset */ |
537 | wil->pending_connect_cid = -1; | 538 | wil->pending_connect_cid = -1; |
538 | reinit_completion(&wil->wmi_ready); | 539 | reinit_completion(&wil->wmi_ready); |
540 | reinit_completion(&wil->wmi_call); | ||
539 | 541 | ||
540 | wil6210_enable_irq(wil); | 542 | wil6210_enable_irq(wil); |
541 | 543 | ||
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 1b119343c6cf..f8f99881382d 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -399,6 +399,7 @@ struct wil6210_priv { | |||
399 | struct mutex wmi_mutex; | 399 | struct mutex wmi_mutex; |
400 | struct wil6210_mbox_ctl mbox_ctl; | 400 | struct wil6210_mbox_ctl mbox_ctl; |
401 | struct completion wmi_ready; | 401 | struct completion wmi_ready; |
402 | struct completion wmi_call; | ||
402 | u16 wmi_seq; | 403 | u16 wmi_seq; |
403 | u16 reply_id; /**< wait for this WMI event */ | 404 | u16 reply_id; /**< wait for this WMI event */ |
404 | void *reply_buf; | 405 | void *reply_buf; |
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 789c316d0ce6..bd781c7adf2a 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c | |||
@@ -300,7 +300,7 @@ static void wmi_evt_fw_ready(struct wil6210_priv *wil, int id, void *d, | |||
300 | wil_dbg_wmi(wil, "WMI: got FW ready event\n"); | 300 | wil_dbg_wmi(wil, "WMI: got FW ready event\n"); |
301 | 301 | ||
302 | set_bit(wil_status_fwready, &wil->status); | 302 | set_bit(wil_status_fwready, &wil->status); |
303 | /* reuse wmi_ready for the firmware ready indication */ | 303 | /* let the reset sequence continue */ |
304 | complete(&wil->wmi_ready); | 304 | complete(&wil->wmi_ready); |
305 | } | 305 | } |
306 | 306 | ||
@@ -764,8 +764,8 @@ int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len, | |||
764 | wil->reply_id = reply_id; | 764 | wil->reply_id = reply_id; |
765 | wil->reply_buf = reply; | 765 | wil->reply_buf = reply; |
766 | wil->reply_size = reply_size; | 766 | wil->reply_size = reply_size; |
767 | remain = wait_for_completion_timeout(&wil->wmi_ready, | 767 | remain = wait_for_completion_timeout(&wil->wmi_call, |
768 | msecs_to_jiffies(to_msec)); | 768 | msecs_to_jiffies(to_msec)); |
769 | if (0 == remain) { | 769 | if (0 == remain) { |
770 | wil_err(wil, "wmi_call(0x%04x->0x%04x) timeout %d msec\n", | 770 | wil_err(wil, "wmi_call(0x%04x->0x%04x) timeout %d msec\n", |
771 | cmdid, reply_id, to_msec); | 771 | cmdid, reply_id, to_msec); |
@@ -1160,7 +1160,7 @@ static void wmi_event_handle(struct wil6210_priv *wil, | |||
1160 | len - sizeof(*wmi)); | 1160 | len - sizeof(*wmi)); |
1161 | } | 1161 | } |
1162 | wil_dbg_wmi(wil, "Complete WMI 0x%04x\n", id); | 1162 | wil_dbg_wmi(wil, "Complete WMI 0x%04x\n", id); |
1163 | complete(&wil->wmi_ready); | 1163 | complete(&wil->wmi_call); |
1164 | return; | 1164 | return; |
1165 | } | 1165 | } |
1166 | /* unsolicited event */ | 1166 | /* unsolicited event */ |