netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pkshih <pkshih@realtek.com>
To: Jian-Hong Pan <jhp@endlessos.org>,
	Bernie Huang <phhuang@realtek.com>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Yan-Hsuan Chuang <tony0620emma@gmail.com>,
	Kalle Valo <kvalo@codeaurora.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux@endlessos.org" <linux@endlessos.org>
Subject: RE: [PATCH] rtw88: pci: turn off PCI ASPM during NAPI polling
Date: Mon, 13 Dec 2021 09:04:22 +0000	[thread overview]
Message-ID: <963fc5bc39314dc49faa719b03a79ad4@realtek.com> (raw)
In-Reply-To: <20211213080908.80723-1-jhp@endlessos.org>


> -----Original Message-----
> From: Jian-Hong Pan <jhp@endlessos.org>
> Sent: Monday, December 13, 2021 4:09 PM
> To: Pkshih <pkshih@realtek.com>; Bernie Huang <phhuang@realtek.com>; Kai-Heng Feng
> <kai.heng.feng@canonical.com>; Yan-Hsuan Chuang <tony0620emma@gmail.com>; Kalle Valo
> <kvalo@codeaurora.org>
> Cc: linux-wireless@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux@endlessos.org; Jian-Hong Pan <jhp@endlessos.org>
> Subject: [PATCH] rtw88: pci: turn off PCI ASPM during NAPI polling
> 
> The system on the machines equipped with RTL8821CE freezes randomly
> until the PCI ASPM is disabled during NAPI poll function.
> 
> Link: https://www.spinics.net/lists/linux-wireless/msg218387.html
> Fixes: 9e2fd29864c5 ("rtw88: add napi support")
> Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
> ---
>  drivers/net/wireless/realtek/rtw88/pci.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
> index a7a6ebfaa203..a6fdddecd37d 100644
> --- a/drivers/net/wireless/realtek/rtw88/pci.c
> +++ b/drivers/net/wireless/realtek/rtw88/pci.c
> @@ -1658,6 +1658,7 @@ static int rtw_pci_napi_poll(struct napi_struct *napi, int budget)
>  					      priv);
>  	int work_done = 0;
> 
> +	rtw_pci_link_ps(rtwdev, false);
>  	while (work_done < budget) {
>  		u32 work_done_once;
> 
> @@ -1681,6 +1682,7 @@ static int rtw_pci_napi_poll(struct napi_struct *napi, int budget)
>  		if (rtw_pci_get_hw_rx_ring_nr(rtwdev, rtwpci))
>  			napi_schedule(napi);
>  	}
> +	rtw_pci_link_ps(rtwdev, true);
> 
>  	return work_done;
>  }

I think we need to add ref_cnt and only do this thing on specific chip and platform [1].

[1] https://lore.kernel.org/linux-wireless/e78b81f3a73c45b59f4c4d9f5b414508@realtek.com/T/#m95b22af523ea801fdb84225b87a84ca4f04bb33d

--
Ping-Ke


      reply	other threads:[~2021-12-13  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13  8:09 [PATCH] rtw88: pci: turn off PCI ASPM during NAPI polling Jian-Hong Pan
2021-12-13  9:04 ` Pkshih [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=963fc5bc39314dc49faa719b03a79ad4@realtek.com \
    --to=pkshih@realtek.com \
    --cc=jhp@endlessos.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@endlessos.org \
    --cc=netdev@vger.kernel.org \
    --cc=phhuang@realtek.com \
    --cc=tony0620emma@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;
as well as URLs for NNTP newsgroup(s).