rtlwifi: Fix logic error in enter/exit power-save mode
authorwang yanqing <udknight@gmail.com>
Mon, 2 May 2016 16:38:36 +0000 (00:38 +0800)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Aug 2016 21:22:44 +0000 (23:22 +0200)
commit 873ffe154ae074c46ed2d72dbd9a2a99f06f55b4 upstream.

In commit a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and
rtl_lps_enter() to use work queue"), the tests for enter/exit
power-save mode were inverted. With this change applied, the
wifi connection becomes much more stable.

Fixes: a269913c52ad ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
Signed-off-by: Wang YanQing <udknight@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/net/wireless/rtlwifi/base.c

index 6fc0853fd7f9d4d04748c0947f24f3fb527bcf25..d066f74f743a915ddf3c94fa4dda971e09e12d50 100644 (file)
@@ -1392,9 +1392,9 @@ void rtl_watchdog_wq_callback(void *data)
                if (((rtlpriv->link_info.num_rx_inperiod +
                      rtlpriv->link_info.num_tx_inperiod) > 8) ||
                    (rtlpriv->link_info.num_rx_inperiod > 2))
-                       rtlpriv->enter_ps = true;
-               else
                        rtlpriv->enter_ps = false;
+               else
+                       rtlpriv->enter_ps = true;
 
                /* LeisurePS only work in infra mode. */
                schedule_work(&rtlpriv->works.lps_change_work);