mwifiex: use timeout variant for wait_event_interruptible
authorAmitkumar Karwar <akarwar@marvell.com>
Thu, 20 Mar 2014 23:23:50 +0000 (16:23 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 31 Mar 2014 17:47:40 +0000 (13:47 -0400)
It has been observed that system hangs during suspend, if host
sleep activation fails due to a missing interrupt from firmware.
Use timeout variant, so that the thread will be woken up when
timer expires.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/sta_ioctl.c

index 888f3ae9df83866bc337ca41e21732bc888702fc..894270611f2cb6e074669f424fe66978e80e1992 100644 (file)
@@ -520,8 +520,9 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
                return false;
        }
 
-       if (wait_event_interruptible(adapter->hs_activate_wait_q,
-                                    adapter->hs_activate_wait_q_woken)) {
+       if (wait_event_interruptible_timeout(adapter->hs_activate_wait_q,
+                                            adapter->hs_activate_wait_q_woken,
+                                            (10 * HZ)) <= 0) {
                dev_err(adapter->dev, "hs_activate_wait_q terminated\n");
                return false;
        }