]> Gentwo Git Trees - linux/.git/commit
coresight: etm4x: Properly control filter in CPU idle with FEAT_TRF
authorLeo Yan <leo.yan@arm.com>
Tue, 11 Nov 2025 18:58:40 +0000 (18:58 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 11 Nov 2025 21:47:58 +0000 (21:47 +0000)
commit1fdc2cd347a7bc58acacb6144404ee892cea6c2e
treeb37bceeb4c00c3c0e64b4a3a5b3043816d1600ad
parent64eb04ae545294e105ad91714dc3167a0b660731
coresight: etm4x: Properly control filter in CPU idle with FEAT_TRF

If a CPU supports FEAT_TRF, as described in the section K5.5 "Context
switching", Arm ARM (ARM DDI 0487 L.a), it defines a flow to prohibit
program-flow trace, execute a TSB CSYNC instruction for flushing,
followed by clearing TRCPRGCTLR.EN bit.

To restore the state, the reverse sequence is required.

This differs from the procedure described in the section 3.4.1 "The
procedure when powering down the PE" of ARM IHI0064H.b, which involves
the OS Lock to prevent external debugger accesses and implicitly
disables trace.

To be compatible with different ETM versions, explicitly control trace
unit using etm4_disable_trace_unit() and etm4_enable_trace_unit()
during CPU idle to comply with FEAT_TRF.

As a result, the save states for TRFCR_ELx and trcprgctlr are redundant,
remove them.

Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states")
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Tested-by: James Clark <james.clark@linaro.org>
Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20251111-arm_coresight_power_management_fix-v6-6-f55553b6c8b3@arm.com
drivers/hwtracing/coresight/coresight-etm4x-core.c
drivers/hwtracing/coresight/coresight-etm4x.h