Skip to content

Add support for BW scale - #1133

Open
krishnachaitanya-linux wants to merge 2 commits into
qualcomm-linux:qcom-7.2from
krishnachaitanya-linux:bw_scale
Open

krishnachaitanya-linux wants to merge 2 commits into
qualcomm-linux:qcom-7.2from
krishnachaitanya-linux:bw_scale

Conversation

@krishnachaitanya-linux

Copy link
Copy Markdown
Contributor

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.

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>
@qcomlnxci

Copy link
Copy Markdown

Test jobs on 31b048b

@qcomlnxci

Copy link
Copy Markdown

Test Matrix

Test Case glymur-crd-multimedia
Audio_Card_Registration ✅ Pass
BT_FW_KMD_Service ✅ Pass
BT_ON_OFF ✅ Pass
BT_SCAN ✅ Pass
CPUFreq_Validation ✅ Pass
CPU_affinity ✅ Pass
DSP_AudioPD ✅ Pass
Ethernet_Basic_Validation ⚠️ skip
Freq_Scaling ✅ Pass
GIC ✅ Pass
IPA ✅ Pass
Interrupts ✅ Pass
KVM_Driver ✅ Pass
KVM_EL2_DTB ✅ Pass
KVM_Infra ✅ Pass
OpenCV ✅ Pass
PCIe ✅ Pass
Probe_Failure_Check ❌ Fail
RMNET ✅ Pass
UFS_Validation ⚠️ skip
USBHost ✅ Pass
WiFi_Firmware_Driver ✅ Pass
WiFi_OnOff ✅ Pass
adsp_remoteproc ✅ Pass
cdsp_remoteproc ✅ Pass
gpdsp_remoteproc ⚠️ skip
hotplug ✅ Pass
irq ✅ Pass
kaslr ✅ Pass
pinctrl ✅ Pass
qcom_hwrng ✅ Pass
rngtest ✅ Pass
shmbridge ✅ Pass
smmu ❌ Fail
watchdog ✅ Pass
wpss_remoteproc ✅ Pass

@qcomlnxci

Copy link
Copy Markdown

Test jobs on 9cfe989

@qcomlnxci

Copy link
Copy Markdown

Test Matrix

Test Case glymur-crd-multimedia
Audio_Card_Registration ✅ Pass
BT_FW_KMD_Service ✅ Pass
BT_ON_OFF ✅ Pass
BT_SCAN ✅ Pass
CPUFreq_Validation ✅ Pass
CPU_affinity ✅ Pass
DSP_AudioPD ✅ Pass
Ethernet_Basic_Validation ⚠️ skip
Freq_Scaling ✅ Pass
GIC ✅ Pass
IPA ✅ Pass
Interrupts ✅ Pass
KVM_Driver ✅ Pass
KVM_EL2_DTB ✅ Pass
KVM_Infra ✅ Pass
OpenCV ✅ Pass
PCIe ✅ Pass
Probe_Failure_Check ❌ Fail
RMNET ✅ Pass
UFS_Validation ⚠️ skip
USBHost ✅ Pass
WiFi_Firmware_Driver ✅ Pass
WiFi_OnOff ✅ Pass
adsp_remoteproc ✅ Pass
cdsp_remoteproc ✅ Pass
gpdsp_remoteproc ⚠️ skip
hotplug ✅ Pass
irq ✅ Pass
kaslr ✅ Pass
pinctrl ✅ Pass
qcom_hwrng ✅ Pass
rngtest ✅ Pass
shmbridge ✅ Pass
smmu ❌ Fail
watchdog ✅ Pass
wpss_remoteproc ✅ Pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants