linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtw88: pci: Power cycle device during shutdown
@ 2020-08-24  9:32 Kai-Heng Feng
  2020-08-26  0:27 ` Brian Norris
  2020-09-28 16:55 ` [PATCH v2] " Kai-Heng Feng
  0 siblings, 2 replies; 5+ messages in thread
From: Kai-Heng Feng @ 2020-08-24  9:32 UTC (permalink / raw)
  To: yhchuang, kvalo
  Cc: Kai-Heng Feng, David S. Miller, Jakub Kicinski,
	open list:REALTEK WIRELESS DRIVER (rtw88),
	open list:NETWORKING DRIVERS, open list

Sometimes system freeze on cold/warm boot when rtw88 is probing.

According to [1], platform firmware may not properly power manage the
device during shutdown. I did some expirements and putting the device to
D3 can workaround the issue.

So let's power cycle the device by putting the device to D3 at shutdown
to prevent the issue from happening.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=206411#c9

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 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 3413973bc475..7f1f5073b9f4 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1599,6 +1599,8 @@ void rtw_pci_shutdown(struct pci_dev *pdev)
 
 	if (chip->ops->shutdown)
 		chip->ops->shutdown(rtwdev);
+
+	pci_set_power_state(pdev, PCI_D3hot);
 }
 EXPORT_SYMBOL(rtw_pci_shutdown);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] rtw88: pci: Power cycle device during shutdown
  2020-08-24  9:32 [PATCH] rtw88: pci: Power cycle device during shutdown Kai-Heng Feng
@ 2020-08-26  0:27 ` Brian Norris
  2020-09-09 14:00   ` Kai-Heng Feng
  2020-09-28 16:55 ` [PATCH v2] " Kai-Heng Feng
  1 sibling, 1 reply; 5+ messages in thread
From: Brian Norris @ 2020-08-26  0:27 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: Tony Chuang, Kalle Valo, David S. Miller, Jakub Kicinski,
	open list:REALTEK WIRELESS DRIVER (rtw88),
	open list:NETWORKING DRIVERS, open list

On Mon, Aug 24, 2020 at 2:32 AM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> Sometimes system freeze on cold/warm boot when rtw88 is probing.
>
> According to [1], platform firmware may not properly power manage the
> device during shutdown. I did some expirements and putting the device to
> D3 can workaround the issue.
>
> So let's power cycle the device by putting the device to D3 at shutdown
> to prevent the issue from happening.
>
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=206411#c9
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Can you at least include some more details, like which hardware
version and firmware? And which platform? It seems a bit harsh to
include a platform workaround to run for everyone, unless there's
truly no downside. But even then, it's good to log what you're working
with, in case there are ever problems with this in the future.

Brian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] rtw88: pci: Power cycle device during shutdown
  2020-08-26  0:27 ` Brian Norris
@ 2020-09-09 14:00   ` Kai-Heng Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Kai-Heng Feng @ 2020-09-09 14:00 UTC (permalink / raw)
  To: Brian Norris
  Cc: Tony Chuang, Kalle Valo, David S. Miller, Jakub Kicinski,
	open list:REALTEK WIRELESS DRIVER (rtw88),
	open list:NETWORKING DRIVERS, open list



> On Aug 26, 2020, at 08:27, Brian Norris <briannorris@chromium.org> wrote:
> 
> On Mon, Aug 24, 2020 at 2:32 AM Kai-Heng Feng
> <kai.heng.feng@canonical.com> wrote:
>> 
>> Sometimes system freeze on cold/warm boot when rtw88 is probing.
>> 
>> According to [1], platform firmware may not properly power manage the
>> device during shutdown. I did some expirements and putting the device to
>> D3 can workaround the issue.
>> 
>> So let's power cycle the device by putting the device to D3 at shutdown
>> to prevent the issue from happening.
>> 
>> [1] https://bugzilla.kernel.org/show_bug.cgi?id=206411#c9
>> 
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> 
> Can you at least include some more details, like which hardware
> version and firmware?

8723DE, 8822BE and 8822CE are affected [1].

> And which platform?

Many x86 laptops.

Some users claim BIOS update can fix the issue, however some are still affected.

> It seems a bit harsh to
> include a platform workaround to run for everyone, unless there's
> truly no downside. But even then, it's good to log what you're working
> with, in case there are ever problems with this in the future.

Ok. I can send V2 with more detailed commit message.

[1] https://bugs.launchpad.net/bugs/1872984

Kai-Heng

> 
> Brian


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] rtw88: pci: Power cycle device during shutdown
  2020-08-24  9:32 [PATCH] rtw88: pci: Power cycle device during shutdown Kai-Heng Feng
  2020-08-26  0:27 ` Brian Norris
@ 2020-09-28 16:55 ` Kai-Heng Feng
  2020-10-01 13:28   ` Kalle Valo
  1 sibling, 1 reply; 5+ messages in thread
From: Kai-Heng Feng @ 2020-09-28 16:55 UTC (permalink / raw)
  To: yhchuang, kvalo
  Cc: briannorris, Kai-Heng Feng, David S. Miller, Jakub Kicinski,
	open list:REALTEK WIRELESS DRIVER (rtw88),
	open list:NETWORKING DRIVERS, open list

There are reports that 8822CE fails to work rtw88 with "failed to read DBI
register" error. Also I have a system with 8723DE which freezes the whole
system when the rtw88 is probing the device.

According to [1], platform firmware may not properly power manage the
device during shutdown. I did some expirements and putting the device to
D3 can workaround the issue.

So let's power cycle the device by putting the device to D3 at shutdown
to prevent the issue from happening.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=206411#c9

BugLink: https://bugs.launchpad.net/bugs/1872984
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
v2:
 - Add more detail in commit log.

 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 3413973bc475..7f1f5073b9f4 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1599,6 +1599,8 @@ void rtw_pci_shutdown(struct pci_dev *pdev)
 
 	if (chip->ops->shutdown)
 		chip->ops->shutdown(rtwdev);
+
+	pci_set_power_state(pdev, PCI_D3hot);
 }
 EXPORT_SYMBOL(rtw_pci_shutdown);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] rtw88: pci: Power cycle device during shutdown
  2020-09-28 16:55 ` [PATCH v2] " Kai-Heng Feng
@ 2020-10-01 13:28   ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2020-10-01 13:28 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: yhchuang, briannorris, Kai-Heng Feng, David S. Miller,
	Jakub Kicinski, open list:REALTEK WIRELESS DRIVER (rtw88),
	open list:NETWORKING DRIVERS, open list

Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:

> There are reports that 8822CE fails to work rtw88 with "failed to read DBI
> register" error. Also I have a system with 8723DE which freezes the whole
> system when the rtw88 is probing the device.
> 
> According to [1], platform firmware may not properly power manage the
> device during shutdown. I did some expirements and putting the device to
> D3 can workaround the issue.
> 
> So let's power cycle the device by putting the device to D3 at shutdown
> to prevent the issue from happening.
> 
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=206411#c9
> 
> BugLink: https://bugs.launchpad.net/bugs/1872984
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Patch applied to wireless-drivers-next.git, thanks.

44492e70adc8 rtw88: pci: Power cycle device during shutdown

-- 
https://patchwork.kernel.org/patch/11804271/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-01 13:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24  9:32 [PATCH] rtw88: pci: Power cycle device during shutdown Kai-Heng Feng
2020-08-26  0:27 ` Brian Norris
2020-09-09 14:00   ` Kai-Heng Feng
2020-09-28 16:55 ` [PATCH v2] " Kai-Heng Feng
2020-10-01 13:28   ` Kalle Valo

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).