]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
coresight: Refactor etm4_config_timestamp_event()
authorJames Clark <james.clark@linaro.org>
Fri, 28 Nov 2025 11:55:15 +0000 (11:55 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 22 Dec 2025 15:30:53 +0000 (15:30 +0000)
commitb02450de6ba6309c66e2e056ccfbfce4bd3b0352
tree429cf5d68225a31b46f4b8ea005365ce80d949c1
parent38f4c42734990ddf42ad6d996b14fbff8fdec9d2
coresight: Refactor etm4_config_timestamp_event()

Remove some of the magic numbers and try to clarify some of the
documentation so it's clearer how this sets up the timestamp interval.

Return errors directly instead of jumping to out and returning ret,
nothing needs to be cleaned up at the end and it only obscures the flow
and return value.

Add utilities for programming resource selectors that do compile time
checks for constants or WARN_ONs for non-constant values. FIELD_PREP
includes compile time checks so we only need to add an additional
BUILD_BUG_ON for resource == 0 in pair mode.

Tested-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20251128-james-cs-syncfreq-v8-3-4d319764cc58@linaro.org
drivers/hwtracing/coresight/coresight-etm4x-core.c
drivers/hwtracing/coresight/coresight-etm4x.h