Repository navigation
PCI: dwc: gs201: Advertise L1 PM Substates when CLKREQ# is wired - #269
angelrenefm wants to merge 1 commit into
Conversation
|
Thank you, Ángel. The measurements make the case well: 119 mW on the two PHY rails down to 4, with the policy as the only thing switched and each side measured twice. I checked first what this changes for the phones that already use the driver, and the answer is nothing: the new code runs only with Against Google's T_POWER_ON. The 5.10 driver for the Pixel 7 (
Two small things, neither a condition: the "L1 PM Substates advertised" line prints at every link-up, so it will repeat after each resume ( For the follow-up that adds |
The DWC core hides the root port's L1 PM Substates capability unless the driver sets l1ss_support, so the Wi-Fi link on Pixel 7 only ever reaches ASPM L1 and the PHY never powers down while idle. Set l1ss_support from the generic supports-clkreq property. When it is set, program the root port's L1SS capability (L1.1/L1.2 for ASPM and PCI-PM, Common_Mode_Restore_Time 42 us, T_POWER_ON 200 us) and the controller's L1.2 entry timings (DBI 0xb44: T_POWER_OFF 2, T_L1_2 10, T_PCLKACK 3). The values are the ones Google's gs201 driver uses with the Broadcom Wi-Fi, in the Wi-Fi branch of exynos_pcie_rc_set_l1ss() in drivers/pci/controller/dwc/pcie-exynos-rc.c: kernel/google-modules/soc/gs, branch android-gs-pantah-6.1-android16, writes T_POWER_ON 200 us there; the older 5.10 driver (kernel/gs, android-gs-pantah-5.10-android15-qpr1) wrote 130 us, which in 6.1 is left only in the uncalled exynos_pcie_rc_set_tpoweron(). This follows the 6.1 driver. The PHY's L1.2 settings and the I/A sequencer that re-locks the CDR on L1.2 exit are already in place. The capability is reprogrammed at every link-up, so the "advertised" line is printed once and as a debug message after that (on resume). On devicetree platforms the PCI core does not enable L1 substates by default, so this only makes them available: they are switched on with the link/l1_2_aspm sysfs attribute or pcie_aspm.policy=powersupersave. Tested on a Pixel 7 (panther) with this driver and supports-clkreq on the Wi-Fi node of my tree (omamobile#195's &pcie_1): the root port reports "L1 PM Substates advertised (cap 0x00692a1f, L1SUB 0xea)", and with pcie_aspm.policy=powersupersave both ends show ASPM L1.1+/L1.2+ in L1SubCtl1. The Wi-Fi stays up (ping to the access point 2.3-3.8 ms). On the S2MPG13 power meter, screen off, 20 s windows alternating the policy: the PCIe PHY rails (LDO3S + LDO18S) go from 71 + 48 mW to 4 + 0 mW, and the Wi-Fi chip's VSYS rail from 281-286 to 221-224 mW. Those measurements were taken with T_POWER_ON 130 us. With this commit (200 us), after reloading the driver on the same phone, lspci -vv shows PortTPowerOnTime=200us on the root port (the Wi-Fi function advertises 50 us) and L1SubCtl2 T_PwrOn=200us on both ends, the driver prints "cap 0x00a12a1f, L1SUB 0xea", and 20 pings to the access point go through with no loss (2.5 ms average). That was a module reload, not a cold boot. Assisted-by: LLM Signed-off-by: Ángel René <17342133+angelrenefm@users.noreply.github.com>
d7dbf9f to
f2fc7bc
Compare
|
Thank you, Derek. You're right about the 6.1 driver: in I've moved to 200 us, the newer driver's value: it's the one Google ships for this phone today, and a longer power-on time can only cost a little exit latency, while a short one risks the link. The commit message now names both branches and the file, and has today's 200 us result. The "advertised" line prints once; after that it's
The driver logs The power measurements were taken with The I used AI help (Claude) to work on this. |
On the Pixel 7 the Wi-Fi link only ever reaches ASPM L1. The DWC core hides the root port's L1 PM Substates capability unless the driver sets
l1ss_support, so the PCIe PHY never powers down while idle. On my unit that costs about 177 mW with the screen off.This sets
l1ss_supportfrom the genericsupports-clkreqproperty. Without the property nothing changes, so it doesn't touch other gs201/zuma boards. With it, the driver programs the root port's L1SS capability and the controller's L1.2 entry timings. The values are the ones Google's driver uses with this Broadcom chip; the commit message names where each comes from. The PHY's L1.2 settings and the I/A sequencer were already in place.Two things outside this commit:
supports-clkreq;belongs in panther's&pcie_1, and that node only exists in arm64: dts: exynos: google: gs201-panther: add Wi-Fi #195 (the Pixel 7 Wi-Fi). Once you're happy with this I'll add the line there, or send it as its own commit on top of arm64: dts: exynos: google: gs201-panther: add Wi-Fi #195, whichever you prefer.pcie_aspm.policy=powersupersave, which can be set on the command line or written at runtime to/sys/module/pcie_aspm/parameters/policy. Writinglink/l1_2_aspmalone isn't enough with the default policy (aspm.c,policy_to_aspm_state()).Tested on a Pixel 7 (panther):
panther-todo370dcbeef), which carries arm64: dts: exynos: google: gs201-panther: add Wi-Fi #195's Wi-Fi node, with this commit andsupports-clkreqon&pcie_1, booted withomamobile push. I did it twice: once as is, and again with the fingerprint and torch overlays and my usual config, which is the kernel the phone runs now. The driver file is the same one this PR adds ontoomamobile.L1 PM Substates advertised (cap 0x00692a1f, L1SUB 0xea). Withpowersupersave, both ends showASPM_L1.1+ ASPM_L1.2+. The Wi-Fi stays connected, with pings to the access point at 2.3-3.8 ms.Each policy was measured twice, alternating.
omamobileitself:tools/kernel-pr-check --buildpasses. That covers the sign-off, checkpatch--strictwith 0 warnings, and the W=1 build ofpcie-gs201.c.Not tested:
I used AI help (Claude) to work on this.