diff options
author | Bing Zhao <bzhao@marvell.com> | 2012-11-15 18:58:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-16 14:52:25 -0500 |
commit | b1a47aa5e1e159e2cb06d7dfcc17ef5149b09299 (patch) | |
tree | 6efdac23577820cc7ee54f73131419f37ee8c01c /drivers/net | |
parent | a485e827f07bfdd0762059386e6e787bed6e81ee (diff) |
mwifiex: fix system hang issue in cmd timeout error case
Reported by Tim Shepard:
I was seeing sporadic failures (wedgeups), and the majority of those
failures I saw printed the printouts in mwifiex_cmd_timeout_func with
cmd = 0xe5 which is CMD_802_11_HS_CFG_ENH. When this happens, two
minutes later I get notified that the rtcwake thread is blocked, like
this:
INFO: task rtcwake:3495 blocked for more than 120 seconds.
To get the hung thread unblocked we wake up the cmd wait queue and
cancel the ioctl.
Cc: "3.4+" <stable@vger.kernel.org>
Reported-by: Tim Shepard <shep@laptop.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mwifiex/cmdevt.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 8d465107f52b..ae9010ed58de 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -890,9 +890,6 @@ mwifiex_cmd_timeout_func(unsigned long function_context) | |||
890 | return; | 890 | return; |
891 | } | 891 | } |
892 | cmd_node = adapter->curr_cmd; | 892 | cmd_node = adapter->curr_cmd; |
893 | if (cmd_node->wait_q_enabled) | ||
894 | adapter->cmd_wait_q.status = -ETIMEDOUT; | ||
895 | |||
896 | if (cmd_node) { | 893 | if (cmd_node) { |
897 | adapter->dbg.timeout_cmd_id = | 894 | adapter->dbg.timeout_cmd_id = |
898 | adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; | 895 | adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index]; |
@@ -938,6 +935,14 @@ mwifiex_cmd_timeout_func(unsigned long function_context) | |||
938 | 935 | ||
939 | dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n", | 936 | dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n", |
940 | adapter->ps_mode, adapter->ps_state); | 937 | adapter->ps_mode, adapter->ps_state); |
938 | |||
939 | if (cmd_node->wait_q_enabled) { | ||
940 | adapter->cmd_wait_q.status = -ETIMEDOUT; | ||
941 | wake_up_interruptible(&adapter->cmd_wait_q.wait); | ||
942 | mwifiex_cancel_pending_ioctl(adapter); | ||
943 | /* reset cmd_sent flag to unblock new commands */ | ||
944 | adapter->cmd_sent = false; | ||
945 | } | ||
941 | } | 946 | } |
942 | if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) | 947 | if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) |
943 | mwifiex_init_fw_complete(adapter); | 948 | mwifiex_init_fw_complete(adapter); |