Skip to content

Optimize the Coresight Trace id allocation logic - #1032

Open
Jie Gan (jiegan0107) wants to merge 2 commits into
qualcomm-linux:qcom-6.18.yfrom
jiegan0107:qcom-6.18.y
Open

Optimize the Coresight Trace id allocation logic#1032
Jie Gan (jiegan0107) wants to merge 2 commits into
qualcomm-linux:qcom-6.18.yfrom
jiegan0107:qcom-6.18.y

Conversation

@jiegan0107

Copy link
Copy Markdown

Optimize the Coresight Trace id allocation logic

CRs-Fixed: 4661884

When coresight_path_assign_trace_id() cannot assign a valid trace ID,
coresight_enable_sysfs() takes the err_path goto with ret still 0,
returning success to the caller despite no trace session being started.

Change coresight_path_assign_trace_id() to return int, moving the
IS_VALID_CS_TRACE_ID() check inside it so it returns -EINVAL on failure
and 0 on success. Update both callers to propagate this return value
directly instead of inspecting path->trace_id after the call.

Fixes: d87d76d ("Coresight: Allocate trace ID after building the path")
Reviewed-by: James Clark <james.clark@linaro.org>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20260512-fix-trace-id-error-v4-1-eb3de789767a@oss.qualcomm.com
…n-AMBA tnoc

For a tnoc device not on the AMBA bus, atid was set to -EOPNOTSUPP.
trace_noc_id() returns this value directly to
coresight_path_assign_trace_id(), which only treats a literal 0
return as "this device has no ID, keep searching the path" -
any other value is checked against IS_VALID_CS_TRACE_ID() and
rejected. A negative atid therefore made path assignment fail with
-EINVAL instead of falling through to the next device in the path
that could supply a valid trace ID.

Use 0, the same sentinel coresight_path_assign_trace_id() already
recognizes as "not allocated", instead of -EOPNOTSUPP.

Link: https://lore.kernel.org/all/20260902-fix-trace-id-error-in-tnoc-driver-v2-1-73669a947297@oss.qualcomm.com/
Fixes: 5799dee ("coresight-tnoc: add platform driver to support Interconnect TNOC")
Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
@jiegan0107

Copy link
Copy Markdown
Author

The patch[1] has been posted based on latest upstream tip.

On the qli2.0 tip, the patch[1] is conflict with another ongoing patch[2]. So, rebased it on top of the conflict patch [2].

[1] FROMLIST: coresight: tnoc: fix trace ID path assignment failure on non-AMBA tnoc
[2] f9336cd

@qcomlnxci

Copy link
Copy Markdown

Test Matrix

Test Case hamoa-iot-evk-multimedia lemans-evk-multimedia monaco-evk-multimedia purwa-iot-evk-multimedia qcs615-ride-multimedia qcs6490-rb3gen2-multimedia qcs8300-ride-multimedia qcs9100-ride-r3-multimedia shikra-iqs-evk-multimedia
Audio_Card_Registration ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ⚠️ skip ⚠️ skip ⚠️ skip
BT_FW_KMD_Service ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
BT_ON_OFF ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
BT_SCAN ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
CPUFreq_Validation ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
CPU_affinity ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
DSP_AudioPD ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ⚠️ skip
Ethernet_Basic_Validation ⚠️ skip ◻️ ✅ Pass ⚠️ skip ◻️ ⚠️ skip ❌ Fail ❌ Fail ⚠️ skip
Freq_Scaling ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ❌ Fail ✅ Pass ✅ Pass ✅ Pass
GIC ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ❌ Fail ✅ Pass ✅ Pass ❌ Fail
IPA ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
Interrupts ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
KVM_Driver ❌ Fail ◻️ ✅ Pass ❌ Fail ◻️ ❌ Fail ❌ Fail ❌ Fail ❌ Fail
KVM_EL2_DTB ❌ Fail ◻️ ✅ Pass ❌ Fail ◻️ ❌ Fail ❌ Fail ❌ Fail ❌ Fail
KVM_Infra ❌ Fail ◻️ ✅ Pass ❌ Fail ◻️ ❌ Fail ❌ Fail ❌ Fail ❌ Fail
OpenCV ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
PCIe ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
Probe_Failure_Check ❌ Fail ◻️ ❌ Fail ❌ Fail ◻️ ❌ Fail ❌ Fail ❌ Fail ❌ Fail
RMNET ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
UFS_Validation ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ⚠️ skip
USBHost ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ❌ Fail ❌ Fail ❌ Fail ❌ Fail
WiFi_Firmware_Driver ✅ Pass ◻️ ❌ Fail ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
WiFi_OnOff ✅ Pass ◻️ ❌ Fail ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ⚠️ skip
adsp_remoteproc ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ⚠️ skip
cdsp_remoteproc ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
gpdsp_remoteproc ⚠️ skip ◻️ ✅ Pass ⚠️ skip ◻️ ⚠️ skip ✅ Pass ✅ Pass ⚠️ skip
hotplug ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
irq ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
kaslr ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
pinctrl ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
qcom_hwrng ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ◻️
rngtest ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
shmbridge ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
smmu ❌ Fail ◻️ ✅ Pass ❌ Fail ◻️ ✅ Pass ✅ Pass ❌ Fail ✅ Pass
watchdog ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ Pass
wpss_remoteproc ✅ Pass ◻️ ✅ Pass ✅ Pass ◻️ ✅ Pass ✅ Pass ✅ Pass ✅ 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.

3 participants