mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Erwan Velu <erwanaliasr1@gmail.com>
To: platform-driver-x86@vger.kernel.org
Cc: "Naveen Krishna Chatradhi" <naveenkrishna.chatradhi@amd.com>,
	"Carlos Bilbao" <carlos.bilbao@kernel.org>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/4] platform/x86/amd/hsmp: Unify per-socket sysfs metrics
Date: Wed,  7 Oct 2026 14:59:04 +0200	[thread overview]
Message-ID: <20261007125908.321186-1-erwanaliasr1@gmail.com> (raw)

From: Erwan Velu <e.velu@criteo.com>

The goal of this series is to ease server monitoring, by exposing the
HSMP metrics the same way whatever the driver, in a format that is
straightforward to integrate in metrics exporters.

The per-socket HSMP telemetry attributes (c0_residency_input,
ddr_max_bw, pwr_current_active_freq_limit, ...) are only implemented by
the ACPI driver, although they are plain HSMP messages the platform
driver can send as well. Systems probed by the platform driver therefore
only get metrics_bin.

Their location also depends on the driver: AMDI0097:0X with the ACPI
driver, amd_hsmp/socketN with the platform one.

This series moves the attributes to common code and exposes them from
both drivers under a single /sys/devices/amd_hsmp/socketN location. The
existing ACPI and platform sysfs paths are kept for compatibility.

Patch 1 is a pure code move, patch 2 adds the socket devices and wires
them in the ACPI driver, patch 3 does the same for the platform driver.
Patch 4 exposes the pwr_current_active_freq_limit_source bitmask as a
single hexadecimal value, whose interpretation can be centralized in the
monitoring stack (e.g. Grafana value mappings).

Tested on Zen3 and Zen4 (Family 19h) servers with the platform driver,
and on Zen5 (Family 1Ah) servers with the ACPI driver, in both single
and dual socket configurations.

Erwan Velu (4):
  platform/x86/amd/hsmp: Move per-socket sysfs attributes to common code
  platform/x86/amd/hsmp: Add /sys/devices/amd_hsmp socket devices
  platform/x86/amd/hsmp: Expose socket attributes from the platform
    driver
  platform/x86/amd/hsmp: Add pwr_current_active_freq_limit_source_raw

 Documentation/arch/x86/amd_hsmp.rst    |  20 +-
 drivers/platform/x86/amd/hsmp/Makefile |   2 +-
 drivers/platform/x86/amd/hsmp/acpi.c   | 327 +----------------
 drivers/platform/x86/amd/hsmp/hsmp.h   |   6 +
 drivers/platform/x86/amd/hsmp/plat.c   |  20 ++
 drivers/platform/x86/amd/hsmp/sysfs.c  | 466 +++++++++++++++++++++++++
 6 files changed, 517 insertions(+), 324 deletions(-)
 create mode 100644 drivers/platform/x86/amd/hsmp/sysfs.c


base-commit: 22430ae5d90ab288b0ee2ad99ae941f4a666b694
-- 
2.53.0


             reply	other threads:[~2026-10-07 12:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 12:59 Erwan Velu [this message]
2026-10-07 12:59 ` [PATCH 1/4] platform/x86/amd/hsmp: Move per-socket sysfs attributes to common code Erwan Velu
2026-10-07 12:59 ` [PATCH 2/4] platform/x86/amd/hsmp: Add /sys/devices/amd_hsmp socket devices Erwan Velu
2026-10-07 12:59 ` [PATCH 3/4] platform/x86/amd/hsmp: Expose socket attributes from the platform driver Erwan Velu
2026-10-07 12:59 ` [PATCH 4/4] platform/x86/amd/hsmp: Add pwr_current_active_freq_limit_source_raw Erwan Velu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261007125908.321186-1-erwanaliasr1@gmail.com \
    --to=erwanaliasr1@gmail.com \
    --cc=carlos.bilbao@kernel.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveenkrishna.chatradhi@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®