All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pkshih <pkshih@realtek.com>
To: Jian-Hong Pan <jhp@endlessos.org>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Yan-Hsuan Chuang <tony0620emma@gmail.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	"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: 8821c: disable the ASPM of RTL8821CE
Date: Mon, 13 Dec 2021 08:59:55 +0000	[thread overview]
Message-ID: <e78b81f3a73c45b59f4c4d9f5b414508@realtek.com> (raw)
In-Reply-To: <CAPpJ_ecqf+LqkN-Wb+zNGHbtJ3rKD8_kU3W0c2gTQGQqK1sUwg@mail.gmail.com>


> -----Original Message-----
> From: Jian-Hong Pan <jhp@endlessos.org>
> Sent: Monday, December 13, 2021 3:31 PM
> To: Pkshih <pkshih@realtek.com>
> Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>; Yan-Hsuan Chuang <tony0620emma@gmail.com>; Kalle Valo
> <kvalo@codeaurora.org>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux@endlessos.org
> Subject: Re: [PATCH] rtw88: 8821c: disable the ASPM of RTL8821CE
> 
> Pkshih <pkshih@realtek.com> 於 2021年12月11日 週六 下午2:31寫道:
> >
> >
> > > -----Original Message-----
> > > From: Jian-Hong Pan <jhp@endlessos.org>
> > > Sent: Friday, December 10, 2021 5:34 PM
> > > To: Kai-Heng Feng <kai.heng.feng@canonical.com>
> > > Cc: Pkshih <pkshih@realtek.com>; Yan-Hsuan Chuang <tony0620emma@gmail.com>; Kalle Valo
> > > <kvalo@codeaurora.org>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org;
> > > linux-kernel@vger.kernel.org; linux@endlessos.org
> > > Subject: Re: [PATCH] rtw88: 8821c: disable the ASPM of RTL8821CE
> > >
> > > Kai-Heng Feng <kai.heng.feng@canonical.com> 於 2021年12月10日 週五 下午5:24寫道:
> > >
> > > > Right now it seems like only Intel platforms are affected, so can I
> > > > propose a patch to disable ASPM when its upstream port is Intel?
> > >
> > > I only have laptops with Intel chip now.  So, I am not sure the status
> > > with AMD platforms.
> > > If this is true, then "disable ASPM when its upstream port is Intel"
> > > might be a good idea.
> > >
> >
> > Jian-Hong, could you try Kai-Heng's workaround that only turn off ASPM
> > during NAPI poll function. If it also works to you, I think it is okay
> > to apply this workaround to all Intel platform with RTL8821CE chipset.
> > Because this workaround has little (almost no) impact of power consumption.
> 
> According to Kai-Heng's hack patch [1] and the comment [2] mentioning
> checking "ref_cnt" by rtw_pci_link_ps(), I arrange the patch as
> following.

I meant that move "ref_cnt" into rtw_pci_link_ps() by [2], but you remove
the "ref_cnt". This leads lower performance, because it must turn off
ASPM after napi_poll() when we have high traffic.

In fact, Kai-Heng's patch is to leave ASPM before napi_poll(), and
"restore" ASPM setting. So, we still need "ref_cnt".


> This patch only disables ASPM (if the hardware has the capability)
> when system gets into rtw_pci_napi_poll() and re-enables ASPM when it
> leaves rtw_pci_napi_poll().  It is as Ping-Ke mentioned "only turn off
> ASPM during NAPI poll function".
> The WiFi & BT work, and system is still alive after I use the internet
> awhile.  Besides, there is no more "pci bus timeout, check dma status"
> error.
> 
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=215131#c11
> [2] https://bugzilla.kernel.org/show_bug.cgi?id=215131#c15
> 
> Jian-Hong Pan
> 
> 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;
>  }
> 

How about doing this thing only if 8821CE and Intel platform?
Could you help to add this?

--
Ping-ke



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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  8:17 [PATCH] rtw88: 8821c: disable the ASPM of RTL8821CE Jian-Hong Pan
2021-12-10  9:00 ` Pkshih
2021-12-10  9:23   ` Kai-Heng Feng
2021-12-10  9:33     ` Jian-Hong Pan
2021-12-11  6:31       ` Pkshih
2021-12-13  7:30         ` Jian-Hong Pan
2021-12-13  8:59           ` Pkshih [this message]
2021-12-13  9:43             ` Kai-Heng Feng

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=e78b81f3a73c45b59f4c4d9f5b414508@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.