public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Wang YanQing <udknight@gmail.com>,
	kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtlwifi:rtl_watchdog_wq_callback: fix calling rtl_lps_enter|rtl_lps_leave in opposite condition
Date: Mon, 2 May 2016 10:40:34 -0500	[thread overview]
Message-ID: <572774F2.2050304@lwfinger.net> (raw)
In-Reply-To: <20160502053754.GA30313@udknight>

On 05/02/2016 12:37 AM, Wang YanQing wrote:
> Commit a269913c52ad37952a4d9953bb6d748f7299c304
> ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
> make a mistake, change the meaning of num_tx|rx_inperiod comparison test.
>
> Commit fd09ff958777cf583d7541f180991c0fc50bd2f7
> ("rtlwifi: Remove extra workqueue for enter/leave power state")
> follow previous mistake, bring us to current code.
>
> This patch fix it.
>
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
>   I think this patch should be ported back to stable kernels, 3.10+.
>   In my machine, I will lost wifi connection after minutes if I enable
>   fwlps.
>
>   drivers/net/wireless/realtek/rtlwifi/base.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
> index c74eb13..264466f 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/base.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/base.c
> @@ -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;
>

NACK

This patch is correct. There is a logic error in entering/exiting power-save 
mode. Thus the code part is OK; however, the subject and commit message need to 
be improved. If I had prepared this patch, my subject would have been "rtlwifi: 
Fix logic error in enter/exit power-save mode". For the commit message, I would 
have used the following:

In commit fd09ff958777 ("rtlwifi: Remove extra workqueue for enter/leave power 
state"), the tests for enter/exit power-save mode were inverted. With this 
change applied, the wifi connection becomes much more stable.

Fixes: fd09ff958777 ("rtlwifi: Remove extra workqueue for enter/leave power state")
Signed-off-by: Wang YanQing <udknight@gmail.com>
CC: Stable <stable@vger.kernel.org> [3.10+]
---

Thanks for finding this problem.

Larry

      reply	other threads:[~2016-05-02 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02  5:37 [PATCH] rtlwifi:rtl_watchdog_wq_callback: fix calling rtl_lps_enter|rtl_lps_leave in opposite condition Wang YanQing
2016-05-02 15:40 ` Larry Finger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=572774F2.2050304@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=udknight@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox