diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-04-14 18:31:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-04-15 13:27:05 -0400 |
commit | f8d2b9209ad648a8e9aa973d32fb64aa2ab01d00 (patch) | |
tree | fc5ff83e3297e5a6710ee2301d964f327aa61a80 /drivers/net/wireless/mwifiex/sta_ioctl.c | |
parent | 20474129d8bb0e6f113634f4f0f4f1584d0beed2 (diff) |
mwifiex: fix hung task on command timeout
Sometimes when command timeout occurs due to a firmware or
hardware bug, there may be some synchronous commands in command
queue. These commands are never downloaded to firmware causing
hung task warnings. This patch replaces wait_event_interruptible
call with wait_event_interruptible_timeout to fix the issue.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@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/mwifiex/sta_ioctl.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 894270611f2c..536c14aa71f3 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -60,9 +60,10 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter, | |||
60 | int status; | 60 | int status; |
61 | 61 | ||
62 | /* Wait for completion */ | 62 | /* Wait for completion */ |
63 | status = wait_event_interruptible(adapter->cmd_wait_q.wait, | 63 | status = wait_event_interruptible_timeout(adapter->cmd_wait_q.wait, |
64 | *(cmd_queued->condition)); | 64 | *(cmd_queued->condition), |
65 | if (status) { | 65 | (12 * HZ)); |
66 | if (status <= 0) { | ||
66 | dev_err(adapter->dev, "cmd_wait_q terminated: %d\n", status); | 67 | dev_err(adapter->dev, "cmd_wait_q terminated: %d\n", status); |
67 | mwifiex_cancel_all_pending_cmd(adapter); | 68 | mwifiex_cancel_all_pending_cmd(adapter); |
68 | return status; | 69 | return status; |