diff options
| author | Brian Norris <briannorris@google.com> | 2025-10-03 15:40:09 -0700 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-01-05 17:47:15 -0600 |
| commit | 4d982084507d663df160546c4c48066a8887ed89 (patch) | |
| tree | 5e79bce558d7ca79f739d6d4e75c3e0bf86abe85 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | 8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff) | |
PCI/PM: Avoid redundant delays on D3hot->D3cold
When transitioning to D3cold, __pci_set_power_state() first transitions to
D3hot. If the device was already in D3hot, this adds excess work:
(a) read/modify/write PMCSR; and
(b) excess delay (pci_dev_d3_sleep()).
For (b), we already performed the necessary delay on the previous D3hot
entry; this was extra noticeable when evaluating runtime PM transition
latency.
Check whether we're already in the target state before continuing.
Note that __pci_set_power_state() already does this same check for other
state transitions, but D3cold is special because __pci_set_power_state()
converts it to D3hot for the purposes of PMCSR.
This seems to be an oversight in commit 0aacdc957401 ("PCI/PM: Clean up
pci_set_low_power_state()").
Fixes: 0aacdc957401 ("PCI/PM: Clean up pci_set_low_power_state()")
Signed-off-by: Brian Norris <briannorris@google.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
[bhelgaas: reverse test to match other "dev->current_state == state" cases]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20251003154008.1.I7a21c240b30062c66471329567a96dceb6274358@changeid
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
