Skip to content

perf: marvell: Add CN20K DDR PMU support

Geetha sowjanya linux-arm-kernel linux-devicetree linux-perf-users lkml 8 versions – Applied

Status from this message: Applied to arm64 (for-next/perf), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest3 patches 1 replyApplied
  2. v72 patches 2 repliesSuperseded
  3. v62 patches 2 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v52 patches1 replySuperseded
v42 patches2 repliesSuperseded
v32 patches3 repliesSuperseded
v22 patches1 replySuperseded
v12 patches1 replySuperseded

Changes in v7 from the cover letter

- dt-bindings: dropped the CN20K DeviceTree example.
- perf: Handle ZQ sysfs IDs (62/63) in a dedicated switch case before the DFI range so GCC does not see overlapping case labels and Odyssey IDs 58-61 no longer fall through into ZQ handling.
- perf: Resolve shared numeric IDs 58-61 inside the DFI case for CN20K vs Odyssey (identical bitmap); extend programmable-event coverage to CAS events (36-38) for CN20K sysfs.
- perf: On event_add failure from ddr_perf_get_event_bitmap, cancel the hrtimer if needed and free the counter slot instead of returning with partial setup.
- perf: For CN20K, zero CFG0 before writing ZQ to CFG1 and zero CFG1 before non-ZQ CFG0 so stale masks do not combine across banks.

Patches in v8 Applied

#Subject and filesSizeRepliesApplied
1/3dt-bindings: perf: marvell: Add CN20K DDR PMU bindingDocumentation/devicetree/bindings/perf/marvell-cn10k-ddr.yaml+7 -10 replies
2/3perf: marvell: Add CN20K DDR PMU supportdrivers/perf/marvell_cn10k_ddr_pmu.c+214 -160 replies
3/3perf: marvell: Cancel CN10K DDR PMU hrtimer on device removedrivers/perf/marvell_cn10k_ddr_pmu.c+6 -00 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchKrzysztof Kozlowski
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 0/3] perf: marvell: Add CN20K DDR PMU support

This series adds support for the DDR Performance Monitoring Unit (PMU) present in Marvell CN20K SoCs.

The DDR PMU is part of the DRAM Subsystem (DSS) and provides hardware counters to monitor DDR traffic and performance events. The block implements eight programmable counters and two fixed-function counters tracking DDR read and write activity, and is accessed via a dedicated MMIO region.

CN20K is the successor to CN10K, and the DDR PMU hardware is functionally equivalent to the CN10K implementation, with only minor differences in register offsets and event mappings. To allow software to distinguish between the two silicon variants, this series introduces a specific "marvell,cn20k-ddr-pmu" compatible and extends the existing marvell_cn10k_ddr_pmu driver to handle CN20K via variant-specific data.

Chnages in v8:
- perf: Cancel the poll hrtimer in cn10k_ddr_perf_remove() before devm frees struct cn10k_ddr_pmu (pre-existing for CN10K/Odyssey).

Changes in v7:
- dt-bindings: dropped the CN20K DeviceTree example.
- perf: Handle ZQ sysfs IDs (62/63) in a dedicated switch case before the DFI range so GCC does not see overlapping case labels and Odyssey IDs 58-61 no longer fall through into ZQ handling.
- perf: Resolve shared numeric IDs 58-61 inside the DFI case for CN20K vs Odyssey (identical bitmap); extend programmable-event coverage to CAS events (36-38) for CN20K sysfs.
- perf: On event_add failure from ddr_perf_get_event_bitmap, cancel the hrtimer if needed and free the counter slot instead of returning with partial setup.
- perf: For CN20K, zero CFG0 before writing ZQ to CFG1 and zero CFG1 before non-ZQ CFG0 so stale masks do not combine across banks.

Changes in v6:
- dt-bindings: Document CN20K in the existing marvell-cn10k-ddr.yaml; add maintainer, description, compatible enum entry, and a CN20K example with unit-address aligned to reg.
- perf: Route CN20K ZQ events via dedicated sysfs IDs (62/63) and CFG1 programming; use (eventid - 42) for CFG1 bit positions and reject those IDs on non-CN20K silicon.
- perf: Disambiguate CN20K perf width events (58-61) from Odyssey DFI events at the same numeric IDs using an early CN20K branch and fallthrough into the existing DFI + programmable-event path on Odyssey.
- perf: Run CN20K programmable counters through the same manual-mode / start sequence as Odyssey.

Changes in v4:
- Fixed document file name.

Changes in v3:
- Expanded cover letter and commit message to better describe the DDR PMU hardware and its relationship to CN10K
- Fixed the file name.

Changes in v2:
- Fixed YAML syntax error triggered by a tab character in the examples section, which caused dt_binding_check to fail.

Changes in v1:
- Added a description field to the binding.
- Simplified the compatible property using 'const' instead of 'items/enum'.
- Updated the example node name to include a unit-address matching the reg base.

Geetha sowjanya (3):
dt-bindings: perf: marvell: Extend CN10K DDR PMU binding for CN20K
perf: marvell: Add CN20K DDR PMU support
perf: marvell: Cancel CN10K DDR PMU hrtimer on device remove

 .../bindings/perf/marvell-cn10k-ddr.yaml      |  18 +-
 drivers/perf/marvell_cn10k_ddr_pmu.c          | 236 ++++++++++++++++--
 2 files changed, 220 insertions(+), 15 deletions(-)
Signature · 1 line
2.25.1