From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Muthusamy Ramalingam <Muthusamy.Ramalingam@amd.com>
Cc: platform-driver-x86@vger.kernel.org,
ilpo.jarvinen@linux.intel.com, Suma.Hegde@amd.com,
NaveenKrishna.Chatradhi@amd.com
Subject: Re: [PATCH 19/26] platform/x86/amd/hsmp: Add cclk_floor_limit sysfs file
Date: Mon, 23 Nov 2026 13:56:13 +0200 (EET) [thread overview]
Message-ID: <91521140-c12d-e0f6-9912-859cef4611a4@linux.intel.com> (raw)
In-Reply-To: <48c77463a94a754dc700365f617f79ccbdf5f5fb.1793602633.git.Muthusamy.Ramalingam@amd.com>
On Mon, 2 Nov 2026, Muthusamy Ramalingam wrote:
> Expose HSMP_SET_GET_FLOOR_LIMIT as a write-only socket file on both the
> ACPI and platform drivers. A write uses operation 01 and sets the floor
> for every core on the socket. The frequency is a 16-bit MHz field.
>
> Co-developed-by: Suma Hegde <Suma.Hegde@amd.com>
> Signed-off-by: Suma Hegde <Suma.Hegde@amd.com>
> Signed-off-by: Muthusamy Ramalingam <Muthusamy.Ramalingam@amd.com>
> ---
> Documentation/arch/x86/amd_hsmp.rst | 2 ++
> drivers/platform/x86/amd/hsmp/acpi.c | 3 ++
> drivers/platform/x86/amd/hsmp/plat.c | 3 ++
> drivers/platform/x86/amd/hsmp/sysfs.c | 47 +++++++++++++++++++++++++--
> drivers/platform/x86/amd/hsmp/sysfs.h | 3 ++
> 5 files changed, 56 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/arch/x86/amd_hsmp.rst b/Documentation/arch/x86/amd_hsmp.rst
> index 093468aa52eb2..30401c168c503 100644
> --- a/Documentation/arch/x86/amd_hsmp.rst
> +++ b/Documentation/arch/x86/amd_hsmp.rst
> @@ -189,6 +189,8 @@ write-only when the platform enables only that direction of the message.
> * socket_power_limit_max: Maximum socket power limit in mWatts (read only).
> * cclk_boost_limit: Socket boost limit in MHz (write only). Accepted range
> is 100-10000 MHz.
> +* cclk_floor_limit: Socket floor limit in MHz (write only). A write sets
> + the floor for every core on the socket. It is a 16-bit value.
> * tdelta: Socket thermal behaviour (read only).
> * apb_disable: Read/write. 1 disables APB, 0 enables it.
> * dfc_enable: Read/write DF C-state enable. 1 enables, 0 disables.
> diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c
> index 935cca42b642b..35c2085b67e42 100644
> --- a/drivers/platform/x86/amd/hsmp/acpi.c
> +++ b/drivers/platform/x86/amd/hsmp/acpi.c
> @@ -666,6 +666,8 @@ HSMP_SYS_ATTR(svi3_max_temperature, svi3_max_temperature, 0444,
> HSMP_GET_SVI3_VR_CTRL_TEMP, HSMP_GET_SVI3_VR_CTRL_TEMP);
> HSMP_DEV_ATTR_W(cclk_boost_limit, HSMP_SET_BOOST_LIMIT_SOCKET,
> hsmp_cclk_boost_limit_store, 0200);
> +HSMP_DEV_ATTR_W(cclk_floor_limit, HSMP_SET_GET_FLOOR_LIMIT,
> + hsmp_cclk_floor_limit_store, 0200);
> HSMP_DEV_ATTR_RW(apb_disable, HSMP_SET_DF_PSTATE, HSMP_SET_DF_PSTATE,
> hsmp_apb_disable_show, hsmp_apb_disable_store, 0644);
> HSMP_DEV_ATTR_RW(dfc_enable, HSMP_DFC_ENABLE_CTRL, HSMP_DFC_ENABLE_CTRL,
> @@ -832,6 +834,7 @@ static struct attribute *hsmp_dev_attr_list[] = {
> &hattr_dimm_sb_set.dattr.attr,
> &hattr_socket_power.dattr.attr,
> &hattr_cclk_boost_limit.dattr.attr,
> + &hattr_cclk_floor_limit.dattr.attr,
> &hattr_tdelta.dattr.attr,
> &hattr_apb_disable.dattr.attr,
> &hattr_cc6_enable.dattr.attr,
> diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
> index 2c6d460c56d3a..aedc71027b28c 100644
> --- a/drivers/platform/x86/amd/hsmp/plat.c
> +++ b/drivers/platform/x86/amd/hsmp/plat.c
> @@ -1862,6 +1862,8 @@ HSMP_DEV_ATTR_X8(socket_power, HSMP_GET_SOCKET_POWER, hsmp_msg_resp32_show,
> 0444);
> HSMP_DEV_ATTR_W_X8(cclk_boost_limit, HSMP_SET_BOOST_LIMIT_SOCKET,
> hsmp_cclk_boost_limit_store, 0200);
> +HSMP_DEV_ATTR_W_X8(cclk_floor_limit, HSMP_SET_GET_FLOOR_LIMIT,
> + hsmp_cclk_floor_limit_store, 0200);
> HSMP_DEV_ATTR_X8(tdelta, HSMP_READ_TDELTA, hsmp_msg_resp32_show, 0444);
> HSMP_DEV_ATTR_RW_X8(apb_disable, HSMP_SET_DF_PSTATE, HSMP_SET_DF_PSTATE,
> hsmp_apb_disable_show, hsmp_apb_disable_store, 0644);
> @@ -1906,6 +1908,7 @@ static struct attribute _name[] = { \
> &hattr_dimm_sb_set##_sock_ind.dattr.attr, \
> &hattr_socket_power##_sock_ind.dattr.attr, \
> &hattr_cclk_boost_limit##_sock_ind.dattr.attr, \
> + &hattr_cclk_floor_limit##_sock_ind.dattr.attr, \
> &hattr_tdelta##_sock_ind.dattr.attr, \
> &hattr_apb_disable##_sock_ind.dattr.attr, \
> &hattr_cc6_enable##_sock_ind.dattr.attr, \
> diff --git a/drivers/platform/x86/amd/hsmp/sysfs.c b/drivers/platform/x86/amd/hsmp/sysfs.c
> index 8fe67421ef6fc..8872f63e218df 100644
> --- a/drivers/platform/x86/amd/hsmp/sysfs.c
> +++ b/drivers/platform/x86/amd/hsmp/sysfs.c
> @@ -560,6 +560,48 @@ ssize_t hsmp_cclk_boost_limit_store(struct device *dev,
> return count;
> }
>
> +ssize_t hsmp_cclk_floor_limit_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct hsmp_sys_attr *hattr = to_hsmp_sys_attr(attr);
> + struct hsmp_message msg = {};
> + unsigned long val;
> + int ret;
> +
> + ret = kstrtoul(buf, 10, &val);
> + if (ret) {
> + hsmp_err(dev, "cclk_floor_limit", HSMP_ERR_PARSE, "unit=MHz");
> + return ret;
> + }
> +
> + /*
> + * Op 01 sets the floor for every core on the socket. The frequency
> + * is a 16-bit MHz field. Firmware clamps it to the platform minimum
> + * and maximum, so reject only a field overflow.
> + */
> + if (val > U16_MAX) {
> + hsmp_err(dev, "cclk_floor_limit", HSMP_ERR_RANGE,
> + "got=%lu valid=0-%u unit=MHz", val, U16_MAX);
> + return -EINVAL;
> + }
> +
> + msg.msg_id = HSMP_SET_GET_FLOOR_LIMIT;
> + msg.sock_ind = hsmp_sysfs_sock_ind(dev, hattr);
> + msg.num_args = 1;
> + msg.response_sz = 0;
> + msg.args[0] = BIT(30) | val;
Is this mistyped GET ?
> +
> + ret = hsmp_send_message(&msg);
> + if (ret) {
> + hsmp_err(dev, "cclk_floor_limit", HSMP_ERR_HW,
> + "val=%lu unit=MHz rc=%d", val, ret);
> + return ret;
> + }
> +
> + return count;
> +}
> +
> /* APB disable show function - reads current APB enable/disable status */
> ssize_t hsmp_apb_disable_show(struct device *dev,
> struct device_attribute *attr,
> @@ -1909,8 +1951,9 @@ static struct hsmp_cpu_info *hsmp_cpu_from_kobj(struct kobject *kobj)
> /*
> * HSMP_SET_GET_FLOOR_LIMIT args[0]:
> * op[31:30] + apic id[27:16] + floor frequency MHz[15:0].
> - * op 0 sets the per-core floor, op 2 reads it, op 3 reads the
> - * effective floor. The frequency field is reserved on a get.
> + * op 0 sets the per-core floor, op 1 sets every core on the socket,
> + * op 2 reads the per-core floor, and op 3 reads the effective floor.
> + * The frequency field is reserved on a get.
> */
> static u32 hsmp_floor_arg(u32 op, u32 apic_id, u32 mhz)
> {
> diff --git a/drivers/platform/x86/amd/hsmp/sysfs.h b/drivers/platform/x86/amd/hsmp/sysfs.h
> index 716d9e4493a1b..8d3a9021ef18e 100644
> --- a/drivers/platform/x86/amd/hsmp/sysfs.h
> +++ b/drivers/platform/x86/amd/hsmp/sysfs.h
> @@ -112,6 +112,9 @@ ssize_t hsmp_rail_iso_freq_policy_store(struct device *dev,
> ssize_t hsmp_cclk_boost_limit_store(struct device *dev,
> struct device_attribute *attr,
> const char *buf, size_t count);
> +ssize_t hsmp_cclk_floor_limit_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count);
> ssize_t hsmp_apb_disable_show(struct device *dev, struct device_attribute *attr,
> char *buf);
> ssize_t hsmp_apb_disable_store(struct device *dev, struct device_attribute *attr,
>
--
i.
next prev parent reply other threads:[~2026-11-23 11:56 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 7:18 [PATCH 00/26] platform/x86/amd/hsmp: Extend socket and per-CPU sysfs Muthusamy Ramalingam
2026-11-02 7:18 ` [PATCH 01/26] platform/x86/amd/hsmp: Drop _input from socket sysfs names Muthusamy Ramalingam
2026-11-23 11:36 ` Ilpo Järvinen
2026-11-02 7:19 ` [PATCH 02/26] platform/x86/amd/hsmp: Rename clk_fmax and clk_fmin sysfs files Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 03/26] platform/x86/amd/hsmp: Add hsmp_err helper for parser-friendly store errors Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 04/26] platform/x86/amd/hsmp: Treat socket_power_limit as firmware-clamped Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 05/26] platform/x86/amd/hsmp: Print protocol_version as hexadecimal Muthusamy Ramalingam
2026-11-23 11:06 ` Ilpo Järvinen
2026-11-02 7:19 ` [PATCH 06/26] platform/x86/amd/hsmp: Add sdps_limit sysfs file Muthusamy Ramalingam
2026-11-23 11:15 ` Ilpo Järvinen
2026-11-02 7:19 ` [PATCH 07/26] platform/x86/amd/hsmp: Add df_pstate_range " Muthusamy Ramalingam
2026-11-23 11:32 ` Ilpo Järvinen
2026-11-02 7:19 ` [PATCH 08/26] platform/x86/amd/hsmp: Add xgmi_width " Muthusamy Ramalingam
2026-11-23 11:35 ` Ilpo Järvinen
2026-11-02 7:19 ` [PATCH 09/26] platform/x86/amd/hsmp: Add gmi3_link_width " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 10/26] platform/x86/amd/hsmp: Add pcie_link_rate " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 11/26] platform/x86/amd/hsmp: Add lclk DPM sysfs files Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 12/26] platform/x86/amd/hsmp: Add io_bw and xgmi_bw " Muthusamy Ramalingam
2026-11-23 11:49 ` Ilpo Järvinen
2026-11-02 7:19 ` [PATCH 13/26] platform/x86/amd/hsmp: Add DIMM sideband " Muthusamy Ramalingam
2026-11-23 11:51 ` Ilpo Järvinen
2026-11-02 7:19 ` [PATCH 14/26] platform/x86/amd/hsmp: Add per-CPU floor limit " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 15/26] platform/x86/amd/hsmp: Add metric_version sysfs file Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 16/26] platform/x86/amd/hsmp: Add enabled command sysfs files Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 17/26] platform/x86/amd/hsmp: Add DIMM power and temperature " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 18/26] platform/x86/amd/hsmp: Add SVI3 " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 19/26] platform/x86/amd/hsmp: Add cclk_floor_limit sysfs file Muthusamy Ramalingam
2026-11-23 11:56 ` Ilpo Järvinen [this message]
2026-11-02 7:19 ` [PATCH 20/26] platform/x86/amd/hsmp: Add xgmi_pstate_range " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 21/26] platform/x86/amd/hsmp: Quiet probe-time firmware status dmesg spam Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 22/26] platform/x86/amd/hsmp: Add powereff_mode sysfs file Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 23/26] platform/x86/amd/hsmp: Add svi_power " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 24/26] platform/x86/amd/hsmp: Add per-CPU ccd_power " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 25/26] platform/x86/amd/hsmp: Add per-CPU freq_limit " Muthusamy Ramalingam
2026-11-02 7:19 ` [PATCH 26/26] platform/x86/amd/hsmp: Add socket_temperature " Muthusamy Ramalingam
2026-11-23 11:59 ` [PATCH 00/26] platform/x86/amd/hsmp: Extend socket and per-CPU sysfs Ilpo Järvinen
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=91521140-c12d-e0f6-9912-859cef4611a4@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=Muthusamy.Ramalingam@amd.com \
--cc=NaveenKrishna.Chatradhi@amd.com \
--cc=Suma.Hegde@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 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.