Repository navigation
SoC_Infra: add SoC_Infra_GPU_Clock_Rate_Validation suite - #695
VinodGudla wants to merge 2 commits into
Conversation
| fi | ||
| log_info "GPU clock controller (*-gpucc) in the device tree: $gpucc_in_dt" | ||
|
|
||
| if ! debugfs_root=$(socinfra_debugfs_root); then |
There was a problem hiding this comment.
An enabled GPU controller in DT does not guarantee debugfs support or a mounted/readable clock tree, so this fails healthy images with optional debugfs unavailable. Gate that prerequisite separately and SKIP when unavailable, retaining FAIL for broken clocks on an applicable interface (kernel export gate).
There was a problem hiding this comment.
debugfs and /clk are now gated separately and SKIP when unavailable, whatever the DT says. FAIL is kept for the case where the interface is present but no gpu* clocks are registered. Checked on QCS615-ride: normal run PASS (15 clocks); with debugfs unmounted the test SKIPs. Not tested: a platform without a GPU clock controller (logic unchanged). Fixed in 0693797.
logs-
root@qcs615-ride:/var/qcom-linux-testkit/Runner/suites/Kernel/Baseport/SoC_Infra_GPU_Clock_Rate_Validation# umount /sys/kernel/debug
root@qcs615-ride:/var/qcom-linux-testkit/Runner/suites/Kernel/Baseport/SoC_Infra_GPU_Clock_Rate_Validation# ./run.sh
[INFO] 2026-11-26 07:58:38 - --------------------------------------------------------------------------
[INFO] 2026-11-26 07:58:38 - Starting SoC_Infra_GPU_Clock_Rate_Validation
[SKIP] 2026-11-26 07:58:38 - SoC_Infra_GPU_Clock_Rate_Validation SKIP: debugfs is not mounted or not readable, so the clock tree is unavailable (mount -t debugfs debugfs /sys/kernel/debug, run as root)
| for scr_file in "$1/clk/$2"*/clk_rate; do | ||
| [ -e "$scr_file" ] || continue | ||
| scr_name=$(basename "$(dirname "$scr_file")") | ||
| scr_val=$(tr -d '[:space:]' 2>/dev/null <"$scr_file") |
There was a problem hiding this comment.
Removing all whitespace turns malformed values such as 12 34 into 1234 and PASS, and the read status is discarded. Preserve the single-value format, check the read status, and reuse is_unsigned_number for validation.
There was a problem hiding this comment.
Removed tr -d '[:space:]'. The value is now read with cat and the read status is checked (READ_ERROR on failure). It is then validated with is_unsigned_number exactly as read, so only the trailing newline is dropped and "12 34" is no longer merged into 1234.
Fixed in 02a1ae6.
| - REPO_PATH=$PWD | ||
| - cd Runner/suites/Kernel/Baseport/SoC_Infra_GPU_Clock_Rate_Validation | ||
| - ./run.sh || true | ||
| - $REPO_PATH/Runner/utils/send-to-lava.sh SoC_Infra_GPU_Clock_Rate_Validation.res |
There was a problem hiding this comment.
An early runner exit without a result, such as failure to create gpu_clk_rates.log, is swallowed here and the default publisher exits successfully without reporting this testcase. Use send-to-lava.sh --strict --expected-testcase-id SoC_Infra_GPU_Clock_Rate_Validation and retain its failure status.
There was a problem hiding this comment.
The publisher now runs as the last step with --strict --expected-testcase-id SoC_Infra_GPU_Clock_Rate_Validation, with no || true on it, so its failure status is kept. A missing or invalid result file now fails the step instead of publishing nothing.
Fixed in 0693797.
Srikanth Muppandam (smuppand)
left a comment
There was a problem hiding this comment.
Please fold 02a1ae6 into c227efa and 0693797 into 48b23ac, retaining two signed commits: shared helpers first, then the suite. These follow-ups only correct this PR?s new code, so they can be included in the commits that introduce it.
Signed-off-by: VinodGudla <vinodgudla6@gmail.com>
Signed-off-by: VinodGudla <vinodgudla6@gmail.com>
0693797 to
2815e43
Compare
|
|
||
| socinfra_check_clk_rates "$debugfs_root" "$CLK_PREFIX" "$REPORT_FILE" | ||
| clk_rc=$? | ||
| log_info "Clocks checked: total=$SOCINFRA_CLK_TOTAL invalid=$SOCINFRA_CLK_BAD (details: $REPORT_FILE)" |
There was a problem hiding this comment.
Job 619157 reports PASS for 18 clocks, but stdout contains none of their names or rates. Replay $REPORT_FILE using the existing log_file_with_label after saving clk_rc, label the values as Hz, and retain the report file.
|
|
||
| | Verdict | Condition | | ||
| |---|---| | ||
| | PASS | At least one `gpu*` clock exists and each `clk_rate` file holds exactly one non-negative integer. A rate of `0` is valid, because a gated clock reports zero. | |
There was a problem hiding this comment.
The clock core can retain a nonzero cached rate for a gated clock or return zero for an unresolved parent. Please replace the gated-clock explanation with: zero is accepted by this readability/format check, which does not establish the physical frequency or clock enable state.
|
Source coverage follow-up for The callback formats an unsigned integer and normally returns a cached rate. This means:
Keep this PR's coverage described as registration/readability smoke coverage and address the existing stdout evidence and zero-rate explanation comments. Suggested separate coverage enhancement: a focused GPU workload/frequency-transition test using supported runtime interfaces. Do not make this smoke test reject every zero rate or introduce board-specific expected frequencies. The functional enhancement is a follow-up, not an additional merge requirement. |
Add the SoC_Infra_GPU_Clock_Rate_Validation suite under Runner/suites/Kernel/Baseport/SoC_Infra_GPU_Clock_Rate_Validation (run.sh, LAVA YAML, README). It checks that every /sys/kernel/debug/clk/gpu*/clk_rate value is an integer. It skips when the device tree has no GPU clock controller and fails when the controller exists but no gpu* clocks are registered.