All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] platform/x86/amd/pmf: Add 1AH_M80H support and accumulator based NPU metrics
@ 2026-07-13 18:39 Shyam Sundar S K
  2026-07-13 18:39 ` [PATCH v2 1/6] platform/x86/amd/pmf: Use per-SoC smu_regs struct for SMU mailbox registers Shyam Sundar S K
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Shyam Sundar S K @ 2026-07-13 18:39 UTC (permalink / raw)
  To: hansg, ilpo.jarvinen
  Cc: platform-driver-x86, Patil.Reddy, mario.limonciello,
	Shyam Sundar S K

This series cleans up the PMF-SMU mailbox handling, adds support for the
AMD 1AH_M80H (Family 1AH Model 80H) platform, and introduces NPU metrics
retrieval for it based on a firmware managed DRAM metrics table.

Today the SMU mailbox register offsets are hardcoded in the send path,
which does not scale to platforms that use a different mailbox layout.
The first two patches address this: patch 1 moves the offsets into a
per-SoC struct amd_pmf_smu_regs carried as PCI driver_data, so all
existing platforms share a single legacy instance and new platforms only
add a table entry. Patch 2 then adds the 1AH_M80H device/ACPI IDs and its
extended mailbox, which uses three argument registers to return the
64-bit DRAM address and size of the metrics table.

Patches 3 and 4 are pure refactors with no functional change: the metrics
code moves out of core.c into a dedicated metrics.c, and the NPU metrics
retrieval is restructured around a per-CPU-ID switch so additional table
formats can be slotted in cleanly.

Patch 5 builds on that to add 1AH_M80H NPU metrics. Unlike earlier
platforms that copy a transfer table, 1AH_M80H exposes an accumulator
based metrics table (amd_pmf_metrics_v3) in DRAM; NPU values are derived
by delta calculation between consecutive samples, with the first sample
discarded to seed the baseline. This also extends amd_pmf_npu_metrics
with npu_temp, sourced from the new npu_temp_acc accumulator.

The series applies cleanly and existing platforms see no functional
change.

This series is based on top of the review-ilpo-next branch, with commit
f6ee11d77d15 as the head.

v2:
- Change the amd_pmf_legacy_smu_regs to amd_pmf_smu_regs_v1 and v2 for 1ah_m80h
- Remove arg0, arg1, arg2 comments wriiten in the amd_pmf_smu_regs_v2 struct
- Update git commit messages with amd_pmf_smu_regs_v1 and amd_pmf_smu_regs_v2 accordingly
- Add includes and introduce separate patch for upper/lower_32_bits()
- Use DIV_U64_ROUND_CLOSEST() instead of DIV_ROUND_CLOSEST_ULL()
- Use macros present in units.h
- Replace is_amd_pmf_1ah_m80h() with amd_pmf_supports_accumulator_metrics()
- Add Reviewed-by tags

Shyam Sundar S K (6):
  platform/x86/amd/pmf: Use per-SoC smu_regs struct for SMU mailbox
    registers
  platform/x86/amd/pmf: Add 1AH_M80H device IDs and extended SMU mailbox
    registers
  platform/x86/amd/pmf: Move metrics code to dedicated file
  platform/x86/amd/pmf: Use upper/lower_32_bits() in
    amd_pmf_set_dram_addr()
  platform/x86/amd/pmf: Refactor NPU metrics for platform extensibility
  platform/x86/amd/pmf: Add 1AH_M80H metrics table and NPU metrics
    support

 drivers/platform/x86/amd/pmf/Makefile  |   2 +-
 drivers/platform/x86/amd/pmf/core.c    | 254 +++++++------------
 drivers/platform/x86/amd/pmf/metrics.c | 330 +++++++++++++++++++++++++
 drivers/platform/x86/amd/pmf/pmf.h     | 233 +++++++++++++++++
 include/linux/amd-pmf-io.h             |   2 +
 5 files changed, 654 insertions(+), 167 deletions(-)
 create mode 100644 drivers/platform/x86/amd/pmf/metrics.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-07-21 16:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 18:39 [PATCH v2 0/6] platform/x86/amd/pmf: Add 1AH_M80H support and accumulator based NPU metrics Shyam Sundar S K
2026-07-13 18:39 ` [PATCH v2 1/6] platform/x86/amd/pmf: Use per-SoC smu_regs struct for SMU mailbox registers Shyam Sundar S K
2026-07-13 18:39 ` [PATCH v2 2/6] platform/x86/amd/pmf: Add 1AH_M80H device IDs and extended " Shyam Sundar S K
2026-07-13 18:39 ` [PATCH v2 3/6] platform/x86/amd/pmf: Move metrics code to dedicated file Shyam Sundar S K
2026-07-21 16:09   ` Ilpo Järvinen
2026-07-13 18:39 ` [PATCH v2 4/6] platform/x86/amd/pmf: Use upper/lower_32_bits() in amd_pmf_set_dram_addr() Shyam Sundar S K
2026-07-13 18:39 ` [PATCH v2 5/6] platform/x86/amd/pmf: Refactor NPU metrics for platform extensibility Shyam Sundar S K
2026-07-13 18:39 ` [PATCH v2 6/6] platform/x86/amd/pmf: Add 1AH_M80H metrics table and NPU metrics support Shyam Sundar S K
2026-07-21 16:13   ` Ilpo Järvinen
2026-07-13 18:47 ` [PATCH v2 0/6] platform/x86/amd/pmf: Add 1AH_M80H support and accumulator based NPU metrics Mario Limonciello

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.