Skip to content

coresight: Add CPU cluster funnel/replicator/tmc support

Yuanfang Zhang linux-arm-kernel linux-arm-msm linux-devicetree linux-pm lkml 2 versions – NAK

Status from this message: NACK, and the rationale expressed as a question:

Get series with b4
b4 am 20251218-cpu_cluster_component_pm-v2-0-2335a6ae62a0@oss.qualcomm.com change-id 20251016-cpu_cluster_component_pm-ce518f510433

Versions newest first

  1. v2 Latest12 patches 17 repliesNAK
  2. v112 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Use the qcom,cpu-bound-components device tree property to identify devices
bound to a cluster.
- Refactor commit message.
- Introduce a supported_cpus field in the drvdata structure to record the CPUs
that belong to the cluster where the local component resides.
- Link to v1: https://lore.kernel.org/r/20251027-cpu_cluster_component_pm-v1-0-31355ac588c2@oss.qualcomm.com

Patches in v2

#Subject and filesSizeRepliesApplied
1/12dt-bindings: arm: coresight: Add 'qcom,cpu-bound-components' propertyDocumentation/devicetree/bindings/arm/arm,coresight-dynamic-funnel.yaml Documentation/devicetree/bindings/arm/arm,coresight-dynamic-replicator.yaml Documentation/devicetree/bindings/arm/arm,coresight-tmc.yaml+15 -01 reply
2/12coresight-funnel: Support CPU cluster funnel initializationdrivers/hwtracing/coresight/coresight-funnel.c+152 -310 replies
3/12coresight-funnel: Defer probe when associated CPUs are offlinedrivers/hwtracing/coresight/coresight-funnel.c+57 -50 replies
4/12coresight-replicator: Support CPU cluster replicator initializationdrivers/hwtracing/coresight/coresight-replicator.c+167 -330 replies
5/12coresight-replicator: Defer probe when associated CPUs are offlinedrivers/hwtracing/coresight/coresight-replicator.c+61 -40 replies
6/12coresight-replicator: Update management interface for CPU-bound devicesdrivers/hwtracing/coresight/coresight-replicator.c+59 -20 replies
7/12coresight-tmc: Support probe and initialization for CPU cluster TMCsdrivers/hwtracing/coresight/coresight-tmc-core.c drivers/hwtracing/coresight/coresight-tmc.h+132 -690 replies
8/12coresight-tmc-etf: Refactor enable function for CPU cluster ETF supportdrivers/hwtracing/coresight/coresight-tmc-etf.c+77 -100 replies
9/12coresight-tmc: Update management interface for CPU-bound TMCsdrivers/hwtracing/coresight/coresight-tmc-core.c+123 -140 replies
10/12coresight-tmc: Defer probe when associated CPUs are offlinedrivers/hwtracing/coresight/coresight-tmc-core.c drivers/hwtracing/coresight/coresight-tmc.h+61 -20 replies
11/12coresight: Pass trace mode to link enable callbackdrivers/hwtracing/coresight/coresight-core.c drivers/hwtracing/coresight/coresight-funnel.c drivers/hwtracing/coresight/coresight-replicator.c +4 more+70 -90 replies
12/12arm64: dts: qcom: hamoa: Add CoreSight nodes for APSS debug blockarch/arm64/boot/dts/qcom/hamoa.dtsi arch/arm64/boot/dts/qcom/purwa.dtsi+938 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/12] coresight: Add CPU cluster funnel/replicator/tmc support

This patch series adds support for CoreSight components local to CPU clusters, including funnel, replicator, and TMC, which reside within CPU cluster power domains. These components require special handling due to power domain constraints.

Unlike system-level CoreSight devices, these components share the CPU cluster's power domain. When the cluster enters low-power mode (LPM), their registers become inaccessible. Notably, pm_runtime_get alone cannot bring the cluster out of LPM, making standard register access unreliable.

To address this, the series introduces:
- Identifying cluster-bound devices via a new qcom,cpu-bound-components device tree property.
- Implementing deferred probing: if associated CPUs are offline during probe, initialization is deferred until a CPU hotplug notifier detects the CPU coming online.
- Utilizing smp_call_function_single() to ensure register accesses (initialization, enablement, sysfs reads) are always executed on a powered CPU within the target cluster.
- Extending the CoreSight link enable callback to pass the cs_mode. This allows drivers to distinguish between SysFS and Perf modes and apply mode-specific logic.

Jie Gan (1):
arm64: dts: qcom: hamoa: add Coresight nodes for APSS debug block

Yuanfang Zhang (11):
dt-bindings: arm: coresight: Add 'qcom,cpu-bound-components' property
coresight: Pass trace mode to link enable callback
coresight-funnel: Support CPU cluster funnel initialization
coresight-funnel: Defer probe when associated CPUs are offline
coresight-replicator: Support CPU cluster replicator initialization
coresight-replicator: Defer probe when associated CPUs are offline
coresight-replicator: Update management interface for CPU-bound devices
coresight-tmc: Support probe and initialization for CPU cluster TMCs
coresight-tmc-etf: Refactor enable function for CPU cluster ETF support
coresight-tmc: Update management interface for CPU-bound TMCs
coresight-tmc: Defer probe when associated CPUs are offline

Verification:

This series has been verified on sm8750.

Test steps for delay probe:

1. limit the system to enable at most 6 CPU cores during boot.
2. echo 1 >/sys/bus/cpu/devices/cpu6/online.
3. check whether ETM6 and ETM7 have been probed.

Test steps for sysfs mode:

echo 1 >/sys/bus/coresight/devices/tmc_etf0/enable_sink echo 1 >/sys/bus/coresight/devices/etm0/enable_source echo 1 >/sys/bus/coresight/devices/etm6/enable_source echo 0 >/sys/bus/coresight/devices/etm0/enable_source echo 0 >/sys/bus/coresight/devicse/etm6/enable_source echo 0 >/sys/bus/coresight/devices/tmc_etf0/enable_sink

echo 1 >/sys/bus/coresight/devices/tmc_etf1/enable_sink echo 1 >/sys/bus/coresight/devcies/etm0/enable_source cat /dev/tmc_etf1 >/tmp/etf1.bin
echo 0 >/sys/bus/coresight/devices/etm0/enable_source echo 0 >/sys/bus/coresight/devices/tmc_etf1/enable_sink

echo 1 >/sys/bus/coresight/devices/tmc_etf2/enable_sink echo 1 >/sys/bus/coresight/devices/etm6/enable_source cat /dev/tmc_etf2 >/tmp/etf2.bin
echo 0 >/sys/bus/coresight/devices/etm6/enable_source echo 0 >/sys/bus/coresight/devices/tmc_etf2/enable_sink

Test steps for sysfs node:

cat /sys/bus/coresight/devices/tmc_etf*/mgmt/*

cat /sys/bus/coresight/devices/funnel*/funnel_ctrl

cat /sys/bus/coresight/devices/replicator*/mgmt/*

Test steps for perf mode:

perf record -a -e cs_etm//k -- sleep 5

---
Changes in v2:
- Use the qcom,cpu-bound-components device tree property to identify devices
bound to a cluster.
- Refactor commit message.
- Introduce a supported_cpus field in the drvdata structure to record the CPUs
that belong to the cluster where the local component resides.
- Link to v1: https://lore.kernel.org/r/20251027-cpu_cluster_component_pm-v1-0-31355ac588c2@oss.qualcomm.com

---
Jie Gan (1):
arm64: dts: qcom: hamoa: Add CoreSight nodes for APSS debug block

Yuanfang Zhang (11):
dt-bindings: arm: coresight: Add 'qcom,cpu-bound-components' property
coresight-funnel: Support CPU cluster funnel initialization
coresight-funnel: Defer probe when associated CPUs are offline
coresight-replicator: Support CPU cluster replicator initialization
coresight-replicator: Defer probe when associated CPUs are offline
coresight-replicator: Update management interface for CPU-bound devices
coresight-tmc: Support probe and initialization for CPU cluster TMCs
coresight-tmc-etf: Refactor enable function for CPU cluster ETF support
coresight-tmc: Update management interface for CPU-bound TMCs
coresight-tmc: Defer probe when associated CPUs are offline
coresight: Pass trace mode to link enable callback

 .../bindings/arm/arm,coresight-dynamic-funnel.yaml |   5 +
 .../arm/arm,coresight-dynamic-replicator.yaml      |   5 +
 .../devicetree/bindings/arm/arm,coresight-tmc.yaml |   5 +
 arch/arm64/boot/dts/qcom/hamoa.dtsi                | 926 +++++++++++++++++++++
 arch/arm64/boot/dts/qcom/purwa.dtsi                |  12 +
 drivers/hwtracing/coresight/coresight-core.c       |   7 +-
 drivers/hwtracing/coresight/coresight-funnel.c     | 258 +++++-
 drivers/hwtracing/coresight/coresight-replicator.c | 341 +++++++-
 drivers/hwtracing/coresight/coresight-tmc-core.c   | 387 +++++++--
 drivers/hwtracing/coresight/coresight-tmc-etf.c    | 106 ++-
 drivers/hwtracing/coresight/coresight-tmc.h        |  10 +
 drivers/hwtracing/coresight/coresight-tnoc.c       |   3 +-
 drivers/hwtracing/coresight/coresight-tpda.c       |   3 +-
 include/linux/coresight.h                          |   3 +-
 14 files changed, 1902 insertions(+), 169 deletions(-)

---
base-commit: 008d3547aae5bc86fac3eda317489169c3fda112
change-id: 20251016-cpu_cluster_component_pm-ce518f510433

Best regards,

Signature · 1 line
Yuanfang Zhang <[email protected]>