]> git.ipfire.org Git - thirdparty/linux.git/commit
coresight: etm4x: Fix timestamp bit field handling
authorLeo Yan <leo.yan@arm.com>
Mon, 19 May 2025 17:49:44 +0000 (18:49 +0100)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 20 May 2025 15:16:15 +0000 (16:16 +0100)
commitee811bc733be5c57a2bfecdf2f6f5d4db466200a
treedcad9cd079de443107136e1f0bd0c97cbac02bd9
parentd23bc38e8aa4efbd617bf660bb1a25fee9f6c177
coresight: etm4x: Fix timestamp bit field handling

Timestamps in the trace data appear as all zeros on recent kernels,
although the feature works correctly on old kernels (e.g., v6.12).

Since commit c382ee674c8b ("arm64/sysreg/tools: Move TRFCR definitions
to sysreg"), the TRFCR_ELx_TS_{VIRTUAL|GUEST_PHYSICAL|PHYSICAL} macros
were updated to remove the bit shift. As a result, the driver no longer
shifts bits when operates the timestamp field.

Fix this by using the FIELD_PREP() and FIELD_GET() helpers.

Reported-by: Tamas Zsoldos <tamas.zsoldos@arm.com>
Fixes: c382ee674c8b ("arm64/sysreg/tools: Move TRFCR definitions to sysreg")
Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20250519174945.2245271-2-leo.yan@arm.com
drivers/hwtracing/coresight/coresight-etm4x-core.c
drivers/hwtracing/coresight/coresight-etm4x-sysfs.c