[PATCH v1 00/11] CoreSight: Refactor CPU PM and hotplug

Yabin Cui yabinc at google.com
Fri May 16 15:40:09 PDT 2025


Hi Leo,

Thanks for the patchset!

I have tested the patches by backporting them to Android 6.1 kernel and running
system wide ETM data collection on Pixel 9, using both ETR and TRBE.
I didn't see any cpu idle problems.

Tested-by: Yabin Cui <yabinc at google.com>




On Fri, May 16, 2025 at 9:07 AM Leo Yan <leo.yan at arm.com> wrote:
>
> Besides managing tracers (ETM) in CPU PM and hotplug flows, the
> CoreSight framework is found the issues below:
>
> Firstly, on some hardware platforms, CoreSight links (e.g., funnels and
> replicators, etc) reside in a cluster power domain.  If the cluster is
> powered off, the link components also will lose their context.  In this
> case, Arm CoreSight drivers report errors when detect unpaired self-host
> claim tags.
>
> Secondly, if a path has been activated from per CPU's tracer (ETM) to
> links and a sink in Sysfs mode, then when the CPU is hot-plugged off,
> only the associated ETM will be disabled.  Afterwards, the links and the
> sink always keep on and no chance to be disabled.
>
> The last issue was reported by Yabin Cui (Google) that the TRBE driver
> misses to save and restore context during CPU low power states.  As a
> result, it may cause hardware lockup issue on some devices.
>
> To resolve the power management issues, this series extends CPU power
> management to cover the entire activated path, including links and
> sinks.  It moves CPU PM and hotplug notifiers from the ETMv4 driver to
> the CoreSight core layer.  The core layer has sufficient info to
> maintain activated paths and can traverse the entire path to manipulate
> CoreSight modules accordingly.
>
> Patch 01 is to fix a bug in ETMv4 save and restore callbacks.
>
> Patches 02 ~ 06 move CPU PM code from ETMv4 driver to the core layer, and
> extends to maintain activated paths and control links.
>
> Patches 07 and 08 support save and restore context for per-CPU sink
> (TRBE).  Note, for avoid long latency, system level's sinks in an
> activated path are not touched during CPU suspend and resume.
>
> Patches 09 ~ 11 move CPU hotplug notifier from ETMv4 driver to the core
> layer.  The entire path will be controlled if the corresponding CPU is
> hot-plugged on or off.
>
> This series has been verified on Hikey960 for CPUIdle and hotplug.  And
> it is tested on FVP for verifying TRBE with idle states.
>
>
> Leo Yan (10):
>   coresight: etm4x: Control the trace unit in CPU suspend
>   coresight: Set per CPU source pointer
>   coresight: Register CPU PM notifier in core layer
>   coresight: etm4x: Hook CPU PM callbacks
>   coresight: Save activated path into source device
>   coresight: Control path during CPU PM
>   coresight: Add PM callbacks in sink operation
>   coresight: Take hotplug lock in enable_source_store() for Sysfs mode
>   coresight: Move CPU hotplug callbacks to core layer
>   coresight: Manage activated paths during CPU hotplug
>
> Yabin Cui (1):
>   coresight: trbe: Save and restore state across CPU low power state
>
>  drivers/hwtracing/coresight/coresight-core.c       | 252 +++++++++++++++++++++++++++++++++++++++++
>  drivers/hwtracing/coresight/coresight-etm3x-core.c |   2 +
>  drivers/hwtracing/coresight/coresight-etm4x-core.c | 133 ++++++----------------
>  drivers/hwtracing/coresight/coresight-priv.h       |   1 +
>  drivers/hwtracing/coresight/coresight-sysfs.c      |  12 +-
>  drivers/hwtracing/coresight/coresight-trbe.c       |  65 +++++++++++
>  include/linux/coresight.h                          |  11 ++
>  7 files changed, 375 insertions(+), 101 deletions(-)
>
> --
> 2.34.1
>



More information about the linux-arm-kernel mailing list