Add support for BW scale - #1133
Open
krishnachaitanya-linux wants to merge 2 commits into
Open
krishnachaitanya-linux wants to merge 2 commits into
krishnachaitanya-linux wants to merge 2 commits into
Conversation
Add a devfreq-based PCIe Link Speed controller that uses downstream I/O activity to scale the link speed through the simple_ondemand governor. Track submitted and completed request bytes for participating endpoints, aggregate activity across PCIe bridge hierarchies, and account for in-flight requests when calculating link utilization. Protect link retraining with a minimum downscale dwell time and limit downscaling to one supported speed step at a time. Require every endpoint below a port to opt in before changing its link speed, preventing non-participating devices from being affected by bandwidth scaling. Add the Qualcomm PCIe Link Bandwidth Notification Capability bit required for this functionality. Integrate NVMe data-queue activity reporting while excluding admin-queue traffic, so link speed follows actual storage I/O rather than driver housekeeping. Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
…nk retraining PCIe host bridge controllers 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 (per-lane frequency in kHz, LNKCTL2 Target Link Speed level). Keying by generation rather than total bandwidth lets OPP tables remain width-independent. 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. Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
krishnachaitanya-linux
force-pushed
the
bw_scale
branch
from
September 17, 2026 11:13
9cfe989 to
31b048b
Compare
Test jobs on 31b048b |
Test Matrix
|
Test jobs on 9cfe989 |
Test Matrix
|
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.
Add a devfreq-based PCIe Link Speed controller that uses downstream I/O
activity to scale the link speed through the simple_ondemand governor.
Track submitted and completed request bytes for participating endpoints,
aggregate activity across PCIe bridge hierarchies, and account for
in-flight requests when calculating link utilization. Protect link
retraining with a minimum downscale dwell time and limit downscaling to
one supported speed step at a time.
Require every endpoint below a port to opt in before changing its link
speed, preventing non-participating devices from being affected by
bandwidth scaling. Add the Qualcomm PCIe Link Bandwidth Notification
Capability bit required for this functionality.
Integrate NVMe data-queue activity reporting while excluding admin-queue
traffic, so link speed follows actual storage I/O rather than driver
housekeeping.