diff options
author | Ahmad Masri <amasri@codeaurora.org> | 2019-06-16 03:26:07 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-06-27 13:51:04 -0400 |
commit | 1a276003111c0404f6bfeffe924c5a21f482428b (patch) | |
tree | acccf744f18d1396dc547cd9ca5143f1bc1c72d4 /drivers/net/wireless | |
parent | 2a32c20b76af39185a5bf8fa617b94295660893f (diff) |
wil6210: drop old event after wmi_call timeout
This change fixes a rare race condition of handling WMI events after
wmi_call expires.
wmi_recv_cmd immediately handles an event when reply_buf is defined and
a wmi_call is waiting for the event.
However, in case the wmi_call has already timed-out, there will be no
waiting/running wmi_call and the event will be queued in WMI queue and
will be handled later in wmi_event_handle.
Meanwhile, a new similar wmi_call for the same command and event may
be issued. In this case, when handling the queued event we got WARN_ON
printed.
Fixing this case as a valid timeout and drop the unexpected event.
Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 542ef15f2e66..475b1a233cc9 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c | |||
@@ -3303,7 +3303,18 @@ static void wmi_event_handle(struct wil6210_priv *wil, | |||
3303 | /* check if someone waits for this event */ | 3303 | /* check if someone waits for this event */ |
3304 | if (wil->reply_id && wil->reply_id == id && | 3304 | if (wil->reply_id && wil->reply_id == id && |
3305 | wil->reply_mid == mid) { | 3305 | wil->reply_mid == mid) { |
3306 | WARN_ON(wil->reply_buf); | 3306 | if (wil->reply_buf) { |
3307 | /* event received while wmi_call is waiting | ||
3308 | * with a buffer. Such event should be handled | ||
3309 | * in wmi_recv_cmd function. Handling the event | ||
3310 | * here means a previous wmi_call was timeout. | ||
3311 | * Drop the event and do not handle it. | ||
3312 | */ | ||
3313 | wil_err(wil, | ||
3314 | "Old event (%d, %s) while wmi_call is waiting. Drop it and Continue waiting\n", | ||
3315 | id, eventid2name(id)); | ||
3316 | return; | ||
3317 | } | ||
3307 | 3318 | ||
3308 | wmi_evt_call_handler(vif, id, evt_data, | 3319 | wmi_evt_call_handler(vif, id, evt_data, |
3309 | len - sizeof(*wmi)); | 3320 | len - sizeof(*wmi)); |