Bug 217794 - firmware-iwlwifi: Wireless AC 7265 lacks D3cold support
Summary: firmware-iwlwifi: Wireless AC 7265 lacks D3cold support
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: drivers_pci@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-14 18:54 UTC by Juno Computers
Modified: 2023-11-08 21:45 UTC (History)
2 users (show)

See Also:
Kernel Version: 6.4.0-2-amd64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Logs (510.75 KB, application/zip)
2023-08-14 18:54 UTC, Juno Computers
Details
logs-nowifi (409.93 KB, application/zip)
2023-08-15 15:53 UTC, Juno Computers
Details
PCI PM debug (8.32 KB, patch)
2023-08-15 23:09 UTC, Bjorn Helgaas
Details | Diff
logs-patch-pmoff (412.15 KB, application/zip)
2023-08-22 19:32 UTC, Juno Computers
Details
dmesg with patch 2 (122.49 KB, text/plain)
2023-09-06 21:38 UTC, Juno Computers
Details

Description Juno Computers 2023-08-14 18:54:21 UTC
Created attachment 304851 [details]
Logs

Dear Maintainer,

If D3Cold is enabled from BIOS the tablet boots without Wifi. The only two ways
to enable wifi support is either by disabling D3Cold from BIOS (not ideal) or
adding pcie_port_pm=off to grub

[   12.681303] iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AC
7265, REV=0x210

This is needed for our new Juno Tab 2


Please check the following logs attached.
Comment 1 Mario Limonciello (AMD) 2023-08-14 18:59:43 UTC
> If D3Cold is enabled from BIOS the tablet boots without Wifi. 
Does this issue also happen in Windows?  Can you confirm what power state Windows puts the root port into?


> The only two ways
to enable wifi support is either by disabling D3Cold from BIOS (not ideal) or
adding pcie_port_pm=off to grub

Why is disabling D3cold from the BIOS not ideal here?  It seems like it's the perfect case to me.  You have an incompatibility with D3cold and your wifi device and a knob you can turn it off that would fix the issue!

> Low Power S0 Idle (V5) : 0

Unfortunately, my patch series [1] won't be able to help this system.

[1] https://lore.kernel.org/linux-pci/20230809185453.40916-1-mario.limonciello@amd.com/T/#t
Comment 2 Juno Computers 2023-08-14 19:03:13 UTC
On Windows the wifi is detected either with D3Cold on and off. No extra settings needed. The only advantage is that it has better power savings when enabled.

On Linux if D3Cold is enabled on BIOS the OS will not find the Wifi card at all, unless I add the module. 

Wouldn't it be better if the Wifi card model had D3cold support and take advantages of its features?
Comment 3 Mario Limonciello (AMD) 2023-08-14 19:07:14 UTC
> On Windows the wifi is detected either with D3Cold on and off. No extra
> settings needed. The only advantage is that it has better power savings when
> enabled.

Can you share another log file without pcie_port_pm=off on your kernel command line?

> Wouldn't it be better if the Wifi card model had D3cold support and take
> advantages of its features?

Got it;  This wasn't obvious to me that Windows worked with D3cold enabled.
Comment 4 Juno Computers 2023-08-15 15:53:23 UTC
Created attachment 304858 [details]
logs-nowifi
Comment 5 Juno Computers 2023-08-15 15:54:20 UTC
I have added a new zip with logs without pcie_port_pm=off

Sorry, I guess I should have mentioned that it does work with windows.
Comment 6 Bjorn Helgaas 2023-08-15 23:06:10 UTC
(In reply to Juno Computers from comment #2 and comment #4)

Interesting that without pcie_port_pm=off (the case where iwlwifi doesn't work), we *did* enumerate 01:00.0, so it was powered up to begin with, but it seems to have been put in D3cold later, and we are unable to bring it back to D0:

  pci 0000:00:1c.0: [8086:4db9] type 01 class 0x060400
  pci 0000:00:1c.0: PCI bridge to [bus 01]
  pci 0000:01:00.0: [8086:095a] type 00 class 0x028000
  ...
  pcieport 0000:00:1c.0: Data Link Layer Link Active not set in 1000 msec
  pci 0000:01:00.0: Unable to change power state from D3cold to D0, device inaccessible
  iwlwifi 0000:01:00.0: Unable to change power state from D3cold to D0, device inaccessible
  iwlwifi 0000:01:00.0: HW_REV=0xFFFFFFFF, PCI issues?
  iwlwifi: probe of 0000:01:00.0 failed with error -5

In comment #2, you mentioned we didn't find the wifi at all (although I think the PCI core technically DID find the device as above, but iwlwifi couldn't use it because it got powered off).

But you *also* said "unless I add the module."  Tell me more about that!  Does that mean that if you modprobe iwlwifi manually, it does work?
Comment 7 Bjorn Helgaas 2023-08-15 23:09:04 UTC
Created attachment 304859 [details]
PCI PM debug

Would you mind adding this patch (this is based on v6.5-rc1), building with CONFIG_DYNAMIC_DEBUG=y, and adding 'dyndbg="file drivers/pci/* +p"' to your kernel parameters?  This is low-tech and will probably require multiple iterations, but I don't understand PM very well so I don't really know how to do anything smarter.
Comment 8 Juno Computers 2023-08-21 14:14:58 UTC
Hi Bjorn, 

I compiled the kernel with the patch and added dyndb to my kernel. Do you want me to run all the same test or just one in specific?
Comment 9 Bjorn Helgaas 2023-08-21 17:17:43 UTC
I guess start with D3cold enabled in BIOS (what is the actual BIOS Setup prompt?) and boot once with pcie_port_pm=off (which should work) and once without (which should fail).
Comment 10 Juno Computers 2023-08-22 19:32:14 UTC
Created attachment 304925 [details]
logs-patch-pmoff
Comment 11 Juno Computers 2023-08-22 19:32:34 UTC
I have uploaded the new files with the patch. I don't think much has changed.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.nopnp pcie_port_pm=off 'dyndbg=file drivers/pci/* +p'"
Comment 12 Bjorn Helgaas 2023-08-28 22:10:24 UTC
Did you try a boot without "pcie_port_pm=off"?

In the comment #10 attachment, I only see the working case (with "pcie_port_pm=off").

There's also this patch: https://lore.kernel.org/r/20230824013738.1894965-1-chenfeiyang@loongson.cn, which touches that path.  But it fixes a bug for devices that lack a Power Management capability, and your 7265 device *does* have capability, so I don't think the patch will make a difference for you.
Comment 13 Juno Computers 2023-09-04 02:53:11 UTC
I patched the kernel and it did not work. Bummer ;(

Do you have any other idea what it could be?
Comment 14 Bjorn Helgaas 2023-09-04 11:55:14 UTC
Can you boot the instrumented kernel without "pcie_port_pm=off" and collect the dmesg log?
Comment 15 Juno Computers 2023-09-06 21:38:24 UTC
Created attachment 305058 [details]
dmesg with patch 2
Comment 16 Juno Computers 2023-09-06 21:38:41 UTC
File uploaded
Comment 17 Juno Computers 2023-09-27 18:33:27 UTC
Hi, any updates on this?
Comment 18 Juno Computers 2023-11-08 21:45:37 UTC
I found this and was wondering if this could apply to this current issue.

https://bugzilla.kernel.org/show_bug.cgi?id=215715

Note You need to log in before you can comment on or make changes to this bug.