Optimize the Coresight Trace id allocation logic - #1032
Open
Jie Gan (jiegan0107) wants to merge 2 commits into
Open
Optimize the Coresight Trace id allocation logic#1032Jie Gan (jiegan0107) wants to merge 2 commits into
Jie Gan (jiegan0107) wants to merge 2 commits into
Conversation
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
Jie Gan (jiegan0107)
requested review from
a team,
Amit Kucheria (idlethread),
jingyiwang42 and
Kaushal Kumar (quic-kaushalk)
August 31, 2026 02:42
…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>
Jie Gan (jiegan0107)
force-pushed
the
qcom-6.18.y
branch
from
September 3, 2026 03:12
af3853e to
f562475
Compare
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 |
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.
Optimize the Coresight Trace id allocation logic
CRs-Fixed: 4661884