linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] Enhanced autonomous selection and improvements
@ 2025-10-01 15:00 Sumit Gupta
  2025-10-01 15:00 ` [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store Sumit Gupta
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:00 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

This patch series enhances the ACPI CPPC CPUFREQ driver with
comprehensive support for autonomous performance selection, expanded
runtime control interfaces and improvements.

It adds support for below:
- Expose sysfs to read/write the Mininum/Maximum Performance Register
  and update the policy min/max accordingly.
    /sys/.../cpufreq/policy*/min_perf and max_perf

- Expose sysfs to read/write the Performance Limited Register.
    /sys/.../cpufreq/policy*/perf_limited

- When toggling autonomous selection, synchronize the policy limits
  by updating the policy min/max.

- System-wide autonomous mode configuration via 'auto_sel_mode' boot
  parameter. Mode can be switched dynamically on individual CPUs.

- Generic sysfs helper functions to reduce code duplication.

The patches are grouped as below:
- Patch 1, 2 & 3: Improvements. Can be applied independently.
- Patch 4: Sysfs to update min/max_perf. Can be applied independently.
- Patch 5: Sysfs to update perf_limited. Can be applied independently.
- Patch 6: add syfs documentation. Depends on 'Patch 4 and 5'.
- Patch 7: sync policy min/max with auto_select. Depends on 'Patch 4'.
- Patch 8: Boot Parameter Support. Depends on 'Patch 4 and 7'.

---
v2[2] -> v3:
- drop changes to rename exisiting APIs.
- add new 'patch 1' with generic helpers for sysfs show/store.
- used guard(mutex)() in place of mutex_lock/unlock.
- update kernel-parameters text to 'enable if supported by hardware'.
- disable auto_sel for all cpus if one fails in auto_sel_mode.
- use min/max_perf values if set from bootloader.
- general code improvements, error handling and reduced redundancies.

v1[1] -> v2:
- Move CPC register set sysfs from acpi_cppc to cpufreq directory.
- No sysfs to set auto_sel and epp. They were merged from diff series.
- Remove 'cppc_cpufreq_epp' instance of the 'cppc_cpufreq' driver.
- Synchronize perf_min/max with policy min/max.
- Update policy min/max Toggling auto_select.
- add sysfs to update the perf_limited register.

Sumit Gupta (8):
  cpufreq: CPPC: Add generic helpers for sysfs show/store
  ACPI: CPPC: Add cppc_get_perf() API to read performance controls
  ACPI: CPPC: extend APIs to support auto_sel and epp
  ACPI: CPPC: add APIs and sysfs interface for min/max_perf
  ACPI: CPPC: add APIs and sysfs interface for perf_limited register
  cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  cpufreq: CPPC: update policy min/max when toggling auto_select
  cpufreq: CPPC: add autonomous mode boot parameter support

 .../ABI/testing/sysfs-devices-system-cpu      |  43 ++
 .../admin-guide/kernel-parameters.txt         |  12 +
 drivers/acpi/cppc_acpi.c                      | 184 +++++++-
 drivers/cpufreq/cppc_cpufreq.c                | 392 ++++++++++++++++--
 include/acpi/cppc_acpi.h                      |  39 +-
 5 files changed, 629 insertions(+), 41 deletions(-)

[1] https://lore.kernel.org/lkml/20250211103737.447704-1-sumitg@nvidia.com/
[2] https://lore.kernel.org/lkml/20250823200121.1320197-1-sumitg@nvidia.com/

-- 
2.34.1


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

* [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
@ 2025-10-01 15:00 ` Sumit Gupta
  2025-10-10  3:24   ` Jie Zhan
  2025-10-01 15:00 ` [PATCH v3 2/8] ACPI: CPPC: Add cppc_get_perf() API to read performance controls Sumit Gupta
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:00 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

Add generic show/store helper functions for u64 sysfs attributes:
- cppc_cpufreq_sysfs_show_u64()
- cppc_cpufreq_sysfs_store_u64()

Refactor auto_act_window and energy_performance_preference_val
attributes to use these helpers, eliminating code duplication.

No functional changes.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 87 ++++++++++++++--------------------
 1 file changed, 35 insertions(+), 52 deletions(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 12de0ac7bbaf..732f35096991 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -781,6 +781,36 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state)
 	return 0;
 }
 
+static ssize_t cppc_cpufreq_sysfs_show_u64(unsigned int cpu, int (*get_func)(int, u64 *), char *buf)
+{
+	u64 val;
+	int ret = get_func(cpu, &val);
+
+	if (ret == -EOPNOTSUPP)
+		return sysfs_emit(buf, "<unsupported>\n");
+	if (ret)
+		return ret;
+
+	return sysfs_emit(buf, "%llu\n", val);
+}
+
+static ssize_t cppc_cpufreq_sysfs_store_u64(const char *buf, size_t count,
+					    int (*set_func)(int, u64), unsigned int cpu)
+{
+	u64 val;
+	int ret;
+
+	if (!buf || !set_func)
+		return -EINVAL;
+
+	ret = kstrtou64(buf, 0, &val);
+	if (ret)
+		return ret;
+
+	ret = set_func((int)cpu, val);
+	return ret ? ret : count;
+}
+
 static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf)
 {
 	struct cppc_cpudata *cpu_data = policy->driver_data;
@@ -824,70 +854,23 @@ static ssize_t store_auto_select(struct cpufreq_policy *policy,
 
 static ssize_t show_auto_act_window(struct cpufreq_policy *policy, char *buf)
 {
-	u64 val;
-	int ret;
-
-	ret = cppc_get_auto_act_window(policy->cpu, &val);
-
-	/* show "<unsupported>" when this register is not supported by cpc */
-	if (ret == -EOPNOTSUPP)
-		return sysfs_emit(buf, "<unsupported>\n");
-
-	if (ret)
-		return ret;
-
-	return sysfs_emit(buf, "%llu\n", val);
+	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_auto_act_window, buf);
 }
 
-static ssize_t store_auto_act_window(struct cpufreq_policy *policy,
-				     const char *buf, size_t count)
+static ssize_t store_auto_act_window(struct cpufreq_policy *policy, const char *buf, size_t count)
 {
-	u64 usec;
-	int ret;
-
-	ret = kstrtou64(buf, 0, &usec);
-	if (ret)
-		return ret;
-
-	ret = cppc_set_auto_act_window(policy->cpu, usec);
-	if (ret)
-		return ret;
-
-	return count;
+	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_auto_act_window, policy->cpu);
 }
 
 static ssize_t show_energy_performance_preference_val(struct cpufreq_policy *policy, char *buf)
 {
-	u64 val;
-	int ret;
-
-	ret = cppc_get_epp_perf(policy->cpu, &val);
-
-	/* show "<unsupported>" when this register is not supported by cpc */
-	if (ret == -EOPNOTSUPP)
-		return sysfs_emit(buf, "<unsupported>\n");
-
-	if (ret)
-		return ret;
-
-	return sysfs_emit(buf, "%llu\n", val);
+	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_epp_perf, buf);
 }
 
 static ssize_t store_energy_performance_preference_val(struct cpufreq_policy *policy,
 						       const char *buf, size_t count)
 {
-	u64 val;
-	int ret;
-
-	ret = kstrtou64(buf, 0, &val);
-	if (ret)
-		return ret;
-
-	ret = cppc_set_epp(policy->cpu, val);
-	if (ret)
-		return ret;
-
-	return count;
+	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_epp, policy->cpu);
 }
 
 cpufreq_freq_attr_ro(freqdomain_cpus);
-- 
2.34.1


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

* [PATCH v3 2/8] ACPI: CPPC: Add cppc_get_perf() API to read performance controls
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
  2025-10-01 15:00 ` [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store Sumit Gupta
@ 2025-10-01 15:00 ` Sumit Gupta
  2025-10-01 15:00 ` [PATCH v3 3/8] ACPI: CPPC: extend APIs to support auto_sel and epp Sumit Gupta
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:00 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

Add cppc_get_perf() function to read values of performance control
registers including desired_perf, min_perf, max_perf, and energy_perf.

This provides a read interface to complement the existing cppc_set_perf()
write interface for performance control registers.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 drivers/acpi/cppc_acpi.c | 73 ++++++++++++++++++++++++++++++++++++++++
 include/acpi/cppc_acpi.h |  5 +++
 2 files changed, 78 insertions(+)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 6b649031808f..ab8dd5cdb13b 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -1731,6 +1731,79 @@ int cppc_set_enable(int cpu, bool enable)
 	return cppc_set_reg_val(cpu, ENABLE, enable);
 }
 EXPORT_SYMBOL_GPL(cppc_set_enable);
+/**
+ * cppc_get_perf - Get a CPU's performance controls.
+ * @cpu: CPU for which to get performance controls.
+ * @perf_ctrls: ptr to cppc_perf_ctrls. See cppc_acpi.h
+ *
+ * Return: 0 for success with perf_ctrls, -ERRNO otherwise.
+ */
+int cppc_get_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
+{
+	struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpu);
+	struct cpc_register_resource *desired_perf_reg, *min_perf_reg, *max_perf_reg,
+				     *energy_perf_reg;
+	u64 desired_perf = 0, min = 0, max = 0, energy_perf = 0;
+	int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
+	struct cppc_pcc_data *pcc_ss_data = NULL;
+	int ret = 0, regs_in_pcc = 0;
+
+	if (!cpc_desc) {
+		pr_debug("No CPC descriptor for CPU:%d\n", cpu);
+		return -ENODEV;
+	}
+
+	if (!perf_ctrls) {
+		pr_debug("Invalid perf_ctrls pointer\n");
+		return -EINVAL;
+	}
+
+	desired_perf_reg = &cpc_desc->cpc_regs[DESIRED_PERF];
+	min_perf_reg = &cpc_desc->cpc_regs[MIN_PERF];
+	max_perf_reg = &cpc_desc->cpc_regs[MAX_PERF];
+	energy_perf_reg = &cpc_desc->cpc_regs[ENERGY_PERF];
+
+	/* Are any of the regs PCC ?*/
+	if (CPC_IN_PCC(desired_perf_reg) || CPC_IN_PCC(min_perf_reg) ||
+	    CPC_IN_PCC(max_perf_reg) || CPC_IN_PCC(energy_perf_reg)) {
+		if (pcc_ss_id < 0) {
+			pr_debug("Invalid pcc_ss_id for CPU:%d\n", cpu);
+			return -ENODEV;
+		}
+		pcc_ss_data = pcc_data[pcc_ss_id];
+		regs_in_pcc = 1;
+		down_write(&pcc_ss_data->pcc_lock);
+		/* Ring doorbell once to update PCC subspace */
+		if (send_pcc_cmd(pcc_ss_id, CMD_READ) < 0) {
+			pr_debug("Failed to send PCC command for CPU:%d, ret:%d\n", cpu, ret);
+			ret = -EIO;
+			goto out_err;
+		}
+	}
+
+	/* Read optional elements if present */
+	if (CPC_SUPPORTED(max_perf_reg))
+		cpc_read(cpu, max_perf_reg, &max);
+	perf_ctrls->max_perf = max;
+
+	if (CPC_SUPPORTED(min_perf_reg))
+		cpc_read(cpu, min_perf_reg, &min);
+	perf_ctrls->min_perf = min;
+
+	if (CPC_SUPPORTED(desired_perf_reg))
+		cpc_read(cpu, desired_perf_reg, &desired_perf);
+	perf_ctrls->desired_perf = desired_perf;
+
+	if (CPC_SUPPORTED(energy_perf_reg))
+		cpc_read(cpu, energy_perf_reg, &energy_perf);
+	perf_ctrls->energy_perf = energy_perf;
+
+out_err:
+	if (regs_in_pcc)
+		up_write(&pcc_ss_data->pcc_lock);
+	return ret;
+}
+EXPORT_SYMBOL_GPL(cppc_get_perf);
 
 /**
  * cppc_set_perf - Set a CPU's performance controls.
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index 20f3d62e7a16..213bd389ec57 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -151,6 +151,7 @@ extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf);
 extern int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf);
 extern int cppc_get_highest_perf(int cpunum, u64 *highest_perf);
 extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs);
+extern int cppc_get_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
 extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
 extern int cppc_set_enable(int cpu, bool enable);
 extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
@@ -192,6 +193,10 @@ static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_
 {
 	return -EOPNOTSUPP;
 }
+static inline int cppc_get_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
+{
+	return -EOPNOTSUPP;
+}
 static inline int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
 {
 	return -EOPNOTSUPP;
-- 
2.34.1


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

* [PATCH v3 3/8] ACPI: CPPC: extend APIs to support auto_sel and epp
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
  2025-10-01 15:00 ` [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store Sumit Gupta
  2025-10-01 15:00 ` [PATCH v3 2/8] ACPI: CPPC: Add cppc_get_perf() API to read performance controls Sumit Gupta
@ 2025-10-01 15:00 ` Sumit Gupta
  2025-10-22  9:12   ` Ionela Voinescu
  2025-10-01 15:01 ` [PATCH v3 4/8] ACPI: CPPC: add APIs and sysfs interface for min/max_perf Sumit Gupta
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:00 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

- Add auto_sel read support in cppc_get_perf_caps().
- Add write of both auto_sel and energy_perf in cppc_set_epp_perf().
- Remove redundant energy_perf field from 'struct cppc_perf_caps' as
  the same is available in 'struct cppc_perf_ctrls' which is used.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 drivers/acpi/cppc_acpi.c | 30 ++++++++++++++++++++++++++----
 include/acpi/cppc_acpi.h |  1 -
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index ab8dd5cdb13b..12b2516b971c 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -1344,8 +1344,8 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps)
 	struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum);
 	struct cpc_register_resource *highest_reg, *lowest_reg,
 		*lowest_non_linear_reg, *nominal_reg, *guaranteed_reg,
-		*low_freq_reg = NULL, *nom_freq_reg = NULL;
-	u64 high, low, guaranteed, nom, min_nonlinear, low_f = 0, nom_f = 0;
+		*low_freq_reg = NULL, *nom_freq_reg = NULL, *auto_sel_reg = NULL;
+	u64 high, low, guaranteed, nom, min_nonlinear, low_f = 0, nom_f = 0, auto_sel = 0;
 	int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum);
 	struct cppc_pcc_data *pcc_ss_data = NULL;
 	int ret = 0, regs_in_pcc = 0;
@@ -1362,11 +1362,12 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps)
 	low_freq_reg = &cpc_desc->cpc_regs[LOWEST_FREQ];
 	nom_freq_reg = &cpc_desc->cpc_regs[NOMINAL_FREQ];
 	guaranteed_reg = &cpc_desc->cpc_regs[GUARANTEED_PERF];
+	auto_sel_reg = &cpc_desc->cpc_regs[AUTO_SEL_ENABLE];
 
 	/* Are any of the regs PCC ?*/
 	if (CPC_IN_PCC(highest_reg) || CPC_IN_PCC(lowest_reg) ||
 		CPC_IN_PCC(lowest_non_linear_reg) || CPC_IN_PCC(nominal_reg) ||
-		CPC_IN_PCC(low_freq_reg) || CPC_IN_PCC(nom_freq_reg)) {
+		CPC_IN_PCC(low_freq_reg) || CPC_IN_PCC(nom_freq_reg) || CPC_IN_PCC(auto_sel_reg)) {
 		if (pcc_ss_id < 0) {
 			pr_debug("Invalid pcc_ss_id\n");
 			return -ENODEV;
@@ -1414,6 +1415,9 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps)
 	perf_caps->lowest_freq = low_f;
 	perf_caps->nominal_freq = nom_f;
 
+	if (CPC_SUPPORTED(auto_sel_reg))
+		cpc_read(cpunum, auto_sel_reg, &auto_sel);
+	perf_caps->auto_sel = (bool)auto_sel;
 
 out_err:
 	if (regs_in_pcc)
@@ -1555,6 +1559,8 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
 	struct cpc_register_resource *auto_sel_reg;
 	struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpu);
 	struct cppc_pcc_data *pcc_ss_data = NULL;
+	bool autosel_support_in_ffh_or_sysmem;
+	bool epp_support_in_ffh_or_sysmem;
 	int ret;
 
 	if (!cpc_desc) {
@@ -1565,6 +1571,11 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
 	auto_sel_reg = &cpc_desc->cpc_regs[AUTO_SEL_ENABLE];
 	epp_set_reg = &cpc_desc->cpc_regs[ENERGY_PERF];
 
+	epp_support_in_ffh_or_sysmem = CPC_SUPPORTED(epp_set_reg) &&
+				(CPC_IN_FFH(epp_set_reg) || CPC_IN_SYSTEM_MEMORY(epp_set_reg));
+	autosel_support_in_ffh_or_sysmem = CPC_SUPPORTED(auto_sel_reg) &&
+				(CPC_IN_FFH(auto_sel_reg) || CPC_IN_SYSTEM_MEMORY(auto_sel_reg));
+
 	if (CPC_IN_PCC(epp_set_reg) || CPC_IN_PCC(auto_sel_reg)) {
 		if (pcc_ss_id < 0) {
 			pr_debug("Invalid pcc_ss_id for CPU:%d\n", cpu);
@@ -1590,8 +1601,19 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
 		ret = send_pcc_cmd(pcc_ss_id, CMD_WRITE);
 		up_write(&pcc_ss_data->pcc_lock);
 	} else if (osc_cpc_flexible_adr_space_confirmed &&
-		   CPC_SUPPORTED(epp_set_reg) && CPC_IN_FFH(epp_set_reg)) {
+		   epp_support_in_ffh_or_sysmem && autosel_support_in_ffh_or_sysmem) {
+		ret = cpc_write(cpu, auto_sel_reg, enable);
+		if (ret) {
+			pr_debug("Failed to write auto_sel=%d for CPU:%d\n", enable, cpu);
+			return ret;
+		}
+
 		ret = cpc_write(cpu, epp_set_reg, perf_ctrls->energy_perf);
+		if (ret) {
+			pr_debug("Failed to write energy_perf=%u for CPU:%d\n",
+				 perf_ctrls->energy_perf, cpu);
+			return ret;
+		}
 	} else {
 		ret = -ENOTSUPP;
 		pr_debug("_CPC in PCC and _CPC in FFH are not supported\n");
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index 213bd389ec57..3babc6d6e70a 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -119,7 +119,6 @@ struct cppc_perf_caps {
 	u32 lowest_nonlinear_perf;
 	u32 lowest_freq;
 	u32 nominal_freq;
-	u32 energy_perf;
 	bool auto_sel;
 };
 
-- 
2.34.1


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

* [PATCH v3 4/8] ACPI: CPPC: add APIs and sysfs interface for min/max_perf
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
                   ` (2 preceding siblings ...)
  2025-10-01 15:00 ` [PATCH v3 3/8] ACPI: CPPC: extend APIs to support auto_sel and epp Sumit Gupta
@ 2025-10-01 15:01 ` Sumit Gupta
  2025-10-22 10:58   ` Ionela Voinescu
  2025-10-01 15:01 ` [PATCH v3 5/8] ACPI: CPPC: add APIs and sysfs interface for perf_limited register Sumit Gupta
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:01 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

CPPC allows platforms to specify minimum and maximum performance
limits that constrain the operating range for CPU performance scaling
when Autonomous Selection is enabled. These limits can be dynamically
adjusted to implement power management policies or workload-specific
optimizations.

Add cppc_get_min_perf() and cppc_set_min_perf() functions to read and
write the MIN_PERF register, allowing dynamic adjustment of the minimum
performance floor.

Add cppc_get_max_perf() and cppc_set_max_perf() functions to read and
write the MAX_PERF register, enabling dynamic ceiling control for
maximum performance.

Expose these capabilities through cpufreq sysfs attributes:
- /sys/.../cpufreq/policy*/min_perf: Read/write min performance limit
- /sys/.../cpufreq/policy*/max_perf: Read/write max performance limit

Also update EPP constants for better clarity:
- Rename CPPC_ENERGY_PERF_MAX to CPPC_EPP_ENERGY_EFFICIENCY_PREF
- Add CPPC_EPP_PERFORMANCE_PREF for the performance-oriented setting

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 drivers/acpi/cppc_acpi.c       |  55 +++++++++++++++-
 drivers/cpufreq/cppc_cpufreq.c | 115 +++++++++++++++++++++++++++++++++
 include/acpi/cppc_acpi.h       |  23 ++++++-
 3 files changed, 191 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 12b2516b971c..d47aec2aed13 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -1630,7 +1630,7 @@ EXPORT_SYMBOL_GPL(cppc_set_epp_perf);
  */
 int cppc_set_epp(int cpu, u64 epp_val)
 {
-	if (epp_val > CPPC_ENERGY_PERF_MAX)
+	if (epp_val > CPPC_EPP_ENERGY_EFFICIENCY_PREF)
 		return -EINVAL;
 
 	return cppc_set_reg_val(cpu, ENERGY_PERF, epp_val);
@@ -1753,6 +1753,59 @@ int cppc_set_enable(int cpu, bool enable)
 	return cppc_set_reg_val(cpu, ENABLE, enable);
 }
 EXPORT_SYMBOL_GPL(cppc_set_enable);
+
+/**
+ * cppc_get_min_perf - Get the min performance register value.
+ * @cpu: CPU from which to get min performance.
+ * @min_perf: Return address.
+ *
+ * Return: 0 for success, -EIO on register access failure, -EOPNOTSUPP if not supported.
+ */
+int cppc_get_min_perf(int cpu, u64 *min_perf)
+{
+	return cppc_get_reg_val(cpu, MIN_PERF, min_perf);
+}
+EXPORT_SYMBOL_GPL(cppc_get_min_perf);
+
+/**
+ * cppc_set_min_perf() - Write the min performance register.
+ * @cpu: CPU on which to write register.
+ * @min_perf: Value to write to the MIN_PERF register.
+ *
+ * Return: 0 for success, -EIO otherwise.
+ */
+int cppc_set_min_perf(int cpu, u64 min_perf)
+{
+	return cppc_set_reg_val(cpu, MIN_PERF, min_perf);
+}
+EXPORT_SYMBOL_GPL(cppc_set_min_perf);
+
+/**
+ * cppc_get_max_perf - Get the max performance register value.
+ * @cpu: CPU from which to get max performance.
+ * @max_perf: Return address.
+ *
+ * Return: 0 for success, -EIO on register access failure, -EOPNOTSUPP if not supported.
+ */
+int cppc_get_max_perf(int cpu, u64 *max_perf)
+{
+	return cppc_get_reg_val(cpu, MAX_PERF, max_perf);
+}
+EXPORT_SYMBOL_GPL(cppc_get_max_perf);
+
+/**
+ * cppc_set_max_perf() - Write the max performance register.
+ * @cpu: CPU on which to write register.
+ * @max_perf: Value to write to the MAX_PERF register.
+ *
+ * Return: 0 for success, -EIO otherwise.
+ */
+int cppc_set_max_perf(int cpu, u64 max_perf)
+{
+	return cppc_set_reg_val(cpu, MAX_PERF, max_perf);
+}
+EXPORT_SYMBOL_GPL(cppc_set_max_perf);
+
 /**
  * cppc_get_perf - Get a CPU's performance controls.
  * @cpu: CPU for which to get performance controls.
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 732f35096991..864978674efc 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -23,6 +23,7 @@
 #include <uapi/linux/sched/types.h>
 
 #include <linux/unaligned.h>
+#include <linux/cleanup.h>
 
 #include <acpi/cppc_acpi.h>
 
@@ -38,6 +39,8 @@ static enum {
 module_param(fie_disabled, int, 0444);
 MODULE_PARM_DESC(fie_disabled, "Disable Frequency Invariance Engine (FIE)");
 
+static DEFINE_MUTEX(cppc_cpufreq_update_autosel_config_lock);
+
 /* Frequency invariance support */
 struct cppc_freq_invariance {
 	int cpu;
@@ -572,6 +575,70 @@ static void cppc_cpufreq_put_cpu_data(struct cpufreq_policy *policy)
 	policy->driver_data = NULL;
 }
 
+/**
+ * cppc_cpufreq_set_mperf_limit - Generic function to set min/max performance limit
+ * @policy: cpufreq policy
+ * @val: performance value to set
+ * @update_reg: whether to update hardware register
+ * @update_policy: whether to update policy constraints
+ * @is_min: true for min_perf, false for max_perf
+ */
+static int cppc_cpufreq_set_mperf_limit(struct cpufreq_policy *policy, u64 val,
+					bool update_reg, bool update_policy, bool is_min)
+{
+	struct cppc_cpudata *cpu_data = policy->driver_data;
+	struct cppc_perf_caps *caps = &cpu_data->perf_caps;
+	unsigned int cpu = policy->cpu;
+	struct freq_qos_request *req;
+	unsigned int freq;
+	u32 perf;
+	int ret;
+
+	perf = clamp(val, caps->lowest_perf, caps->highest_perf);
+	freq = cppc_perf_to_khz(caps, perf);
+
+	pr_debug("cpu%d, %s_perf:%llu, update_reg:%d, update_policy:%d\n", cpu,
+		 is_min ? "min" : "max", (u64)perf, update_reg, update_policy);
+
+	guard(mutex)(&cppc_cpufreq_update_autosel_config_lock);
+
+	if (update_reg) {
+		ret = is_min ? cppc_set_min_perf(cpu, perf) : cppc_set_max_perf(cpu, perf);
+		if (ret == -EOPNOTSUPP)
+			return 0;
+		if (ret) {
+			pr_warn("Failed to set %s_perf (%llu) on CPU%d (%d)\n",
+				is_min ? "min" : "max", (u64)perf, cpu, ret);
+			return ret;
+		}
+
+		/* Update cached value only on success */
+		if (is_min)
+			cpu_data->perf_ctrls.min_perf = perf;
+		else
+			cpu_data->perf_ctrls.max_perf = perf;
+	}
+
+	if (update_policy) {
+		req = is_min ? policy->min_freq_req : policy->max_freq_req;
+
+		ret = freq_qos_update_request(req, freq);
+		if (ret < 0) {
+			pr_warn("Failed to update %s_freq constraint for CPU%d: %d\n",
+				is_min ? "min" : "max", cpu, ret);
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
+#define cppc_cpufreq_set_min_perf(policy, val, update_reg, update_policy) \
+	cppc_cpufreq_set_mperf_limit(policy, val, update_reg, update_policy, true)
+
+#define cppc_cpufreq_set_max_perf(policy, val, update_reg, update_policy) \
+	cppc_cpufreq_set_mperf_limit(policy, val, update_reg, update_policy, false)
+
 static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	unsigned int cpu = policy->cpu;
@@ -873,16 +940,64 @@ static ssize_t store_energy_performance_preference_val(struct cpufreq_policy *po
 	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_epp, policy->cpu);
 }
 
+static ssize_t show_min_perf(struct cpufreq_policy *policy, char *buf)
+{
+	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_min_perf, buf);
+}
+
+static ssize_t store_min_perf(struct cpufreq_policy *policy, const char *buf, size_t count)
+{
+	struct cppc_cpudata *cpu_data = policy->driver_data;
+	u64 val;
+	int ret;
+
+	ret = kstrtou64(buf, 0, &val);
+	if (ret)
+		return ret;
+
+	ret = cppc_cpufreq_set_min_perf(policy, val, true, cpu_data->perf_caps.auto_sel);
+	if (ret)
+		return ret;
+
+	return count;
+}
+
+static ssize_t show_max_perf(struct cpufreq_policy *policy, char *buf)
+{
+	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_max_perf, buf);
+}
+
+static ssize_t store_max_perf(struct cpufreq_policy *policy, const char *buf, size_t count)
+{
+	struct cppc_cpudata *cpu_data = policy->driver_data;
+	u64 val;
+	int ret;
+
+	ret = kstrtou64(buf, 0, &val);
+	if (ret)
+		return ret;
+
+	ret = cppc_cpufreq_set_max_perf(policy, val, true, cpu_data->perf_caps.auto_sel);
+	if (ret)
+		return ret;
+
+	return count;
+}
+
 cpufreq_freq_attr_ro(freqdomain_cpus);
 cpufreq_freq_attr_rw(auto_select);
 cpufreq_freq_attr_rw(auto_act_window);
 cpufreq_freq_attr_rw(energy_performance_preference_val);
+cpufreq_freq_attr_rw(min_perf);
+cpufreq_freq_attr_rw(max_perf);
 
 static struct freq_attr *cppc_cpufreq_attr[] = {
 	&freqdomain_cpus,
 	&auto_select,
 	&auto_act_window,
 	&energy_performance_preference_val,
+	&min_perf,
+	&max_perf,
 	NULL,
 };
 
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index 3babc6d6e70a..fc7614eb9dcb 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -39,7 +39,8 @@
 /* CPPC_AUTO_ACT_WINDOW_MAX_SIG is 127, so 128 and 129 will decay to 127 when writing */
 #define CPPC_AUTO_ACT_WINDOW_SIG_CARRY_THRESH 129
 
-#define CPPC_ENERGY_PERF_MAX	(0xFF)
+#define CPPC_EPP_PERFORMANCE_PREF		0x00
+#define CPPC_EPP_ENERGY_EFFICIENCY_PREF		0xFF
 
 /* Each register has the folowing format. */
 struct cpc_reg {
@@ -172,6 +173,10 @@ extern int cppc_get_auto_act_window(int cpu, u64 *auto_act_window);
 extern int cppc_set_auto_act_window(int cpu, u64 auto_act_window);
 extern int cppc_get_auto_sel(int cpu, bool *enable);
 extern int cppc_set_auto_sel(int cpu, bool enable);
+extern int cppc_get_min_perf(int cpu, u64 *min_perf);
+extern int cppc_set_min_perf(int cpu, u64 min_perf);
+extern int cppc_get_max_perf(int cpu, u64 *max_perf);
+extern int cppc_set_max_perf(int cpu, u64 max_perf);
 extern int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf);
 extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator);
 extern int amd_detect_prefcore(bool *detected);
@@ -264,6 +269,22 @@ static inline int cppc_set_auto_sel(int cpu, bool enable)
 {
 	return -EOPNOTSUPP;
 }
+static inline int cppc_get_min_perf(int cpu, u64 *min_perf)
+{
+	return -EOPNOTSUPP;
+}
+static inline int cppc_set_min_perf(int cpu, u64 min_perf)
+{
+	return -EOPNOTSUPP;
+}
+static inline int cppc_get_max_perf(int cpu, u64 *max_perf)
+{
+	return -EOPNOTSUPP;
+}
+static inline int cppc_set_max_perf(int cpu, u64 max_perf)
+{
+	return -EOPNOTSUPP;
+}
 static inline int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf)
 {
 	return -ENODEV;
-- 
2.34.1


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

* [PATCH v3 5/8] ACPI: CPPC: add APIs and sysfs interface for perf_limited register
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
                   ` (3 preceding siblings ...)
  2025-10-01 15:01 ` [PATCH v3 4/8] ACPI: CPPC: add APIs and sysfs interface for min/max_perf Sumit Gupta
@ 2025-10-01 15:01 ` Sumit Gupta
  2025-10-01 15:01 ` [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited Sumit Gupta
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:01 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

Add sysfs interface to read/write the Performance Limited register.

The Performance Limited register indicates to the OS that an
unpredictable event (like thermal throttling) has limited processor
performance. This register is sticky and remains set until reset or
OS clears it by writing 0.

The interface is exposed as:
 /sys/devices/system/cpu/cpuX/cpufreq/perf_limited

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 drivers/acpi/cppc_acpi.c       | 26 ++++++++++++++++++++++++++
 drivers/cpufreq/cppc_cpufreq.c | 12 ++++++++++++
 include/acpi/cppc_acpi.h       | 10 ++++++++++
 3 files changed, 48 insertions(+)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index d47aec2aed13..ce99c3f3ae85 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -1806,6 +1806,32 @@ int cppc_set_max_perf(int cpu, u64 max_perf)
 }
 EXPORT_SYMBOL_GPL(cppc_set_max_perf);
 
+/**
+ * cppc_get_perf_limited - Get the Performance Limited register value.
+ * @cpu: CPU from which to get Performance Limited register.
+ * @perf_limited: Pointer to store the Performance Limited value.
+ *
+ * Return: 0 for success, -EIO on register access failure, -EOPNOTSUPP if not supported.
+ */
+int cppc_get_perf_limited(int cpu, u64 *perf_limited)
+{
+	return cppc_get_reg_val(cpu, PERF_LIMITED, perf_limited);
+}
+EXPORT_SYMBOL_GPL(cppc_get_perf_limited);
+
+/**
+ * cppc_set_perf_limited() - Write the Performance Limited register.
+ * @cpu: CPU on which to write register.
+ * @perf_limited: Value to write to the perf_limited register.
+ *
+ * Return: 0 for success, -EIO on register access failure, -EOPNOTSUPP if not supported.
+ */
+int cppc_set_perf_limited(int cpu, u64 perf_limited)
+{
+	return cppc_set_reg_val(cpu, PERF_LIMITED, perf_limited);
+}
+EXPORT_SYMBOL_GPL(cppc_set_perf_limited);
+
 /**
  * cppc_get_perf - Get a CPU's performance controls.
  * @cpu: CPU for which to get performance controls.
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 864978674efc..9946adfeeee4 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -984,12 +984,23 @@ static ssize_t store_max_perf(struct cpufreq_policy *policy, const char *buf, si
 	return count;
 }
 
+static ssize_t show_perf_limited(struct cpufreq_policy *policy, char *buf)
+{
+	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_perf_limited, buf);
+}
+
+static ssize_t store_perf_limited(struct cpufreq_policy *policy, const char *buf, size_t count)
+{
+	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_perf_limited, policy->cpu);
+}
+
 cpufreq_freq_attr_ro(freqdomain_cpus);
 cpufreq_freq_attr_rw(auto_select);
 cpufreq_freq_attr_rw(auto_act_window);
 cpufreq_freq_attr_rw(energy_performance_preference_val);
 cpufreq_freq_attr_rw(min_perf);
 cpufreq_freq_attr_rw(max_perf);
+cpufreq_freq_attr_rw(perf_limited);
 
 static struct freq_attr *cppc_cpufreq_attr[] = {
 	&freqdomain_cpus,
@@ -998,6 +1009,7 @@ static struct freq_attr *cppc_cpufreq_attr[] = {
 	&energy_performance_preference_val,
 	&min_perf,
 	&max_perf,
+	&perf_limited,
 	NULL,
 };
 
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index fc7614eb9dcb..9fc28fb1890b 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -177,6 +177,8 @@ extern int cppc_get_min_perf(int cpu, u64 *min_perf);
 extern int cppc_set_min_perf(int cpu, u64 min_perf);
 extern int cppc_get_max_perf(int cpu, u64 *max_perf);
 extern int cppc_set_max_perf(int cpu, u64 max_perf);
+extern int cppc_get_perf_limited(int cpu, u64 *perf_limited);
+extern int cppc_set_perf_limited(int cpu, u64 perf_limited);
 extern int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf);
 extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator);
 extern int amd_detect_prefcore(bool *detected);
@@ -285,6 +287,14 @@ static inline int cppc_set_max_perf(int cpu, u64 max_perf)
 {
 	return -EOPNOTSUPP;
 }
+static inline int cppc_get_perf_limited(int cpu, u64 *perf_limited)
+{
+	return -EOPNOTSUPP;
+}
+static inline int cppc_set_perf_limited(int cpu, u64 perf_limited)
+{
+	return -EOPNOTSUPP;
+}
 static inline int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf)
 {
 	return -ENODEV;
-- 
2.34.1


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

* [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
                   ` (4 preceding siblings ...)
  2025-10-01 15:01 ` [PATCH v3 5/8] ACPI: CPPC: add APIs and sysfs interface for perf_limited register Sumit Gupta
@ 2025-10-01 15:01 ` Sumit Gupta
  2025-10-01 17:03   ` Mario Limonciello
                     ` (2 more replies)
  2025-10-01 15:01 ` [PATCH v3 7/8] cpufreq: CPPC: update policy min/max when toggling auto_select Sumit Gupta
  2025-10-01 15:01 ` [PATCH v3 8/8] cpufreq: CPPC: add autonomous mode boot parameter support Sumit Gupta
  7 siblings, 3 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:01 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

Add sysfs interfaces for Minimum Performance, Maximum Performance
and Performance Limited Register in the cppc_cpufreq driver.

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 .../ABI/testing/sysfs-devices-system-cpu      | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
index ab8cd337f43a..82141b45d58c 100644
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -327,6 +327,49 @@ Description:	Energy performance preference
 
 		This file is only present if the cppc-cpufreq driver is in use.
 
+What:		/sys/devices/system/cpu/cpuX/cpufreq/min_perf
+Date:		September 2025
+Contact:	linux-pm@vger.kernel.org
+Description:	Minimum Performance
+
+		Read/write a 32 bits value from/to this file. This file
+		conveys the minimum performance level at which the platform
+		may run. Minimum performance may be set to any performance
+		value in the range [Lowest Performance, Highest Performance],
+		inclusive but must be set to a value that is less than or
+		equal to that specified by the Maximum Performance Register.
+
+		Writing to this file only has meaning when Autonomous Selection
+		is enabled.
+
+		This file is only present if the cppc-cpufreq driver is in use.
+
+What:		/sys/devices/system/cpu/cpuX/cpufreq/max_perf
+Date:		September 2025
+Contact:	linux-pm@vger.kernel.org
+Description:	Minimum Performance
+
+		Read/write a 32 bits value from/to this file. This file conveys
+		the maximum performance level at which the platform may run.
+		Maximum performance may be set to any performance value in the
+		range [Lowest Performance, Highest Performance], inclusive.
+
+		Writing to this file only has meaning when Autonomous Selection is
+		enabled.
+
+		This file is only present if the cppc-cpufreq driver is in use.
+
+What:		/sys/devices/system/cpu/cpuX/cpufreq/perf_limited
+Date:		September 2025
+Contact:	linux-pm@vger.kernel.org
+Description:	Minimum Performance
+
+		Read/write a 32 bits value from/to this file. This file indicates
+		to OSPM that an unpredictable event has limited processor
+		performance, and the delivered performance may be less than
+		desired/minimum performance.
+
+		This file is only present if the cppc-cpufreq driver is in use.
 
 What:		/sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
 Date:		August 2008
-- 
2.34.1


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

* [PATCH v3 7/8] cpufreq: CPPC: update policy min/max when toggling auto_select
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
                   ` (5 preceding siblings ...)
  2025-10-01 15:01 ` [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited Sumit Gupta
@ 2025-10-01 15:01 ` Sumit Gupta
  2025-10-01 15:01 ` [PATCH v3 8/8] cpufreq: CPPC: add autonomous mode boot parameter support Sumit Gupta
  7 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:01 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

When CPPC autonomous selection (auto_select) is enabled or disabled,
the policy min/max frequency limits should be updated appropriately to
reflect the new operating mode.

Currently, toggling auto_select only changes the hardware register but
doesn't update the cpufreq policy constraints, which can lead to
inconsistent behavior between the hardware state and the policy limits
visible to userspace and other kernel components.

When auto_select is enabled, preserve the current min/max performance
values to maintain user-configured limits. When disabled, the hardware
operates in a default mode where the OS directly controls performance,
so update the policy limits accordingly.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 65 ++++++++++++++++++++++++++++++++--
 1 file changed, 62 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 9946adfeeee4..c888733ce5da 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -639,6 +639,26 @@ static int cppc_cpufreq_set_mperf_limit(struct cpufreq_policy *policy, u64 val,
 #define cppc_cpufreq_set_max_perf(policy, val, update_reg, update_policy) \
 	cppc_cpufreq_set_mperf_limit(policy, val, update_reg, update_policy, false)
 
+static int cppc_cpufreq_update_autosel_val(struct cpufreq_policy *policy, bool auto_sel)
+{
+	struct cppc_cpudata *cpu_data = policy->driver_data;
+	unsigned int cpu = policy->cpu;
+	int ret;
+
+	pr_debug("cpu%d, auto_sel curr:%u, new:%d\n", cpu, cpu_data->perf_caps.auto_sel, auto_sel);
+
+	guard(mutex)(&cppc_cpufreq_update_autosel_config_lock);
+
+	ret = cppc_set_auto_sel(cpu, auto_sel);
+	if (ret) {
+		pr_warn("Failed to set auto_sel=%d for CPU%d (%d)\n", auto_sel, cpu, ret);
+		return ret;
+	}
+	cpu_data->perf_caps.auto_sel = auto_sel;
+
+	return 0;
+}
+
 static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	unsigned int cpu = policy->cpu;
@@ -902,8 +922,47 @@ static ssize_t show_auto_select(struct cpufreq_policy *policy, char *buf)
 	return sysfs_emit(buf, "%d\n", val);
 }
 
-static ssize_t store_auto_select(struct cpufreq_policy *policy,
-				 const char *buf, size_t count)
+/**
+ * cppc_cpufreq_update_auto_select - Update autonomous selection config for policy->cpu
+ * @policy: cpufreq policy
+ * @enable: enable/disable autonomous selection
+ */
+static int cppc_cpufreq_update_auto_select(struct cpufreq_policy *policy, bool enable)
+{
+	struct cppc_cpudata *cpu_data = policy->driver_data;
+	struct cppc_perf_caps *caps = &cpu_data->perf_caps;
+	u64 min_perf = caps->lowest_nonlinear_perf;
+	u64 max_perf = caps->nominal_perf;
+	int ret;
+
+	if (enable) {
+		if (cpu_data->perf_ctrls.min_perf)
+			min_perf = cpu_data->perf_ctrls.min_perf;
+		if (cpu_data->perf_ctrls.max_perf)
+			max_perf = cpu_data->perf_ctrls.max_perf;
+	}
+
+	/*
+	 * Set min/max performance registers and update policy constraints.
+	 * When enabling: update both registers and policy.
+	 * When disabling: update policy only.
+	 */
+	ret = cppc_cpufreq_set_min_perf(policy, min_perf, enable, true);
+	if (ret)
+		return ret;
+
+	ret = cppc_cpufreq_set_max_perf(policy, max_perf, enable, true);
+	if (ret)
+		return ret;
+
+	ret = cppc_cpufreq_update_autosel_val(policy, enable);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
+static ssize_t store_auto_select(struct cpufreq_policy *policy, const char *buf, size_t count)
 {
 	bool val;
 	int ret;
@@ -912,7 +971,7 @@ static ssize_t store_auto_select(struct cpufreq_policy *policy,
 	if (ret)
 		return ret;
 
-	ret = cppc_set_auto_sel(policy->cpu, val);
+	ret = cppc_cpufreq_update_auto_select(policy, val);
 	if (ret)
 		return ret;
 
-- 
2.34.1


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

* [PATCH v3 8/8] cpufreq: CPPC: add autonomous mode boot parameter support
  2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
                   ` (6 preceding siblings ...)
  2025-10-01 15:01 ` [PATCH v3 7/8] cpufreq: CPPC: update policy min/max when toggling auto_select Sumit Gupta
@ 2025-10-01 15:01 ` Sumit Gupta
  7 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-01 15:01 UTC (permalink / raw)
  To: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg

Add kernel boot parameter 'cppc_cpufreq.auto_sel_mode' to enable CPPC
autonomous performance selection at system startup. When autonomous mode
is enabled, the hardware automatically adjusts CPU performance based on
workload demands using Energy Performance Preference (EPP) hints.

This parameter allows to configure the autonomous mode on all CPUs
without requiring runtime sysfs manipulation if the 'auto_sel' register
is present.

When auto_sel_mode=1:
- All CPUs are configured for autonomous operation during module init
- EPP is set to performance preference (0x0) by default
- Min/max performance bounds use defaults
- CPU frequency scaling is handled by hardware instead of OS governor

For Documentation/:
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 .../admin-guide/kernel-parameters.txt         |  12 +
 drivers/cpufreq/cppc_cpufreq.c                | 205 +++++++++++++++---
 2 files changed, 192 insertions(+), 25 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 1b2131d003ce..94950340851e 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -911,6 +911,18 @@
 			Format:
 			<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
 
+	cppc_cpufreq.auto_sel_mode=
+			[CPU_FREQ] Enable ACPI CPPC autonomous performance selection.
+			When enabled, hardware automatically adjusts CPU frequency
+			on all CPUs based on workload demands. In Autonomous mode,
+			Energy Performance Preference(EPP) hints guide hardware
+			toward performance(0x0) or energy efficiency (0xff).
+			Requires ACPI CPPC autonomous selection register support.
+			Format: <bool>
+			Default: 0 (disabled)
+			0: use cpufreq governors
+			1: enable if supoorted by hardware
+
 	cpuidle.off=1	[CPU_IDLE]
 			disable the cpuidle sub-system
 
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index c888733ce5da..8deb51d6bc2c 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -28,6 +28,8 @@
 #include <acpi/cppc_acpi.h>
 
 static struct cpufreq_driver cppc_cpufreq_driver;
+/* Autonomous Selection */
+static bool auto_sel_mode;
 
 #ifdef CONFIG_ACPI_CPPC_CPUFREQ_FIE
 static enum {
@@ -273,6 +275,14 @@ static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
 	freqs.old = policy->cur;
 	freqs.new = target_freq;
 
+	/*
+	 * In autonomous mode, hardware handles frequency scaling directly
+	 * based on workload demands and EPP hints, so OS frequency requests
+	 * are not needed.
+	 */
+	if (cpu_data->perf_caps.auto_sel)
+		return 0;
+
 	cpufreq_freq_transition_begin(policy, &freqs);
 	ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls);
 	cpufreq_freq_transition_end(policy, &freqs, ret != 0);
@@ -556,6 +566,12 @@ static struct cppc_cpudata *cppc_cpufreq_get_cpu_data(unsigned int cpu)
 		goto free_mask;
 	}
 
+	ret = cppc_get_perf(cpu, &cpu_data->perf_ctrls);
+	if (ret) {
+		pr_debug("Err reading CPU%d perf ctrls: ret:%d\n", cpu, ret);
+		goto free_mask;
+	}
+
 	return cpu_data;
 
 free_mask:
@@ -659,11 +675,79 @@ static int cppc_cpufreq_update_autosel_val(struct cpufreq_policy *policy, bool a
 	return 0;
 }
 
+static int cppc_cpufreq_update_epp_val(struct cpufreq_policy *policy, u32 epp)
+{
+	struct cppc_cpudata *cpu_data = policy->driver_data;
+	unsigned int cpu = policy->cpu;
+	int ret;
+
+	pr_debug("cpu%d, epp curr:%u, new:%u\n", cpu, cpu_data->perf_ctrls.energy_perf, epp);
+
+	guard(mutex)(&cppc_cpufreq_update_autosel_config_lock);
+
+	ret = cppc_set_epp(cpu, epp);
+	if (ret) {
+		pr_warn("failed to set energy_perf for cpu:%d (%d)\n", cpu, ret);
+		return ret;
+	}
+	cpu_data->perf_ctrls.energy_perf = epp;
+
+	return 0;
+}
+
+/**
+ * cppc_cpufreq_update_autosel_config - Update Autonomous selection configuration
+ * @policy: cpufreq policy for the CPU
+ * @min_perf: minimum performance value to set
+ * @max_perf: maximum performance value to set
+ * @auto_sel: autonomous selection mode enable/disable (also controls min/max perf reg updates)
+ * @epp_val: energy performance preference value
+ * @update_epp: whether to update EPP register
+ * @update_policy: whether to update policy constraints
+ *
+ * Return: 0 on success, negative error code on failure
+ */
+static int cppc_cpufreq_update_autosel_config(struct cpufreq_policy *policy,
+					      u64 min_perf, u64 max_perf, bool auto_sel,
+					      u32 epp_val, bool update_epp, bool update_policy)
+{
+	const unsigned int cpu = policy->cpu;
+	int ret;
+
+	/*
+	 * Set min/max performance registers and update policy constraints.
+	 * When enabling: update both registers and policy.
+	 * When disabling: update policy only.
+	 */
+	ret = cppc_cpufreq_set_min_perf(policy, min_perf, auto_sel, update_policy);
+	if (ret)
+		return ret;
+
+	ret = cppc_cpufreq_set_max_perf(policy, max_perf, auto_sel, update_policy);
+	if (ret)
+		return ret;
+
+	if (update_epp) {
+		ret = cppc_cpufreq_update_epp_val(policy, epp_val);
+		if (ret)
+			return ret;
+	}
+
+	ret = cppc_cpufreq_update_autosel_val(policy, auto_sel);
+	if (ret)
+		return ret;
+
+	pr_debug("Updated autonomous config [%llu-%llu] for CPU%d\n", min_perf, max_perf, cpu);
+
+	return 0;
+}
+
 static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	unsigned int cpu = policy->cpu;
 	struct cppc_cpudata *cpu_data;
 	struct cppc_perf_caps *caps;
+	u64 min_perf, max_perf;
 	int ret;
 
 	cpu_data = cppc_cpufreq_get_cpu_data(cpu);
@@ -727,11 +811,31 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	policy->cur = cppc_perf_to_khz(caps, caps->highest_perf);
 	cpu_data->perf_ctrls.desired_perf =  caps->highest_perf;
 
-	ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls);
-	if (ret) {
-		pr_debug("Err setting perf value:%d on CPU:%d. ret:%d\n",
-			 caps->highest_perf, cpu, ret);
-		goto out;
+	if (cpu_data->perf_caps.auto_sel) {
+		ret = cppc_set_enable(cpu, true);
+		if (ret) {
+			pr_err("Failed to enable CPPC on cpu%d (%d)\n", cpu, ret);
+			goto out;
+		}
+
+		min_perf = cpu_data->perf_ctrls.min_perf ?
+			   cpu_data->perf_ctrls.min_perf : caps->lowest_nonlinear_perf;
+		max_perf = cpu_data->perf_ctrls.max_perf ?
+			   cpu_data->perf_ctrls.max_perf : caps->nominal_perf;
+
+		ret = cppc_cpufreq_update_autosel_config(policy, min_perf, max_perf, true,
+							 CPPC_EPP_PERFORMANCE_PREF, true, false);
+		if (ret) {
+			cppc_set_enable(cpu, false);
+			goto out;
+		}
+	} else {
+		ret = cppc_set_perf(cpu, &cpu_data->perf_ctrls);
+		if (ret) {
+			pr_debug("Err setting perf value:%d on CPU:%d. ret:%d\n",
+				 caps->highest_perf, cpu, ret);
+			goto out;
+		}
 	}
 
 	cppc_cpufreq_cpu_fie_init(policy);
@@ -933,7 +1037,6 @@ static int cppc_cpufreq_update_auto_select(struct cpufreq_policy *policy, bool e
 	struct cppc_perf_caps *caps = &cpu_data->perf_caps;
 	u64 min_perf = caps->lowest_nonlinear_perf;
 	u64 max_perf = caps->nominal_perf;
-	int ret;
 
 	if (enable) {
 		if (cpu_data->perf_ctrls.min_perf)
@@ -942,24 +1045,8 @@ static int cppc_cpufreq_update_auto_select(struct cpufreq_policy *policy, bool e
 			max_perf = cpu_data->perf_ctrls.max_perf;
 	}
 
-	/*
-	 * Set min/max performance registers and update policy constraints.
-	 * When enabling: update both registers and policy.
-	 * When disabling: update policy only.
-	 */
-	ret = cppc_cpufreq_set_min_perf(policy, min_perf, enable, true);
-	if (ret)
-		return ret;
-
-	ret = cppc_cpufreq_set_max_perf(policy, max_perf, enable, true);
-	if (ret)
-		return ret;
-
-	ret = cppc_cpufreq_update_autosel_val(policy, enable);
-	if (ret)
-		return ret;
-
-	return 0;
+	return cppc_cpufreq_update_autosel_config(policy, min_perf, max_perf, enable,
+						  0, false, true);
 }
 
 static ssize_t store_auto_select(struct cpufreq_policy *policy, const char *buf, size_t count)
@@ -996,7 +1083,18 @@ static ssize_t show_energy_performance_preference_val(struct cpufreq_policy *pol
 static ssize_t store_energy_performance_preference_val(struct cpufreq_policy *policy,
 						       const char *buf, size_t count)
 {
-	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_epp, policy->cpu);
+	u64 val;
+	int ret;
+
+	ret = kstrtou64(buf, 0, &val);
+	if (ret)
+		return ret;
+
+	ret = cppc_cpufreq_update_epp_val(policy, (u32)val);
+	if (ret)
+		return ret;
+
+	return count;
 }
 
 static ssize_t show_min_perf(struct cpufreq_policy *policy, char *buf)
@@ -1085,13 +1183,61 @@ static struct cpufreq_driver cppc_cpufreq_driver = {
 	.name = "cppc_cpufreq",
 };
 
+static int cppc_cpufreq_set_epp_autosel_allcpus(bool auto_sel, u64 epp)
+{
+	int cpu, ret;
+
+	for_each_present_cpu(cpu) {
+		ret = cppc_set_epp(cpu, epp);
+		if (ret) {
+			pr_warn("Failed to set EPP on CPU%d (%d)\n", cpu, ret);
+			goto disable_all;
+		}
+
+		ret = cppc_set_auto_sel(cpu, auto_sel);
+		if (ret) {
+			pr_warn("Failed to set auto_sel on CPU%d (%d)\n", cpu, ret);
+			goto disable_all;
+		}
+	}
+
+	return 0;
+
+disable_all:
+	pr_warn("Disabling auto_sel for all CPUs\n");
+	for_each_present_cpu(cpu)
+		cppc_set_auto_sel(cpu, false);
+
+	return -EIO;
+}
+
 static int __init cppc_cpufreq_init(void)
 {
+	bool auto_sel;
 	int ret;
 
 	if (!acpi_cpc_valid())
 		return -ENODEV;
 
+	if (auto_sel_mode) {
+		/*
+		 * Check if autonomous selection is supported by testing CPU 0.
+		 * If supported, enable autonomous mode on all CPUs.
+		 */
+		ret = cppc_get_auto_sel(0, &auto_sel);
+		if (!ret) {
+			pr_info("Enabling auto_sel_mode (autonomous selection mode)\n");
+			ret = cppc_cpufreq_set_epp_autosel_allcpus(true, CPPC_EPP_PERFORMANCE_PREF);
+			if (ret) {
+				pr_warn("Disabling auto_sel_mode, fallback to standard\n");
+				auto_sel_mode = false;
+			}
+		} else {
+			pr_warn("Disabling auto_sel_mode as not supported by hardware\n");
+			auto_sel_mode = false;
+		}
+	}
+
 	cppc_freq_invariance_init();
 	populate_efficiency_class();
 
@@ -1104,10 +1250,19 @@ static int __init cppc_cpufreq_init(void)
 
 static void __exit cppc_cpufreq_exit(void)
 {
+	int cpu;
+
+	for_each_present_cpu(cpu)
+		cppc_set_auto_sel(cpu, false);
+	auto_sel_mode = false;
+
 	cpufreq_unregister_driver(&cppc_cpufreq_driver);
 	cppc_freq_invariance_exit();
 }
 
+module_param(auto_sel_mode, bool, 0000);
+MODULE_PARM_DESC(auto_sel_mode, "Enable Autonomous Performance Level Selection");
+
 module_exit(cppc_cpufreq_exit);
 MODULE_AUTHOR("Ashwin Chaugule");
 MODULE_DESCRIPTION("CPUFreq driver based on the ACPI CPPC v5.0+ spec");
-- 
2.34.1


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

* Re: [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  2025-10-01 15:01 ` [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited Sumit Gupta
@ 2025-10-01 17:03   ` Mario Limonciello
  2025-10-08 10:16     ` Sumit Gupta
  2025-10-10  3:29   ` Jie Zhan
  2025-10-22 12:02   ` Ionela Voinescu
  2 siblings, 1 reply; 21+ messages in thread
From: Mario Limonciello @ 2025-10-01 17:03 UTC (permalink / raw)
  To: linux-doc, corbet, Randy Dunlap
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, Sumit Gupta, rafael, viresh.kumar, lenb, robert.moore,
	pierre.gondois, zhenglifeng1, ray.huang, gautham.shenoy,
	perry.yuan, linux-pm, linux-acpi, linux-doc, acpica-devel,
	linux-kernel

+linux-doc

On 10/1/25 10:01 AM, Sumit Gupta wrote:
> Add sysfs interfaces for Minimum Performance, Maximum Performance
> and Performance Limited Register in the cppc_cpufreq driver.
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> ---
>   .../ABI/testing/sysfs-devices-system-cpu      | 43 +++++++++++++++++++
>   1 file changed, 43 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
> index ab8cd337f43a..82141b45d58c 100644
> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
> @@ -327,6 +327,49 @@ Description:	Energy performance preference
>   
>   		This file is only present if the cppc-cpufreq driver is in use.
>   
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/min_perf
> +Date:		September 2025

These dates will need to push out since this isn't 6.17 material.

That being said I have a general question to linux-doc.

Why is this is date based?  I would expect a date is meaningless to 
anyone reads this documentation.  People who want to know if an 
interface is available would normally look at their kernel version to tell.

So wouldn't it make more sense for this field to be something like:

Version: 6.19

> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
> +
> +		Read/write a 32 bits value from/to this file. This file
> +		conveys the minimum performance level at which the platform
> +		may run. Minimum performance may be set to any performance
> +		value in the range [Lowest Performance, Highest Performance],

How will a user discover the lowest -> highest range?

IE I think you should document how to lookup those caps too.

> +		inclusive but must be set to a value that is less than or
> +		equal to that specified by the Maximum Performance Register.
> +
> +		Writing to this file only has meaning when Autonomous Selection
> +		is enabled.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
> +
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/max_perf
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
> +
> +		Read/write a 32 bits value from/to this file. This file conveys
> +		the maximum performance level at which the platform may run.
> +		Maximum performance may be set to any performance value in the
> +		range [Lowest Performance, Highest Performance], inclusive.
> +
> +		Writing to this file only has meaning when Autonomous Selection is
> +		enabled.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
> +
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/perf_limited
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
> +
> +		Read/write a 32 bits value from/to this file. This file indicates
> +		to OSPM that an unpredictable event has limited processor
> +		performance, and the delivered performance may be less than
> +		desired/minimum performance.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
>   
>   What:		/sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
>   Date:		August 2008


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

* Re: [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  2025-10-01 17:03   ` Mario Limonciello
@ 2025-10-08 10:16     ` Sumit Gupta
  0 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-08 10:16 UTC (permalink / raw)
  To: Mario Limonciello, linux-doc, corbet, Randy Dunlap
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, rafael, viresh.kumar, lenb, robert.moore, pierre.gondois,
	zhenglifeng1, ray.huang, gautham.shenoy, perry.yuan, linux-pm,
	linux-acpi, acpica-devel, linux-kernel, sumitg


On 01/10/25 22:33, Mario Limonciello wrote:
> External email: Use caution opening links or attachments
>
>
> +linux-doc
>
> On 10/1/25 10:01 AM, Sumit Gupta wrote:
>> Add sysfs interfaces for Minimum Performance, Maximum Performance
>> and Performance Limited Register in the cppc_cpufreq driver.
>>
>> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
>> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
>> ---
>>   .../ABI/testing/sysfs-devices-system-cpu      | 43 +++++++++++++++++++
>>   1 file changed, 43 insertions(+)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu 
>> b/Documentation/ABI/testing/sysfs-devices-system-cpu
>> index ab8cd337f43a..82141b45d58c 100644
>> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
>> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
>> @@ -327,6 +327,49 @@ Description:     Energy performance preference
>>
>>               This file is only present if the cppc-cpufreq driver is 
>> in use.
>>
>> +What: /sys/devices/system/cpu/cpuX/cpufreq/min_perf
>> +Date:                September 2025
>
> These dates will need to push out since this isn't 6.17 material.

Sure.


>
> That being said I have a general question to linux-doc.
>
> Why is this is date based?  I would expect a date is meaningless to
> anyone reads this documentation.  People who want to know if an
> interface is available would normally look at their kernel version to 
> tell.
>
> So wouldn't it make more sense for this field to be something like:
>
> Version: 6.19
>
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
>> +
>> +             Read/write a 32 bits value from/to this file. This file
>> +             conveys the minimum performance level at which the 
>> platform
>> +             may run. Minimum performance may be set to any performance
>> +             value in the range [Lowest Performance, Highest 
>> Performance],
>
> How will a user discover the lowest -> highest range?
>
> IE I think you should document how to lookup those caps too.

Ok, will add the info about these nodes as below.

  Minimum performance may be set to any performance
  value in the range [Lowest Performance, Highest Performance],
  inclusive but must be set to a value that is less than or
  equal to that specified by the Maximum Performance Register.
  The range can be checked from nodes:
    /sys/devices/system/cpu/cpuX/acpi_cppc/highest_perf
    /sys/devices/system/cpu/cpuX/acpi_cppc/lowest_perf

Thank you,
Sumit


>
>> +             inclusive but must be set to a value that is less than or
>> +             equal to that specified by the Maximum Performance 
>> Register.
>> +
>> +             Writing to this file only has meaning when Autonomous 
>> Selection
>> +             is enabled.
>> +
>> +             This file is only present if the cppc-cpufreq driver is 
>> in use.
>> +
>> +What: /sys/devices/system/cpu/cpuX/cpufreq/max_perf
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
>> +
>> +             Read/write a 32 bits value from/to this file. This file 
>> conveys
>> +             the maximum performance level at which the platform may 
>> run.
>> +             Maximum performance may be set to any performance value 
>> in the
>> +             range [Lowest Performance, Highest Performance], 
>> inclusive.
>> +
>> +             Writing to this file only has meaning when Autonomous 
>> Selection is
>> +             enabled.
>> +
>> +             This file is only present if the cppc-cpufreq driver is 
>> in use.
>> +
>> +What: /sys/devices/system/cpu/cpuX/cpufreq/perf_limited
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
>> +
>> +             Read/write a 32 bits value from/to this file. This file 
>> indicates
>> +             to OSPM that an unpredictable event has limited processor
>> +             performance, and the delivered performance may be less 
>> than
>> +             desired/minimum performance.
>> +
>> +             This file is only present if the cppc-cpufreq driver is 
>> in use.
>>
>>   What: /sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
>>   Date:               August 2008
>

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

* Re: [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store
  2025-10-01 15:00 ` [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store Sumit Gupta
@ 2025-10-10  3:24   ` Jie Zhan
  2025-10-13 12:51     ` Sumit Gupta
  0 siblings, 1 reply; 21+ messages in thread
From: Jie Zhan @ 2025-10-10  3:24 UTC (permalink / raw)
  To: Sumit Gupta, rafael, viresh.kumar, lenb, robert.moore, corbet,
	pierre.gondois, zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu


Hi Sumit,

On 10/1/2025 11:00 PM, Sumit Gupta wrote:
> Add generic show/store helper functions for u64 sysfs attributes:
> - cppc_cpufreq_sysfs_show_u64()
> - cppc_cpufreq_sysfs_store_u64()
> 
> Refactor auto_act_window and energy_performance_preference_val
> attributes to use these helpers, eliminating code duplication.
> 
> No functional changes.
> 
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Nice cleanup in general.  Some minor bits inline.
> ---
>  drivers/cpufreq/cppc_cpufreq.c | 87 ++++++++++++++--------------------
>  1 file changed, 35 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 12de0ac7bbaf..732f35096991 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -781,6 +781,36 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state)
>  	return 0;
>  }
>  
> +static ssize_t cppc_cpufreq_sysfs_show_u64(unsigned int cpu, int (*get_func)(int, u64 *), char *buf)
Wrap a bit into 80 chars?

BTW, trivial but I would prefer a symmetric param order, like:
show(buf, get_func, cpu)
store(buf, count, set_func, cpu)
> +{
> +	u64 val;
> +	int ret = get_func(cpu, &val);
> +
> +	if (ret == -EOPNOTSUPP)
> +		return sysfs_emit(buf, "<unsupported>\n");
> +	if (ret)
> +		return ret;
> +
> +	return sysfs_emit(buf, "%llu\n", val);
> +}
> +
> +static ssize_t cppc_cpufreq_sysfs_store_u64(const char *buf, size_t count,
> +					    int (*set_func)(int, u64), unsigned int cpu)
> +{
> +	u64 val;
> +	int ret;
> +
> +	if (!buf || !set_func)
> +		return -EINVAL;
No need.
> +
> +	ret = kstrtou64(buf, 0, &val);
> +	if (ret)
> +		return ret;
> +
> +	ret = set_func((int)cpu, val);
> +	return ret ? ret : count;
I suppose it's preferred to avoid using ternary operators like this.
> +}
> +
Would be nicer to move cppc_cpufreq_sysfs_show/store_u64() to just above
where they are used, i.e. just before show_auto_act_window().
>  static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf)
>  {
>  	struct cppc_cpudata *cpu_data = policy->driver_data;
> @@ -824,70 +854,23 @@ static ssize_t store_auto_select(struct cpufreq_policy *policy,
>  
>  static ssize_t show_auto_act_window(struct cpufreq_policy *policy, char *buf)
>  {
> -	u64 val;
> -	int ret;
> -
> -	ret = cppc_get_auto_act_window(policy->cpu, &val);
> -
> -	/* show "<unsupported>" when this register is not supported by cpc */
> -	if (ret == -EOPNOTSUPP)
> -		return sysfs_emit(buf, "<unsupported>\n");
> -
> -	if (ret)
> -		return ret;
> -
> -	return sysfs_emit(buf, "%llu\n", val);
> +	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_auto_act_window, buf);
>  }
>  
> -static ssize_t store_auto_act_window(struct cpufreq_policy *policy,
> -				     const char *buf, size_t count)
> +static ssize_t store_auto_act_window(struct cpufreq_policy *policy, const char *buf, size_t count)
>  {
> -	u64 usec;
> -	int ret;
> -
> -	ret = kstrtou64(buf, 0, &usec);
> -	if (ret)
> -		return ret;
> -
> -	ret = cppc_set_auto_act_window(policy->cpu, usec);
> -	if (ret)
> -		return ret;
> -
> -	return count;
> +	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_auto_act_window, policy->cpu);
>  }
>  
>  static ssize_t show_energy_performance_preference_val(struct cpufreq_policy *policy, char *buf)
>  {
> -	u64 val;
> -	int ret;
> -
> -	ret = cppc_get_epp_perf(policy->cpu, &val);
> -
> -	/* show "<unsupported>" when this register is not supported by cpc */
> -	if (ret == -EOPNOTSUPP)
> -		return sysfs_emit(buf, "<unsupported>\n");
> -
> -	if (ret)
> -		return ret;
> -
> -	return sysfs_emit(buf, "%llu\n", val);
> +	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_epp_perf, buf);
>  }
>  
>  static ssize_t store_energy_performance_preference_val(struct cpufreq_policy *policy,
>  						       const char *buf, size_t count)
>  {
> -	u64 val;
> -	int ret;
> -
> -	ret = kstrtou64(buf, 0, &val);
> -	if (ret)
> -		return ret;
> -
> -	ret = cppc_set_epp(policy->cpu, val);
> -	if (ret)
> -		return ret;
> -
> -	return count;
> +	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_epp, policy->cpu);
>  }
>  
>  cpufreq_freq_attr_ro(freqdomain_cpus);

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

* Re: [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  2025-10-01 15:01 ` [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited Sumit Gupta
  2025-10-01 17:03   ` Mario Limonciello
@ 2025-10-10  3:29   ` Jie Zhan
  2025-10-13 11:59     ` Sumit Gupta
  2025-10-22 12:02   ` Ionela Voinescu
  2 siblings, 1 reply; 21+ messages in thread
From: Jie Zhan @ 2025-10-10  3:29 UTC (permalink / raw)
  To: Sumit Gupta, rafael, viresh.kumar, lenb, robert.moore, corbet,
	pierre.gondois, zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu



On 10/1/2025 11:01 PM, Sumit Gupta wrote:
> Add sysfs interfaces for Minimum Performance, Maximum Performance
> and Performance Limited Register in the cppc_cpufreq driver.
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> ---
>  .../ABI/testing/sysfs-devices-system-cpu      | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
> index ab8cd337f43a..82141b45d58c 100644
> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
> @@ -327,6 +327,49 @@ Description:	Energy performance preference
>  
>  		This file is only present if the cppc-cpufreq driver is in use.
>  
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/min_perf
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
> +
> +		Read/write a 32 bits value from/to this file. This file
> +		conveys the minimum performance level at which the platform
> +		may run. Minimum performance may be set to any performance
> +		value in the range [Lowest Performance, Highest Performance],
> +		inclusive but must be set to a value that is less than or
> +		equal to that specified by the Maximum Performance Register.
> +
> +		Writing to this file only has meaning when Autonomous Selection
> +		is enabled.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
> +
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/max_perf
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
Not adapted
> +
> +		Read/write a 32 bits value from/to this file. This file conveys
> +		the maximum performance level at which the platform may run.
> +		Maximum performance may be set to any performance value in the
> +		range [Lowest Performance, Highest Performance], inclusive.
> +
> +		Writing to this file only has meaning when Autonomous Selection is
> +		enabled.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
> +
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/perf_limited
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
Not adapted
> +
> +		Read/write a 32 bits value from/to this file. This file indicates
> +		to OSPM that an unpredictable event has limited processor
> +		performance, and the delivered performance may be less than
> +		desired/minimum performance.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
>  
>  What:		/sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
>  Date:		August 2008

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

* Re: [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  2025-10-10  3:29   ` Jie Zhan
@ 2025-10-13 11:59     ` Sumit Gupta
  0 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-13 11:59 UTC (permalink / raw)
  To: Jie Zhan, rafael, viresh.kumar, lenb, robert.moore, corbet,
	pierre.gondois, zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg


On 10/10/25 08:59, Jie Zhan wrote:
> External email: Use caution opening links or attachments
>
>
> On 10/1/2025 11:01 PM, Sumit Gupta wrote:
>> Add sysfs interfaces for Minimum Performance, Maximum Performance
>> and Performance Limited Register in the cppc_cpufreq driver.
>>
>> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
>> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
>> ---
>>   .../ABI/testing/sysfs-devices-system-cpu      | 43 +++++++++++++++++++
>>   1 file changed, 43 insertions(+)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
>> index ab8cd337f43a..82141b45d58c 100644
>> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
>> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
>> @@ -327,6 +327,49 @@ Description:     Energy performance preference
>>
>>                This file is only present if the cppc-cpufreq driver is in use.
>>
>> +What:                /sys/devices/system/cpu/cpuX/cpufreq/min_perf
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
>> +
>> +             Read/write a 32 bits value from/to this file. This file
>> +             conveys the minimum performance level at which the platform
>> +             may run. Minimum performance may be set to any performance
>> +             value in the range [Lowest Performance, Highest Performance],
>> +             inclusive but must be set to a value that is less than or
>> +             equal to that specified by the Maximum Performance Register.
>> +
>> +             Writing to this file only has meaning when Autonomous Selection
>> +             is enabled.
>> +
>> +             This file is only present if the cppc-cpufreq driver is in use.
>> +
>> +What:                /sys/devices/system/cpu/cpuX/cpufreq/max_perf
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
> Not adapted
Sorry, i missed this. Will update here and below.

Thank you,
Sumit

>> +
>> +             Read/write a 32 bits value from/to this file. This file conveys
>> +             the maximum performance level at which the platform may run.
>> +             Maximum performance may be set to any performance value in the
>> +             range [Lowest Performance, Highest Performance], inclusive.
>> +
>> +             Writing to this file only has meaning when Autonomous Selection is
>> +             enabled.
>> +
>> +             This file is only present if the cppc-cpufreq driver is in use.
>> +
>> +What:                /sys/devices/system/cpu/cpuX/cpufreq/perf_limited
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
> Not adapted

Ack.


>> +
>> +             Read/write a 32 bits value from/to this file. This file indicates
>> +             to OSPM that an unpredictable event has limited processor
>> +             performance, and the delivered performance may be less than
>> +             desired/minimum performance.
>> +
>> +             This file is only present if the cppc-cpufreq driver is in use.
>>
>>   What:                /sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
>>   Date:                August 2008

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

* Re: [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store
  2025-10-10  3:24   ` Jie Zhan
@ 2025-10-13 12:51     ` Sumit Gupta
  0 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-13 12:51 UTC (permalink / raw)
  To: Jie Zhan, rafael, viresh.kumar, lenb, robert.moore, corbet,
	pierre.gondois, zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel
  Cc: linux-tegra, treding, jonathanh, vsethi, ksitaraman, sanjayc,
	bbasu, sumitg


On 10/10/25 08:54, Jie Zhan wrote:
> External email: Use caution opening links or attachments
>
>
> Hi Sumit,
>
> On 10/1/2025 11:00 PM, Sumit Gupta wrote:
>> Add generic show/store helper functions for u64 sysfs attributes:
>> - cppc_cpufreq_sysfs_show_u64()
>> - cppc_cpufreq_sysfs_store_u64()
>>
>> Refactor auto_act_window and energy_performance_preference_val
>> attributes to use these helpers, eliminating code duplication.
>>
>> No functional changes.
>>
>> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> Nice cleanup in general.  Some minor bits inline.
>> ---
>>   drivers/cpufreq/cppc_cpufreq.c | 87 ++++++++++++++--------------------
>>   1 file changed, 35 insertions(+), 52 deletions(-)
>>
>> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
>> index 12de0ac7bbaf..732f35096991 100644
>> --- a/drivers/cpufreq/cppc_cpufreq.c
>> +++ b/drivers/cpufreq/cppc_cpufreq.c
>> @@ -781,6 +781,36 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state)
>>        return 0;
>>   }
>>
>> +static ssize_t cppc_cpufreq_sysfs_show_u64(unsigned int cpu, int (*get_func)(int, u64 *), char *buf)
> Wrap a bit into 80 chars?

Wrapped line length to 100 as per the max limit.

  $ grep "max_line_length =" scripts/checkpatch.pl
  my $max_line_length = 100;


>
> BTW, trivial but I would prefer a symmetric param order, like:
> show(buf, get_func, cpu)
> store(buf, count, set_func, cpu)

Sure, will change the param order.


>> +{
>> +     u64 val;
>> +     int ret = get_func(cpu, &val);
>> +
>> +     if (ret == -EOPNOTSUPP)
>> +             return sysfs_emit(buf, "<unsupported>\n");
>> +     if (ret)
>> +             return ret;
>> +
>> +     return sysfs_emit(buf, "%llu\n", val);
>> +}
>> +
>> +static ssize_t cppc_cpufreq_sysfs_store_u64(const char *buf, size_t count,
>> +                                         int (*set_func)(int, u64), unsigned int cpu)
>> +{
>> +     u64 val;
>> +     int ret;
>> +
>> +     if (!buf || !set_func)
>> +             return -EINVAL;
> No need.

Ok.


>> +
>> +     ret = kstrtou64(buf, 0, &val);
>> +     if (ret)
>> +             return ret;
>> +
>> +     ret = set_func((int)cpu, val);
>> +     return ret ? ret : count;
> I suppose it's preferred to avoid using ternary operators like this.

These are commonly use. e.g. within cpufreq:

  $ grep -inr "return ret ?" drivers/cpufreq/*
  drivers/cpufreq/amd-pstate.c:1184:      return ret ? ret : count;
  drivers/cpufreq/cpufreq.c:839:  return ret ? ret : count;
  drivers/cpufreq/intel_pstate.c:897:     return ret ?: count;

>> +}
>> +
> Would be nicer to move cppc_cpufreq_sysfs_show/store_u64() to just above
> where they are used, i.e. just before show_auto_act_window().

Sure.

Thank you,
Sumit

>>   static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf)
>>   {
>>        struct cppc_cpudata *cpu_data = policy->driver_data;
>> @@ -824,70 +854,23 @@ static ssize_t store_auto_select(struct cpufreq_policy *policy,
>>
>>   static ssize_t show_auto_act_window(struct cpufreq_policy *policy, char *buf)
>>   {
>> -     u64 val;
>> -     int ret;
>> -
>> -     ret = cppc_get_auto_act_window(policy->cpu, &val);
>> -
>> -     /* show "<unsupported>" when this register is not supported by cpc */
>> -     if (ret == -EOPNOTSUPP)
>> -             return sysfs_emit(buf, "<unsupported>\n");
>> -
>> -     if (ret)
>> -             return ret;
>> -
>> -     return sysfs_emit(buf, "%llu\n", val);
>> +     return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_auto_act_window, buf);
>>   }
>>
>> -static ssize_t store_auto_act_window(struct cpufreq_policy *policy,
>> -                                  const char *buf, size_t count)
>> +static ssize_t store_auto_act_window(struct cpufreq_policy *policy, const char *buf, size_t count)
>>   {
>> -     u64 usec;
>> -     int ret;
>> -
>> -     ret = kstrtou64(buf, 0, &usec);
>> -     if (ret)
>> -             return ret;
>> -
>> -     ret = cppc_set_auto_act_window(policy->cpu, usec);
>> -     if (ret)
>> -             return ret;
>> -
>> -     return count;
>> +     return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_auto_act_window, policy->cpu);
>>   }
>>
>>   static ssize_t show_energy_performance_preference_val(struct cpufreq_policy *policy, char *buf)
>>   {
>> -     u64 val;
>> -     int ret;
>> -
>> -     ret = cppc_get_epp_perf(policy->cpu, &val);
>> -
>> -     /* show "<unsupported>" when this register is not supported by cpc */
>> -     if (ret == -EOPNOTSUPP)
>> -             return sysfs_emit(buf, "<unsupported>\n");
>> -
>> -     if (ret)
>> -             return ret;
>> -
>> -     return sysfs_emit(buf, "%llu\n", val);
>> +     return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_epp_perf, buf);
>>   }
>>
>>   static ssize_t store_energy_performance_preference_val(struct cpufreq_policy *policy,
>>                                                       const char *buf, size_t count)
>>   {
>> -     u64 val;
>> -     int ret;
>> -
>> -     ret = kstrtou64(buf, 0, &val);
>> -     if (ret)
>> -             return ret;
>> -
>> -     ret = cppc_set_epp(policy->cpu, val);
>> -     if (ret)
>> -             return ret;
>> -
>> -     return count;
>> +     return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_epp, policy->cpu);
>>   }
>>
>>   cpufreq_freq_attr_ro(freqdomain_cpus);

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

* Re: [PATCH v3 3/8] ACPI: CPPC: extend APIs to support auto_sel and epp
  2025-10-01 15:00 ` [PATCH v3 3/8] ACPI: CPPC: extend APIs to support auto_sel and epp Sumit Gupta
@ 2025-10-22  9:12   ` Ionela Voinescu
  2025-10-24 13:12     ` Sumit Gupta
  0 siblings, 1 reply; 21+ messages in thread
From: Ionela Voinescu @ 2025-10-22  9:12 UTC (permalink / raw)
  To: Sumit Gupta
  Cc: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel, linux-tegra, treding, jonathanh,
	vsethi, ksitaraman, sanjayc, bbasu

Hi Sumit,

On Wednesday 01 Oct 2025 at 20:30:59 (+0530), Sumit Gupta wrote:
> - Add auto_sel read support in cppc_get_perf_caps().
> - Add write of both auto_sel and energy_perf in cppc_set_epp_perf().
> - Remove redundant energy_perf field from 'struct cppc_perf_caps' as
>   the same is available in 'struct cppc_perf_ctrls' which is used.
> 
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> ---
[..]
> @@ -1555,6 +1559,8 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
>  	struct cpc_register_resource *auto_sel_reg;
>  	struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpu);
>  	struct cppc_pcc_data *pcc_ss_data = NULL;
> +	bool autosel_support_in_ffh_or_sysmem;
> +	bool epp_support_in_ffh_or_sysmem;
>  	int ret;
>  
>  	if (!cpc_desc) {
> @@ -1565,6 +1571,11 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
>  	auto_sel_reg = &cpc_desc->cpc_regs[AUTO_SEL_ENABLE];
>  	epp_set_reg = &cpc_desc->cpc_regs[ENERGY_PERF];
>  
> +	epp_support_in_ffh_or_sysmem = CPC_SUPPORTED(epp_set_reg) &&
> +				(CPC_IN_FFH(epp_set_reg) || CPC_IN_SYSTEM_MEMORY(epp_set_reg));
> +	autosel_support_in_ffh_or_sysmem = CPC_SUPPORTED(auto_sel_reg) &&
> +				(CPC_IN_FFH(auto_sel_reg) || CPC_IN_SYSTEM_MEMORY(auto_sel_reg));
> +
>  	if (CPC_IN_PCC(epp_set_reg) || CPC_IN_PCC(auto_sel_reg)) {
>  		if (pcc_ss_id < 0) {
>  			pr_debug("Invalid pcc_ss_id for CPU:%d\n", cpu);
> @@ -1590,8 +1601,19 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
>  		ret = send_pcc_cmd(pcc_ss_id, CMD_WRITE);
>  		up_write(&pcc_ss_data->pcc_lock);
>  	} else if (osc_cpc_flexible_adr_space_confirmed &&
> -		   CPC_SUPPORTED(epp_set_reg) && CPC_IN_FFH(epp_set_reg)) {
> +		   epp_support_in_ffh_or_sysmem && autosel_support_in_ffh_or_sysmem) {

Isn't this problematic for when auto-select is an integer set to 1 or it's
not present at all? In those cases the EPP register won't be written and
-ENOTSUPP will be returned.

I suppose for the case when auto-select is not present at all in _CPC
(it's an optional attribute) it's not very clear what one should do
regarding writing the EPP register. The specification mentions that
"Writes to this register only have meaning when Autonomous Selection
is enabled.". From my perspective the OS should not block writes to the
EPP register for this case, as autonomous selection might still be
enabled but not exposed to the OS. 

Thanks,
Ionela.

> +		ret = cpc_write(cpu, auto_sel_reg, enable);
> +		if (ret) {
> +			pr_debug("Failed to write auto_sel=%d for CPU:%d\n", enable, cpu);
> +			return ret;
> +		}
> +
>  		ret = cpc_write(cpu, epp_set_reg, perf_ctrls->energy_perf);
> +		if (ret) {
> +			pr_debug("Failed to write energy_perf=%u for CPU:%d\n",
> +				 perf_ctrls->energy_perf, cpu);
> +			return ret;
> +		}
>  	} else {
>  		ret = -ENOTSUPP;
>  		pr_debug("_CPC in PCC and _CPC in FFH are not supported\n");
[..]

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

* Re: [PATCH v3 4/8] ACPI: CPPC: add APIs and sysfs interface for min/max_perf
  2025-10-01 15:01 ` [PATCH v3 4/8] ACPI: CPPC: add APIs and sysfs interface for min/max_perf Sumit Gupta
@ 2025-10-22 10:58   ` Ionela Voinescu
  2025-10-24 13:22     ` Sumit Gupta
  0 siblings, 1 reply; 21+ messages in thread
From: Ionela Voinescu @ 2025-10-22 10:58 UTC (permalink / raw)
  To: Sumit Gupta
  Cc: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel, linux-tegra, treding, jonathanh,
	vsethi, ksitaraman, sanjayc, bbasu

On Wednesday 01 Oct 2025 at 20:31:00 (+0530), Sumit Gupta wrote:
> CPPC allows platforms to specify minimum and maximum performance
> limits that constrain the operating range for CPU performance scaling
> when Autonomous Selection is enabled. These limits can be dynamically
> adjusted to implement power management policies or workload-specific
> optimizations.
> 
> Add cppc_get_min_perf() and cppc_set_min_perf() functions to read and
> write the MIN_PERF register, allowing dynamic adjustment of the minimum
> performance floor.
> 
> Add cppc_get_max_perf() and cppc_set_max_perf() functions to read and
> write the MAX_PERF register, enabling dynamic ceiling control for
> maximum performance.
> 
> Expose these capabilities through cpufreq sysfs attributes:
> - /sys/.../cpufreq/policy*/min_perf: Read/write min performance limit
> - /sys/.../cpufreq/policy*/max_perf: Read/write max performance limit
> 
> Also update EPP constants for better clarity:
> - Rename CPPC_ENERGY_PERF_MAX to CPPC_EPP_ENERGY_EFFICIENCY_PREF
> - Add CPPC_EPP_PERFORMANCE_PREF for the performance-oriented setting
> 
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> ---
>  drivers/acpi/cppc_acpi.c       |  55 +++++++++++++++-
>  drivers/cpufreq/cppc_cpufreq.c | 115 +++++++++++++++++++++++++++++++++
>  include/acpi/cppc_acpi.h       |  23 ++++++-
>  3 files changed, 191 insertions(+), 2 deletions(-)
> 
[..]
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 732f35096991..864978674efc 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -23,6 +23,7 @@
>  #include <uapi/linux/sched/types.h>
>  
>  #include <linux/unaligned.h>
> +#include <linux/cleanup.h>
>  
>  #include <acpi/cppc_acpi.h>
>  
> @@ -38,6 +39,8 @@ static enum {
>  module_param(fie_disabled, int, 0444);
>  MODULE_PARM_DESC(fie_disabled, "Disable Frequency Invariance Engine (FIE)");
>  
> +static DEFINE_MUTEX(cppc_cpufreq_update_autosel_config_lock);

Should this be under CONFIG_ACPI_CPPC_CPUFREQ_FIE?

> +
>  /* Frequency invariance support */
>  struct cppc_freq_invariance {
>  	int cpu;
> @@ -572,6 +575,70 @@ static void cppc_cpufreq_put_cpu_data(struct cpufreq_policy *policy)
>  	policy->driver_data = NULL;
>  }
>  
> +/**
> + * cppc_cpufreq_set_mperf_limit - Generic function to set min/max performance limit
> + * @policy: cpufreq policy
> + * @val: performance value to set
> + * @update_reg: whether to update hardware register
> + * @update_policy: whether to update policy constraints
> + * @is_min: true for min_perf, false for max_perf
> + */
> +static int cppc_cpufreq_set_mperf_limit(struct cpufreq_policy *policy, u64 val,
> +					bool update_reg, bool update_policy, bool is_min)
> +{
> +	struct cppc_cpudata *cpu_data = policy->driver_data;
> +	struct cppc_perf_caps *caps = &cpu_data->perf_caps;
> +	unsigned int cpu = policy->cpu;
> +	struct freq_qos_request *req;
> +	unsigned int freq;
> +	u32 perf;
> +	int ret;
> +
> +	perf = clamp(val, caps->lowest_perf, caps->highest_perf);
> +	freq = cppc_perf_to_khz(caps, perf);
> +
> +	pr_debug("cpu%d, %s_perf:%llu, update_reg:%d, update_policy:%d\n", cpu,
> +		 is_min ? "min" : "max", (u64)perf, update_reg, update_policy);
> +
> +	guard(mutex)(&cppc_cpufreq_update_autosel_config_lock);
> +
> +	if (update_reg) {
> +		ret = is_min ? cppc_set_min_perf(cpu, perf) : cppc_set_max_perf(cpu, perf);
> +		if (ret == -EOPNOTSUPP)
> +			return 0;

Should we return success here? The user will have no feedback that
setting min/max performance limits is not supported.

> +		if (ret) {
> +			pr_warn("Failed to set %s_perf (%llu) on CPU%d (%d)\n",
> +				is_min ? "min" : "max", (u64)perf, cpu, ret);
> +			return ret;
> +		}
> +
> +		/* Update cached value only on success */
> +		if (is_min)
> +			cpu_data->perf_ctrls.min_perf = perf;
> +		else
> +			cpu_data->perf_ctrls.max_perf = perf;
> +	}
> +
> +	if (update_policy) {
> +		req = is_min ? policy->min_freq_req : policy->max_freq_req;
> +
> +		ret = freq_qos_update_request(req, freq);
> +		if (ret < 0) {
> +			pr_warn("Failed to update %s_freq constraint for CPU%d: %d\n",
> +				is_min ? "min" : "max", cpu, ret);
> +			return ret;
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +#define cppc_cpufreq_set_min_perf(policy, val, update_reg, update_policy) \
> +	cppc_cpufreq_set_mperf_limit(policy, val, update_reg, update_policy, true)
> +
> +#define cppc_cpufreq_set_max_perf(policy, val, update_reg, update_policy) \
> +	cppc_cpufreq_set_mperf_limit(policy, val, update_reg, update_policy, false)
> +
>  static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  {
>  	unsigned int cpu = policy->cpu;
> @@ -873,16 +940,64 @@ static ssize_t store_energy_performance_preference_val(struct cpufreq_policy *po
>  	return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_epp, policy->cpu);
>  }
>  
> +static ssize_t show_min_perf(struct cpufreq_policy *policy, char *buf)
> +{
> +	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_min_perf, buf);
> +}
> +
> +static ssize_t store_min_perf(struct cpufreq_policy *policy, const char *buf, size_t count)
> +{
> +	struct cppc_cpudata *cpu_data = policy->driver_data;
> +	u64 val;
> +	int ret;
> +
> +	ret = kstrtou64(buf, 0, &val);
> +	if (ret)
> +		return ret;
> +
> +	ret = cppc_cpufreq_set_min_perf(policy, val, true, cpu_data->perf_caps.auto_sel);
> +	if (ret)
> +		return ret;
> +
> +	return count;
> +}
> +
> +static ssize_t show_max_perf(struct cpufreq_policy *policy, char *buf)
> +{
> +	return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_max_perf, buf);
> +}
> +
> +static ssize_t store_max_perf(struct cpufreq_policy *policy, const char *buf, size_t count)
> +{
> +	struct cppc_cpudata *cpu_data = policy->driver_data;
> +	u64 val;
> +	int ret;
> +
> +	ret = kstrtou64(buf, 0, &val);
> +	if (ret)
> +		return ret;
> +
> +	ret = cppc_cpufreq_set_max_perf(policy, val, true, cpu_data->perf_caps.auto_sel);

These "work" on the performance scale, so the values read are
performance values and the values that should be provided should be
performance values as well. How is the user supposed to know what that
scale is and what is the range of values it can provide? All of the
other sysfs interfaces work on the "frequency" scale and the lowest and
highest performance values are never exposed to the user.

Thanks,
Ionela.

> +	if (ret)
> +		return ret;
> +
> +	return count;
> +}
> +
>  cpufreq_freq_attr_ro(freqdomain_cpus);
>  cpufreq_freq_attr_rw(auto_select);
>  cpufreq_freq_attr_rw(auto_act_window);
>  cpufreq_freq_attr_rw(energy_performance_preference_val);
> +cpufreq_freq_attr_rw(min_perf);
> +cpufreq_freq_attr_rw(max_perf);
>  
>  static struct freq_attr *cppc_cpufreq_attr[] = {
>  	&freqdomain_cpus,
>  	&auto_select,
>  	&auto_act_window,
>  	&energy_performance_preference_val,
> +	&min_perf,
> +	&max_perf,
>  	NULL,
>  };
>  
> diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
> index 3babc6d6e70a..fc7614eb9dcb 100644
> --- a/include/acpi/cppc_acpi.h
> +++ b/include/acpi/cppc_acpi.h
> @@ -39,7 +39,8 @@
>  /* CPPC_AUTO_ACT_WINDOW_MAX_SIG is 127, so 128 and 129 will decay to 127 when writing */
>  #define CPPC_AUTO_ACT_WINDOW_SIG_CARRY_THRESH 129
>  
> -#define CPPC_ENERGY_PERF_MAX	(0xFF)
> +#define CPPC_EPP_PERFORMANCE_PREF		0x00
> +#define CPPC_EPP_ENERGY_EFFICIENCY_PREF		0xFF
>  
>  /* Each register has the folowing format. */
>  struct cpc_reg {
> @@ -172,6 +173,10 @@ extern int cppc_get_auto_act_window(int cpu, u64 *auto_act_window);
>  extern int cppc_set_auto_act_window(int cpu, u64 auto_act_window);
>  extern int cppc_get_auto_sel(int cpu, bool *enable);
>  extern int cppc_set_auto_sel(int cpu, bool enable);
> +extern int cppc_get_min_perf(int cpu, u64 *min_perf);
> +extern int cppc_set_min_perf(int cpu, u64 min_perf);
> +extern int cppc_get_max_perf(int cpu, u64 *max_perf);
> +extern int cppc_set_max_perf(int cpu, u64 max_perf);
>  extern int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf);
>  extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator);
>  extern int amd_detect_prefcore(bool *detected);
> @@ -264,6 +269,22 @@ static inline int cppc_set_auto_sel(int cpu, bool enable)
>  {
>  	return -EOPNOTSUPP;
>  }
> +static inline int cppc_get_min_perf(int cpu, u64 *min_perf)
> +{
> +	return -EOPNOTSUPP;
> +}
> +static inline int cppc_set_min_perf(int cpu, u64 min_perf)
> +{
> +	return -EOPNOTSUPP;
> +}
> +static inline int cppc_get_max_perf(int cpu, u64 *max_perf)
> +{
> +	return -EOPNOTSUPP;
> +}
> +static inline int cppc_set_max_perf(int cpu, u64 max_perf)
> +{
> +	return -EOPNOTSUPP;
> +}
>  static inline int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf)
>  {
>  	return -ENODEV;
> -- 
> 2.34.1
> 
> 

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

* Re: [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  2025-10-01 15:01 ` [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited Sumit Gupta
  2025-10-01 17:03   ` Mario Limonciello
  2025-10-10  3:29   ` Jie Zhan
@ 2025-10-22 12:02   ` Ionela Voinescu
  2025-10-24 13:32     ` Sumit Gupta
  2 siblings, 1 reply; 21+ messages in thread
From: Ionela Voinescu @ 2025-10-22 12:02 UTC (permalink / raw)
  To: Sumit Gupta
  Cc: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel, linux-tegra, treding, jonathanh,
	vsethi, ksitaraman, sanjayc, bbasu

Hi,

On Wednesday 01 Oct 2025 at 20:31:02 (+0530), Sumit Gupta wrote:
> Add sysfs interfaces for Minimum Performance, Maximum Performance
> and Performance Limited Register in the cppc_cpufreq driver.
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> ---
>  .../ABI/testing/sysfs-devices-system-cpu      | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
> index ab8cd337f43a..82141b45d58c 100644
> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
> @@ -327,6 +327,49 @@ Description:	Energy performance preference
>  
>  		This file is only present if the cppc-cpufreq driver is in use.
>  
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/min_perf
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
> +
> +		Read/write a 32 bits value from/to this file. This file
> +		conveys the minimum performance level at which the platform
> +		may run. Minimum performance may be set to any performance
> +		value in the range [Lowest Performance, Highest Performance],
> +		inclusive but must be set to a value that is less than or
> +		equal to that specified by the Maximum Performance Register.
> +
> +		Writing to this file only has meaning when Autonomous Selection
> +		is enabled.

In the ACPI specification I don't see a clear dependency between the
minimum and maximum performance registers and autonomous selection.
There's nothing to say that min and max do not have meaning with
autonomous selection is disabled.

Thanks,
Ionela.

> +
> +		This file is only present if the cppc-cpufreq driver is in use.
> +
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/max_perf
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
> +
> +		Read/write a 32 bits value from/to this file. This file conveys
> +		the maximum performance level at which the platform may run.
> +		Maximum performance may be set to any performance value in the
> +		range [Lowest Performance, Highest Performance], inclusive.
> +
> +		Writing to this file only has meaning when Autonomous Selection is
> +		enabled.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
> +
> +What:		/sys/devices/system/cpu/cpuX/cpufreq/perf_limited
> +Date:		September 2025
> +Contact:	linux-pm@vger.kernel.org
> +Description:	Minimum Performance
> +
> +		Read/write a 32 bits value from/to this file. This file indicates
> +		to OSPM that an unpredictable event has limited processor
> +		performance, and the delivered performance may be less than
> +		desired/minimum performance.
> +
> +		This file is only present if the cppc-cpufreq driver is in use.
>  
>  What:		/sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
>  Date:		August 2008
> -- 
> 2.34.1
> 
> 

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

* Re: [PATCH v3 3/8] ACPI: CPPC: extend APIs to support auto_sel and epp
  2025-10-22  9:12   ` Ionela Voinescu
@ 2025-10-24 13:12     ` Sumit Gupta
  0 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-24 13:12 UTC (permalink / raw)
  To: Ionela Voinescu
  Cc: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel, linux-tegra, treding, jonathanh,
	vsethi, ksitaraman, sanjayc, bbasu, sumitg

Hi Ionela,

Thank you for the comments.


On 22/10/25 14:42, Ionela Voinescu wrote:
> External email: Use caution opening links or attachments
>
>
> Hi Sumit,
>
> On Wednesday 01 Oct 2025 at 20:30:59 (+0530), Sumit Gupta wrote:
>> - Add auto_sel read support in cppc_get_perf_caps().
>> - Add write of both auto_sel and energy_perf in cppc_set_epp_perf().
>> - Remove redundant energy_perf field from 'struct cppc_perf_caps' as
>>    the same is available in 'struct cppc_perf_ctrls' which is used.
>>
>> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
>> ---
> [..]
>> @@ -1555,6 +1559,8 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
>>        struct cpc_register_resource *auto_sel_reg;
>>        struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpu);
>>        struct cppc_pcc_data *pcc_ss_data = NULL;
>> +     bool autosel_support_in_ffh_or_sysmem;
>> +     bool epp_support_in_ffh_or_sysmem;
>>        int ret;
>>
>>        if (!cpc_desc) {
>> @@ -1565,6 +1571,11 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
>>        auto_sel_reg = &cpc_desc->cpc_regs[AUTO_SEL_ENABLE];
>>        epp_set_reg = &cpc_desc->cpc_regs[ENERGY_PERF];
>>
>> +     epp_support_in_ffh_or_sysmem = CPC_SUPPORTED(epp_set_reg) &&
>> +                             (CPC_IN_FFH(epp_set_reg) || CPC_IN_SYSTEM_MEMORY(epp_set_reg));
>> +     autosel_support_in_ffh_or_sysmem = CPC_SUPPORTED(auto_sel_reg) &&
>> +                             (CPC_IN_FFH(auto_sel_reg) || CPC_IN_SYSTEM_MEMORY(auto_sel_reg));
>> +
>>        if (CPC_IN_PCC(epp_set_reg) || CPC_IN_PCC(auto_sel_reg)) {
>>                if (pcc_ss_id < 0) {
>>                        pr_debug("Invalid pcc_ss_id for CPU:%d\n", cpu);
>> @@ -1590,8 +1601,19 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
>>                ret = send_pcc_cmd(pcc_ss_id, CMD_WRITE);
>>                up_write(&pcc_ss_data->pcc_lock);
>>        } else if (osc_cpc_flexible_adr_space_confirmed &&
>> -                CPC_SUPPORTED(epp_set_reg) && CPC_IN_FFH(epp_set_reg)) {
>> +                epp_support_in_ffh_or_sysmem && autosel_support_in_ffh_or_sysmem) {
> Isn't this problematic for when auto-select is an integer set to 1 or it's
> not present at all? In those cases the EPP register won't be written and
> -ENOTSUPP will be returned.
>
> I suppose for the case when auto-select is not present at all in _CPC
> (it's an optional attribute) it's not very clear what one should do
> regarding writing the EPP register. The specification mentions that
> "Writes to this register only have meaning when Autonomous Selection
> is enabled.". From my perspective the OS should not block writes to the
> EPP register for this case, as autonomous selection might still be
> enabled but not exposed to the OS.
>
> Thanks,
> Ionela.

Will change in v4 to write them independently as below.

-------------
         } else if (osc_cpc_flexible_adr_space_confirmed) {
                 if (!epp_support_in_ffh_or_sysmem && 
!autosel_support_in_ffh_or_sysmem) {
                         ret = -ENOTSUPP;
                 } else {
                         if (autosel_support_in_ffh_or_sysmem) {
                                 ret = cpc_write(cpu, auto_sel_reg, enable);
                                 if (ret)
                                         return ret;
                         }

                         if (epp_support_in_ffh_or_sysmem) {
                                 ret = cpc_write(cpu, epp_set_reg, 
perf_ctrls->energy_perf);
                                 if (ret)
                                         return ret;
                         }
                 }
         } else {
                 ret = -ENOTSUPP;
         }

         if (ret == -ENOTSUPP)
                 pr_debug("_CPC in PCC and _CPC in FFH are not 
supported\n");

-------------

Thank you,
Sumit Gupta


>> +             ret = cpc_write(cpu, auto_sel_reg, enable);
>> +             if (ret) {
>> +                     pr_debug("Failed to write auto_sel=%d for CPU:%d\n", enable, cpu);
>> +                     return ret;
>> +             }
>> +
>>                ret = cpc_write(cpu, epp_set_reg, perf_ctrls->energy_perf);
>> +             if (ret) {
>> +                     pr_debug("Failed to write energy_perf=%u for CPU:%d\n",
>> +                              perf_ctrls->energy_perf, cpu);
>> +                     return ret;
>> +             }
>>        } else {
>>                ret = -ENOTSUPP;
>>                pr_debug("_CPC in PCC and _CPC in FFH are not supported\n");
> [..]

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

* Re: [PATCH v3 4/8] ACPI: CPPC: add APIs and sysfs interface for min/max_perf
  2025-10-22 10:58   ` Ionela Voinescu
@ 2025-10-24 13:22     ` Sumit Gupta
  0 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-24 13:22 UTC (permalink / raw)
  To: Ionela Voinescu
  Cc: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel, linux-tegra, treding, jonathanh,
	vsethi, ksitaraman, sanjayc, bbasu, sumitg


On 22/10/25 16:28, Ionela Voinescu wrote:
> External email: Use caution opening links or attachments
>
>
> On Wednesday 01 Oct 2025 at 20:31:00 (+0530), Sumit Gupta wrote:
>> CPPC allows platforms to specify minimum and maximum performance
>> limits that constrain the operating range for CPU performance scaling
>> when Autonomous Selection is enabled. These limits can be dynamically
>> adjusted to implement power management policies or workload-specific
>> optimizations.
>>
>> Add cppc_get_min_perf() and cppc_set_min_perf() functions to read and
>> write the MIN_PERF register, allowing dynamic adjustment of the minimum
>> performance floor.
>>
>> Add cppc_get_max_perf() and cppc_set_max_perf() functions to read and
>> write the MAX_PERF register, enabling dynamic ceiling control for
>> maximum performance.
>>
>> Expose these capabilities through cpufreq sysfs attributes:
>> - /sys/.../cpufreq/policy*/min_perf: Read/write min performance limit
>> - /sys/.../cpufreq/policy*/max_perf: Read/write max performance limit
>>
>> Also update EPP constants for better clarity:
>> - Rename CPPC_ENERGY_PERF_MAX to CPPC_EPP_ENERGY_EFFICIENCY_PREF
>> - Add CPPC_EPP_PERFORMANCE_PREF for the performance-oriented setting
>>
>> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
>> ---
>>   drivers/acpi/cppc_acpi.c       |  55 +++++++++++++++-
>>   drivers/cpufreq/cppc_cpufreq.c | 115 +++++++++++++++++++++++++++++++++
>>   include/acpi/cppc_acpi.h       |  23 ++++++-
>>   3 files changed, 191 insertions(+), 2 deletions(-)
>>
> [..]
>> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
>> index 732f35096991..864978674efc 100644
>> --- a/drivers/cpufreq/cppc_cpufreq.c
>> +++ b/drivers/cpufreq/cppc_cpufreq.c
>> @@ -23,6 +23,7 @@
>>   #include <uapi/linux/sched/types.h>
>>
>>   #include <linux/unaligned.h>
>> +#include <linux/cleanup.h>
>>
>>   #include <acpi/cppc_acpi.h>
>>
>> @@ -38,6 +39,8 @@ static enum {
>>   module_param(fie_disabled, int, 0444);
>>   MODULE_PARM_DESC(fie_disabled, "Disable Frequency Invariance Engine (FIE)");
>>
>> +static DEFINE_MUTEX(cppc_cpufreq_update_autosel_config_lock);
> Should this be under CONFIG_ACPI_CPPC_CPUFREQ_FIE? 

Thank you for catching. Will move it outside in v4.


>> +
>>   /* Frequency invariance support */
>>   struct cppc_freq_invariance {
>>        int cpu;
>> @@ -572,6 +575,70 @@ static void cppc_cpufreq_put_cpu_data(struct cpufreq_policy *policy)
>>        policy->driver_data = NULL;
>>   }
>>
>> +/**
>> + * cppc_cpufreq_set_mperf_limit - Generic function to set min/max performance limit
>> + * @policy: cpufreq policy
>> + * @val: performance value to set
>> + * @update_reg: whether to update hardware register
>> + * @update_policy: whether to update policy constraints
>> + * @is_min: true for min_perf, false for max_perf
>> + */
>> +static int cppc_cpufreq_set_mperf_limit(struct cpufreq_policy *policy, u64 val,
>> +                                     bool update_reg, bool update_policy, bool is_min)
>> +{
>> +     struct cppc_cpudata *cpu_data = policy->driver_data;
>> +     struct cppc_perf_caps *caps = &cpu_data->perf_caps;
>> +     unsigned int cpu = policy->cpu;
>> +     struct freq_qos_request *req;
>> +     unsigned int freq;
>> +     u32 perf;
>> +     int ret;
>> +
>> +     perf = clamp(val, caps->lowest_perf, caps->highest_perf);
>> +     freq = cppc_perf_to_khz(caps, perf);
>> +
>> +     pr_debug("cpu%d, %s_perf:%llu, update_reg:%d, update_policy:%d\n", cpu,
>> +              is_min ? "min" : "max", (u64)perf, update_reg, update_policy);
>> +
>> +     guard(mutex)(&cppc_cpufreq_update_autosel_config_lock);
>> +
>> +     if (update_reg) {
>> +             ret = is_min ? cppc_set_min_perf(cpu, perf) : cppc_set_max_perf(cpu, perf);
>> +             if (ret == -EOPNOTSUPP)
>> +                     return 0;
> Should we return success here? The user will have no feedback that
> setting min/max performance limits is not supported. 

Will do change in v4 to also return EOPNOTSUPP error code to the caller.


>> +             if (ret) {
>> +                     pr_warn("Failed to set %s_perf (%llu) on CPU%d (%d)\n",
>> +                             is_min ? "min" : "max", (u64)perf, cpu, ret);
>> +                     return ret;
>> +             }
>> +
>> +             /* Update cached value only on success */
>> +             if (is_min)
>> +                     cpu_data->perf_ctrls.min_perf = perf;
>> +             else
>> +                     cpu_data->perf_ctrls.max_perf = perf;
>> +     }
>> +
>> +     if (update_policy) {
>> +             req = is_min ? policy->min_freq_req : policy->max_freq_req;
>> +
>> +             ret = freq_qos_update_request(req, freq);
>> +             if (ret < 0) {
>> +                     pr_warn("Failed to update %s_freq constraint for CPU%d: %d\n",
>> +                             is_min ? "min" : "max", cpu, ret);
>> +                     return ret;
>> +             }
>> +     }
>> +
>> +     return 0;
>> +}
>> +
>> +#define cppc_cpufreq_set_min_perf(policy, val, update_reg, update_policy) \
>> +     cppc_cpufreq_set_mperf_limit(policy, val, update_reg, update_policy, true)
>> +
>> +#define cppc_cpufreq_set_max_perf(policy, val, update_reg, update_policy) \
>> +     cppc_cpufreq_set_mperf_limit(policy, val, update_reg, update_policy, false)
>> +
>>   static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
>>   {
>>        unsigned int cpu = policy->cpu;
>> @@ -873,16 +940,64 @@ static ssize_t store_energy_performance_preference_val(struct cpufreq_policy *po
>>        return cppc_cpufreq_sysfs_store_u64(buf, count, cppc_set_epp, policy->cpu);
>>   }
>>
>> +static ssize_t show_min_perf(struct cpufreq_policy *policy, char *buf)
>> +{
>> +     return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_min_perf, buf);
>> +}
>> +
>> +static ssize_t store_min_perf(struct cpufreq_policy *policy, const char *buf, size_t count)
>> +{
>> +     struct cppc_cpudata *cpu_data = policy->driver_data;
>> +     u64 val;
>> +     int ret;
>> +
>> +     ret = kstrtou64(buf, 0, &val);
>> +     if (ret)
>> +             return ret;
>> +
>> +     ret = cppc_cpufreq_set_min_perf(policy, val, true, cpu_data->perf_caps.auto_sel);
>> +     if (ret)
>> +             return ret;
>> +
>> +     return count;
>> +}
>> +
>> +static ssize_t show_max_perf(struct cpufreq_policy *policy, char *buf)
>> +{
>> +     return cppc_cpufreq_sysfs_show_u64(policy->cpu, cppc_get_max_perf, buf);
>> +}
>> +
>> +static ssize_t store_max_perf(struct cpufreq_policy *policy, const char *buf, size_t count)
>> +{
>> +     struct cppc_cpudata *cpu_data = policy->driver_data;
>> +     u64 val;
>> +     int ret;
>> +
>> +     ret = kstrtou64(buf, 0, &val);
>> +     if (ret)
>> +             return ret;
>> +
>> +     ret = cppc_cpufreq_set_max_perf(policy, val, true, cpu_data->perf_caps.auto_sel);
> These "work" on the performance scale, so the values read are
> performance values and the values that should be provided should be
> performance values as well. How is the user supposed to know what that
> scale is and what is the range of values it can provide? All of the
> other sysfs interfaces work on the "frequency" scale and the lowest and
> highest performance values are never exposed to the user.
>
> Thanks,
> Ionela.

Can do the change in v4 for these nodes to get min/max freq value from 
user, convert
that to perf with cppc_khz_to_perf() before write to min/max_perf 
registers and vice-versa.
That will keep the scale same as other cpufreq sysfs interfaces.


>> +     if (ret)
>> +             return ret;
>> +
>> +     return count;
>> +}
>> +
>>   cpufreq_freq_attr_ro(freqdomain_cpus);
>>   cpufreq_freq_attr_rw(auto_select);
>>   cpufreq_freq_attr_rw(auto_act_window);
>>   cpufreq_freq_attr_rw(energy_performance_preference_val);
>> +cpufreq_freq_attr_rw(min_perf);
>> +cpufreq_freq_attr_rw(max_perf);
>>
>>   static struct freq_attr *cppc_cpufreq_attr[] = {
>>        &freqdomain_cpus,
>>        &auto_select,
>>        &auto_act_window,
>>        &energy_performance_preference_val,
>> +     &min_perf,
>> +     &max_perf,
>>        NULL,
>>   };
>>
>> diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
>> index 3babc6d6e70a..fc7614eb9dcb 100644
>> --- a/include/acpi/cppc_acpi.h
>> +++ b/include/acpi/cppc_acpi.h
>> @@ -39,7 +39,8 @@
>>   /* CPPC_AUTO_ACT_WINDOW_MAX_SIG is 127, so 128 and 129 will decay to 127 when writing */
>>   #define CPPC_AUTO_ACT_WINDOW_SIG_CARRY_THRESH 129
>>
>> -#define CPPC_ENERGY_PERF_MAX (0xFF)
>> +#define CPPC_EPP_PERFORMANCE_PREF            0x00
>> +#define CPPC_EPP_ENERGY_EFFICIENCY_PREF              0xFF
>>
>>   /* Each register has the folowing format. */
>>   struct cpc_reg {
>> @@ -172,6 +173,10 @@ extern int cppc_get_auto_act_window(int cpu, u64 *auto_act_window);
>>   extern int cppc_set_auto_act_window(int cpu, u64 auto_act_window);
>>   extern int cppc_get_auto_sel(int cpu, bool *enable);
>>   extern int cppc_set_auto_sel(int cpu, bool enable);
>> +extern int cppc_get_min_perf(int cpu, u64 *min_perf);
>> +extern int cppc_set_min_perf(int cpu, u64 min_perf);
>> +extern int cppc_get_max_perf(int cpu, u64 *max_perf);
>> +extern int cppc_set_max_perf(int cpu, u64 max_perf);
>>   extern int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf);
>>   extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator);
>>   extern int amd_detect_prefcore(bool *detected);
>> @@ -264,6 +269,22 @@ static inline int cppc_set_auto_sel(int cpu, bool enable)
>>   {
>>        return -EOPNOTSUPP;
>>   }
>> +static inline int cppc_get_min_perf(int cpu, u64 *min_perf)
>> +{
>> +     return -EOPNOTSUPP;
>> +}
>> +static inline int cppc_set_min_perf(int cpu, u64 min_perf)
>> +{
>> +     return -EOPNOTSUPP;
>> +}
>> +static inline int cppc_get_max_perf(int cpu, u64 *max_perf)
>> +{
>> +     return -EOPNOTSUPP;
>> +}
>> +static inline int cppc_set_max_perf(int cpu, u64 max_perf)
>> +{
>> +     return -EOPNOTSUPP;
>> +}
>>   static inline int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf)
>>   {
>>        return -ENODEV;
>> --
>> 2.34.1
>>
>>

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

* Re: [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited
  2025-10-22 12:02   ` Ionela Voinescu
@ 2025-10-24 13:32     ` Sumit Gupta
  0 siblings, 0 replies; 21+ messages in thread
From: Sumit Gupta @ 2025-10-24 13:32 UTC (permalink / raw)
  To: Ionela Voinescu
  Cc: rafael, viresh.kumar, lenb, robert.moore, corbet, pierre.gondois,
	zhenglifeng1, rdunlap, ray.huang, gautham.shenoy,
	mario.limonciello, perry.yuan, linux-pm, linux-acpi, linux-doc,
	acpica-devel, linux-kernel, linux-tegra, treding, jonathanh,
	vsethi, ksitaraman, sanjayc, bbasu, sumitg


On 22/10/25 17:32, Ionela Voinescu wrote:
> External email: Use caution opening links or attachments
>
>
> Hi,
>
> On Wednesday 01 Oct 2025 at 20:31:02 (+0530), Sumit Gupta wrote:
>> Add sysfs interfaces for Minimum Performance, Maximum Performance
>> and Performance Limited Register in the cppc_cpufreq driver.
>>
>> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
>> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
>> ---
>>   .../ABI/testing/sysfs-devices-system-cpu      | 43 +++++++++++++++++++
>>   1 file changed, 43 insertions(+)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
>> index ab8cd337f43a..82141b45d58c 100644
>> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
>> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
>> @@ -327,6 +327,49 @@ Description:     Energy performance preference
>>
>>                This file is only present if the cppc-cpufreq driver is in use.
>>
>> +What:                /sys/devices/system/cpu/cpuX/cpufreq/min_perf
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
>> +
>> +             Read/write a 32 bits value from/to this file. This file
>> +             conveys the minimum performance level at which the platform
>> +             may run. Minimum performance may be set to any performance
>> +             value in the range [Lowest Performance, Highest Performance],
>> +             inclusive but must be set to a value that is less than or
>> +             equal to that specified by the Maximum Performance Register.
>> +
>> +             Writing to this file only has meaning when Autonomous Selection
>> +             is enabled.
> In the ACPI specification I don't see a clear dependency between the
> minimum and maximum performance registers and autonomous selection.
> There's nothing to say that min and max do not have meaning with
> autonomous selection is disabled.
>
> Thanks,
> Ionela. 

Yes, will remove the text about dependency on autonomous selection in v4.

Thank you,
Sumit Gupta


>> +
>> +             This file is only present if the cppc-cpufreq driver is in use.
>> +
>> +What:                /sys/devices/system/cpu/cpuX/cpufreq/max_perf
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
>> +
>> +             Read/write a 32 bits value from/to this file. This file conveys
>> +             the maximum performance level at which the platform may run.
>> +             Maximum performance may be set to any performance value in the
>> +             range [Lowest Performance, Highest Performance], inclusive.
>> +
>> +             Writing to this file only has meaning when Autonomous Selection is
>> +             enabled.
>> +
>> +             This file is only present if the cppc-cpufreq driver is in use.
>> +
>> +What:                /sys/devices/system/cpu/cpuX/cpufreq/perf_limited
>> +Date:                September 2025
>> +Contact:     linux-pm@vger.kernel.org
>> +Description: Minimum Performance
>> +
>> +             Read/write a 32 bits value from/to this file. This file indicates
>> +             to OSPM that an unpredictable event has limited processor
>> +             performance, and the delivered performance may be less than
>> +             desired/minimum performance.
>> +
>> +             This file is only present if the cppc-cpufreq driver is in use.
>>
>>   What:                /sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}
>>   Date:                August 2008
>> --
>> 2.34.1
>>
>>

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

end of thread, other threads:[~2025-10-24 13:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01 15:00 [PATCH v3 0/8] Enhanced autonomous selection and improvements Sumit Gupta
2025-10-01 15:00 ` [PATCH v3 1/8] cpufreq: CPPC: Add generic helpers for sysfs show/store Sumit Gupta
2025-10-10  3:24   ` Jie Zhan
2025-10-13 12:51     ` Sumit Gupta
2025-10-01 15:00 ` [PATCH v3 2/8] ACPI: CPPC: Add cppc_get_perf() API to read performance controls Sumit Gupta
2025-10-01 15:00 ` [PATCH v3 3/8] ACPI: CPPC: extend APIs to support auto_sel and epp Sumit Gupta
2025-10-22  9:12   ` Ionela Voinescu
2025-10-24 13:12     ` Sumit Gupta
2025-10-01 15:01 ` [PATCH v3 4/8] ACPI: CPPC: add APIs and sysfs interface for min/max_perf Sumit Gupta
2025-10-22 10:58   ` Ionela Voinescu
2025-10-24 13:22     ` Sumit Gupta
2025-10-01 15:01 ` [PATCH v3 5/8] ACPI: CPPC: add APIs and sysfs interface for perf_limited register Sumit Gupta
2025-10-01 15:01 ` [PATCH v3 6/8] cpufreq: CPPC: Add sysfs for min/max_perf and perf_limited Sumit Gupta
2025-10-01 17:03   ` Mario Limonciello
2025-10-08 10:16     ` Sumit Gupta
2025-10-10  3:29   ` Jie Zhan
2025-10-13 11:59     ` Sumit Gupta
2025-10-22 12:02   ` Ionela Voinescu
2025-10-24 13:32     ` Sumit Gupta
2025-10-01 15:01 ` [PATCH v3 7/8] cpufreq: CPPC: update policy min/max when toggling auto_select Sumit Gupta
2025-10-01 15:01 ` [PATCH v3 8/8] cpufreq: CPPC: add autonomous mode boot parameter support Sumit Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).