[3.19.y-ckt stable] Patch "rtlwifi: Fix logic error in enter/exit power-save mode" has been added to the 3.19.y-ckt tree

Kamal Mostafa kamal at canonical.com
Wed Jul 6 21:00:48 UTC 2016

This is a note to let you know that I have just added a patch titled

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

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:


This patch is scheduled to be released in version 3.19.8-ckt23.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.19.y-ckt tree, see



>From 13d95785f6083d4f015f9312bcc969f417ac6340 Mon Sep 17 00:00:00 2001
From: wang yanqing <udknight at gmail.com>
Date: Tue, 3 May 2016 00:38:36 +0800
Subject: rtlwifi: Fix logic error in enter/exit power-save mode

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 at gmail.com>
Acked-by: Larry Finger <Larry.Finger at lwfinger.net>
Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
[ kamal: backport to 4.2-stable: files moved ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/net/wireless/rtlwifi/base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index af24869..339f94e 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -1587,9 +1587,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
+		else
+			rtl_lps_enter(hw);

 	rtlpriv->link_info.num_rx_inperiod = 0;

More information about the kernel-team mailing list