mfd: intel-lpss: Set d3hot_delay to 0
RFC PATCH 1/1 mfd: intel-lpss: Set d3hot_delay to 0
intel-lpss-pci already clears d3cold_delay, but every runtime resume of an LPSS controller still sleeps the default 10 ms d3hot_delay in pci_power_up().
On Arrow Lake-H (Lenovo Yoga Pro 7 14IAH10) the delay costs 8-16 ms per resume of the touchpad's I2C controller, which lands on the first touchpad report after each 1 s autosuspend. With d3hot_delay set to 0 the power-up takes 64-256 us and the I2C transfers that follow complete without errors.
Commit 815b4448198f ("i3c: mipi-i3c-hci-pci: Set d3hot_delay to 0 for Intel controllers") does the same for the Intel I3C controllers.
---
Notes:
RFC because I could only test Arrow Lake-H, and this applies to every LPSS generation the driver handles, back to Sunrise Point. Andy, do any of the older ones need the D3hot->D0 delay? If so I can limit it to newer IDs through the driver data.
drivers/mfd/intel-lpss-pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/intel-lpss-pci.c +1 -0
@@ -70,6 +70,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, info->quirks = quirk_pci_info->driver_data; pdev->d3cold_delay =0 ; + pdev->d3hot_delay =0 ;/* Probably it is enough to set this for iDMA capable devices only */ pci_set_master (pdev);
Signature · 1 line
2.56.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] mfd: unconditional d3hot_delay=0 breaks D3hot->D0 on older LPSS --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] mfd: unconditional d3hot_delay=0 breaks D3hot->D0 on older LPSS
--
commit 14a3fb20622240f2507d7dc10a344de95347f94a
Author: Navon John Lukose <[email protected]>
mfd: intel-lpss: Set d3hot_delay to 0
This commit unconditionally sets the D3hot delay to 0 for all Intel LPSS devices to optimize runtime resume times. It has been tested on Arrow Lake-H where it significantly reduces the delay before the first touchpad report.
drivers/mfd/intel-lpss-pci.c static int intel_lpss_pci_probe(struct pci_dev *pdev, · line 73
Quoted 9 lines
drivers/mfd/intel-lpss-pci.c +1
-0@@ -70,6 +70,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, info->quirks = quirk_pci_info->driver_data; pdev->d3cold_delay =0 ; + pdev->d3hot_delay =0 ;
[Severity: High]
Does unconditionally clearing the standard PCI D3hot delay break D3hot to D0 transitions on older LPSS hardware?
Setting d3hot_delay = 0 universally across all LPSS generations (including Broxton, Sunrise Point, Apollo Lake, etc.) skips the standard 10ms PCI PM delay.
If older hardware controllers do not stabilize fast enough upon runtime resume, could subsequent I2C or SPI transfers fail or time out? This might result in unresponsive touchpads, sensors, or TPMs.
Would it be safer to restrict this 0 delay to newer verified IDs via driver quirks?
Quoted 3 lines
drivers/mfd/intel-lpss-pci.c +0
-0/* Probably it is enough to set this for iDMA capable devices only */ pci_set_master (pdev);
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Andy Shevchenko
reviewerQuoted 9 lines · Navon John Lukose
intel-lpss-pci already clears
d3cold_delay, but every runtime resume of an LPSS controller still sleeps the default 10 msd3hot_delayinpci_power_up().On Arrow Lake-H (Lenovo Yoga Pro 7 14IAH10) the delay costs 8-16 ms per resume of the touchpad's I2C controller, which lands on the first touchpad report after each 1 s autosuspend. With
d3hot_delayset to 0 the power-up takes 64-256 us and the I2C transfers that follow complete without errors.
So, do you state that this patch fixes some bad touchpad behaviour? If so, please, provide some logs.
Quoted 2 lines
Commit
815b4448198f("i3c: mipi-i3c-hci-pci: Setd3hot_delayto 0 for Intel controllers") does the same for the Intel I3C controllers.
Okay, it means they were tested.
...
Quoted 5 lines
Notes:
RFC because I could only test Arrow Lake-H, and this applies to every LPSS generation the driver handles, back to Sunrise Point. Andy, do any of the older ones need theD3hot->D0delay? If so I can limit it to newer IDs through the driver data.
AFAIK 10 ms for D3hot delay is in accordance with PCI specification. Yes, we use quirk_remove_d3hot_delay() for very old Intel Atom SoCs, but I have no idea about Skylake line of products.
Mika, Ilpo, do you have any ideas or comments on this?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 2 lines · Andy Shevchenko
So, do you state that this patch fixes some bad touchpad behaviour? If so, please, provide some logs.
No, nothing misbehaves without it, so this is only an optimisation. It shortens the first touchpad report after the controller has autosuspended. I went after it because the driver already clears d3cold_delay and the D3hot one looked like it had been missed.
I timed the i2c-hid threaded IRQ handler for the touchpad (CIRQ1080 behind 00:15.0) with bpftrace, switching d3hot_delay at runtime:
d3hot_delay=10 d3hot_delay=0 controller already awake ~1.1 ms ~1.1 ms controller resumed in handler 12.6-14.4 ms 1.1-1.9 ms
There were no I2C errors with either value. That is about 12 ms saved once per idle period, which is not much. If nobody can vouch for the older generations, limiting it to newer IDs or dropping it is fine with me.
Hi,
Quoted 27 lines · Andy Shevchenko
Quoted 9 lines · Navon John Lukose
intel-lpss-pci already clears
d3cold_delay, but every runtime resume of an LPSS controller still sleeps the default 10 msd3hot_delayinpci_power_up().On Arrow Lake-H (Lenovo Yoga Pro 7 14IAH10) the delay costs 8-16 ms per resume of the touchpad's I2C controller, which lands on the first touchpad report after each 1 s autosuspend. With
d3hot_delayset to 0 the power-up takes 64-256 us and the I2C transfers that follow complete without errors.So, do you state that this patch fixes some bad touchpad behaviour? If so, please, provide some logs.
Quoted 2 lines
Commit
815b4448198f("i3c: mipi-i3c-hci-pci: Setd3hot_delayto 0 for Intel controllers") does the same for the Intel I3C controllers.Okay, it means they were tested.
...
Quoted 5 lines
Notes:
RFC because I could only test Arrow Lake-H, and this applies to every LPSS generation the driver handles, back to Sunrise Point. Andy, do any of the older ones need theD3hot->D0delay? If so I can limit it to newer IDs through the driver data.
Quoted 5 lines
AFAIK 10 ms for D3hot delay is in accordance with PCI specification. Yes, we use
quirk_remove_d3hot_delay()for very old Intel Atom SoCs, but I have no idea about Skylake line of products.Mika, Ilpo, do you have any ideas or comments on this?
Like you say it's requirement of the PCI spec. However, since these are really not PCI connected devices the delay likely is not needed as seen here. No objections from my side.
Andy Shevchenko
reviewerQuoted 19 lines · Mika Westerberg
Quoted 18 lines · Andy Shevchenko
Quoted 9 lines · Navon John Lukose
intel-lpss-pci already clears
d3cold_delay, but every runtime resume of an LPSS controller still sleeps the default 10 msd3hot_delayinpci_power_up().On Arrow Lake-H (Lenovo Yoga Pro 7 14IAH10) the delay costs 8-16 ms per resume of the touchpad's I2C controller, which lands on the first touchpad report after each 1 s autosuspend. With
d3hot_delayset to 0 the power-up takes 64-256 us and the I2C transfers that follow complete without errors.So, do you state that this patch fixes some bad touchpad behaviour? If so, please, provide some logs.
Quoted 2 lines
Commit
815b4448198f("i3c: mipi-i3c-hci-pci: Setd3hot_delayto 0 for Intel controllers") does the same for the Intel I3C controllers.Okay, it means they were tested.
...
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines
Notes:
RFC because I could only test Arrow Lake-H, and this applies to every LPSS generation the driver handles, back to Sunrise Point. Andy, do any of the older ones need theD3hot->D0delay? If so I can limit it to newer IDs through the driver data.AFAIK 10 ms for D3hot delay is in accordance with PCI specification. Yes, we use
quirk_remove_d3hot_delay()for very old Intel Atom SoCs, but I have no idea about Skylake line of products.
Quoted 5 lines
Quoted 1 line
Mika, Ilpo, do you have any ideas or comments on this?
Like you say it's requirement of the PCI spec. However, since these are really not PCI connected devices the delay likely is not needed as seen here. No objections from my side.
Okay, thanks.
Navon, please, issue a new version with the summary of this discussion being embedded into the commit message.
Signature · 2 lines
With Best Regards, Andy Shevchenko