Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 873ffe15 authored by wang yanqing's avatar wang yanqing Committed by Kalle Valo
Browse files

rtlwifi: Fix logic error in enter/exit power-save mode



In commit a269913c ("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: a269913c ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
Signed-off-by: default avatarWang YanQing <udknight@gmail.com>
CC: Stable <stable@vger.kernel.org> [3.10+]
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 1bfcfdcc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1660,9 +1660,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))
			rtl_lps_enter(hw);
		else
			rtl_lps_leave(hw);
		else
			rtl_lps_enter(hw);
	}

	rtlpriv->link_info.num_rx_inperiod = 0;