diff mbox series

[1/2] wifi: rtw88: use RTW_FLAG_RUNNING for deciding whether to enter/leave IPS

Message ID 20240527173454.459264-2-marcin.slusarz@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Ping-Ke Shih
Headers show
Series [1/2] wifi: rtw88: use RTW_FLAG_RUNNING for deciding whether to enter/leave IPS | expand

Commit Message

Marcin Ślusarz May 27, 2024, 5:34 p.m. UTC
From: Marcin Ślusarz <mslusarz@renau.com>

Needed by the next patch that disables power off operation for one chip.

Signed-off-by: Marcin Ślusarz <mslusarz@renau.com>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: linux-wireless@vger.kernel.org
---
 drivers/net/wireless/realtek/rtw88/ps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ping-Ke Shih May 28, 2024, 3:56 a.m. UTC | #1
Marcin Ślusarz <marcin.slusarz@gmail.com> wrote:
> From: Marcin Ślusarz <mslusarz@renau.com>
> 
> Needed by the next patch that disables power off operation for one chip.
> 
> Signed-off-by: Marcin Ślusarz <mslusarz@renau.com>
> Cc: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Kalle Valo <kvalo@kernel.org>
> Cc: linux-wireless@vger.kernel.org
> ---
>  drivers/net/wireless/realtek/rtw88/ps.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b/drivers/net/wireless/realtek/rtw88/ps.c
> index add5a20b8432..f9fbc9b3174b 100644
> --- a/drivers/net/wireless/realtek/rtw88/ps.c
> +++ b/drivers/net/wireless/realtek/rtw88/ps.c
> @@ -26,7 +26,7 @@ static int rtw_ips_pwr_up(struct rtw_dev *rtwdev)
> 
>  int rtw_enter_ips(struct rtw_dev *rtwdev)
>  {
> -       if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags))
> +       if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags))

RTW_FLAG_POWERON is to maintain power state (i.e. ips) of WiFi card, and
prevent entering/leaving IPS twice suddenly. Changing this is confused to me.
Marcin Ślusarz May 28, 2024, 10:53 a.m. UTC | #2
wt., 28 maj 2024 o 05:56 Ping-Ke Shih <pkshih@realtek.com> napisał(a):
>
> Marcin Ślusarz <marcin.slusarz@gmail.com> wrote:
> > From: Marcin Ślusarz <mslusarz@renau.com>
> >
> > Needed by the next patch that disables power off operation for one chip.
> >
> > Signed-off-by: Marcin Ślusarz <mslusarz@renau.com>
> > Cc: Ping-Ke Shih <pkshih@realtek.com>
> > Cc: Larry Finger <Larry.Finger@lwfinger.net>
> > Cc: Kalle Valo <kvalo@kernel.org>
> > Cc: linux-wireless@vger.kernel.org
> > ---
> >  drivers/net/wireless/realtek/rtw88/ps.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b/drivers/net/wireless/realtek/rtw88/ps.c
> > index add5a20b8432..f9fbc9b3174b 100644
> > --- a/drivers/net/wireless/realtek/rtw88/ps.c
> > +++ b/drivers/net/wireless/realtek/rtw88/ps.c
> > @@ -26,7 +26,7 @@ static int rtw_ips_pwr_up(struct rtw_dev *rtwdev)
> >
> >  int rtw_enter_ips(struct rtw_dev *rtwdev)
> >  {
> > -       if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags))
> > +       if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags))
>
> RTW_FLAG_POWERON is to maintain power state (i.e. ips) of WiFi card, and
> prevent entering/leaving IPS twice suddenly. Changing this is confused to me.

I explained it in the other thread as a reply to Bitterblue.
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b/drivers/net/wireless/realtek/rtw88/ps.c
index add5a20b8432..f9fbc9b3174b 100644
--- a/drivers/net/wireless/realtek/rtw88/ps.c
+++ b/drivers/net/wireless/realtek/rtw88/ps.c
@@ -26,7 +26,7 @@  static int rtw_ips_pwr_up(struct rtw_dev *rtwdev)
 
 int rtw_enter_ips(struct rtw_dev *rtwdev)
 {
-	if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags))
+	if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags))
 		return 0;
 
 	rtw_coex_ips_notify(rtwdev, COEX_IPS_ENTER);
@@ -50,7 +50,7 @@  int rtw_leave_ips(struct rtw_dev *rtwdev)
 {
 	int ret;
 
-	if (test_bit(RTW_FLAG_POWERON, rtwdev->flags))
+	if (test_bit(RTW_FLAG_RUNNING, rtwdev->flags))
 		return 0;
 
 	rtw_hci_link_ps(rtwdev, false);