Repository navigation
FROMLIST: PCI/bwctrl: Set host bridge OPP and optionally disable ASPM around link retraining - #1475
Open
krishna-chundru wants to merge 2 commits into
Open
krishna-chundru wants to merge 2 commits into
krishna-chundru wants to merge 2 commits into
Conversation
Test resultsWorkflow run: 44258350036 attempt 1 Known failures configured: 0
Test Matrix
Failure summaryUnexpected failures
Result: blocked because unexpected failures were found. |
…ble ASPM around link retraining" This reverts commit 26ad524.
… around link retraining PCIe host bridge devices may need their operating point raised before retraining to a higher link speed so that hardware resources (e.g., RPMh votes on Qualcomm platforms) are available at the requested data rate. After retraining, the operating point must be updated to reflect the actual negotiated speed. Add pcie_set_opp() to look up an OPP on the host bridge parent device using a key of (total link rate in kHz, LNKCTL2 Target Link Speed level). The total link rate is the per-lane rate multiplied by the link width, so that OPP tables can carry separate entries per generation and width, e.g. Gen 3 x1 and Gen 3 x2. In pcie_set_target_speed(), call pcie_set_opp() before retraining only when upscaling (speed_req > cur_bus_speed), since only raising the operating point requires pre-staging hardware. After retraining, call pcie_set_opp() unconditionally with the actual cur_bus_speed to settle the votes. Both calls are skipped for downstream ports of PCIe switches, as those are outside the host controller's scope. Some controllers also require ASPM to be disabled around link retraining. Add a disable_aspm_for_retrain flag to pci_host_bridge; when set, pcie_set_target_speed() saves the child device's ASPM state, disables all ASPM link states before retraining, and restores them afterward. The child device is used because the ASPM core ignores requests made on the Root Port itself and configures the link through its downstream device. The states are restored with pci_force_enable_link_state(), as a plain enable does not undo pci_disable_link_state(). Tested-by: Val Packett <val@packett.cool> # x1e80100-dell-latitude-7455 Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com> Link: https://lore.kernel.org/all/20261119-bwscale-v6-1-9a9a715fcb46@oss.qualcomm.com/
krishna-chundru
force-pushed
the
bwctrl-opp-freq-width
branch
from
November 19, 2026 13:03
51cc9d3 to
c9f8964
Compare
|
Merge Check Failed: No CR Numbers Found Error: No Change Request numbers were found. Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests. |
Test resultsWorkflow run: 44529950153 attempt 1 Known failures configured: 0
Test Matrix
Failure summaryUnexpected failures
Result: blocked because unexpected failures were found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PCIe host bridge devices may need their operating point raised before
retraining to a higher link speed so that hardware resources (e.g., RPMh
votes on Qualcomm platforms) are available at the requested data rate.
After retraining, the operating point must be updated to reflect the
actual negotiated speed.
Add pcie_set_opp() to look up an OPP on the host bridge parent device
using a key of (total link rate in kHz, LNKCTL2 Target Link Speed
level). The total link rate is the per-lane rate multiplied by the
link width, so that OPP tables can carry separate entries per generation
and width, e.g. Gen 3 x1 and Gen 3 x2.
In pcie_set_target_speed(), call pcie_set_opp() before retraining only
when upscaling (speed_req > cur_bus_speed), since only raising the
operating point requires pre-staging hardware. After retraining, call
pcie_set_opp() unconditionally with the actual cur_bus_speed to settle
the votes. Both calls are skipped for downstream ports of PCIe switches,
as those are outside the host controller's scope.
Some controllers also require ASPM to be disabled around link retraining.
Add a disable_aspm_for_retrain flag to pci_host_bridge; when set,
pcie_set_target_speed() saves the child device's ASPM state, disables
all ASPM link states before retraining, and restores them afterward. The
child device is used because the ASPM core ignores requests made on the
Root Port itself and configures the link through its downstream device.
The states are restored with pci_force_enable_link_state(), as a
plain enable does not undo pci_disable_link_state().
Tested-by: Val Packett val@packett.cool # x1e80100-dell-latitude-7455
Signed-off-by: Krishna Chaitanya Chundru krishna.chundru@oss.qualcomm.com
Link: https://lore.kernel.org/all/20261119-bwscale-v6-1-9a9a715fcb46@oss.qualcomm.com/