Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v5 0/8] Support for autonomous selection in cppc_cpufreq
@ 2025-02-06 13:14 Lifeng Zheng
  2025-02-06 13:14 ` [PATCH v5 1/8] ACPI: CPPC: Add IS_OPTIONAL_CPC_REG macro to judge if a cpc_reg is optional Lifeng Zheng
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Lifeng Zheng @ 2025-02-06 13:14 UTC (permalink / raw)
  To: rafael, lenb, robert.moore, viresh.kumar, mario.limonciello,
	gautham.shenoy, ray.huang, pierre.gondois
  Cc: acpica-devel, linux-acpi, linux-kernel, linux-pm, linuxarm,
	yumpusamongus, srinivas.pandruvada, jonathan.cameron, zhanjie9,
	lihuisong, zhenglifeng1, hepeng68, fanghao11

Add sysfs interfaces for CPPC autonomous selection in the cppc_cpufreq
driver.

The patch series is organized in two parts:

 - patch 1-5 refactor out the general CPPC register get and set functions
   in cppc_acpi.c

 - patches 6-8 expose sysfs files for users to control CPPC autonomous
   selection when supported

Changelog:

v5:

 - add more explanation to the commit logs and comments
 - change REG_OPTIONAL from bin to hex
 - split patch 2 into 3 smaller patches
 - remove CPPC_REG_VAL_READ() and CPPC_REG_VAL_WRITE() macros
 - move the modification part in patch 5 into a separate patch
 - rename the sysfs file from "energy_perf" to
   energy_performance_preference_val

v4:

 - add REG_OPTIONAL and IS_OPTIONAL_CPC_REG to judge if a cpc register is
   an optional one
 - check whether the register is optional before CPC_SUPPORTED check in
   cppc_get_reg_val() and cppc_set_reg_val()
 - check the register's type in cppc_set_reg_val()
 - add macros to generally implement registers getting and setting
   functions
 - move some logic codes from cppc_cpufreq.c to cppc_acpi.c
 - replace cppc_get_auto_sel_caps() by cppc_get_auto_sel()

v3:

 - change cppc_get_reg() and cppc_set_reg() name to cppc_get_reg_val() and
   cppc_set_reg_val()
 - extract cppc_get_reg_val_in_pcc() and cppc_set_reg_val_in_pcc()
 - return the result of cpc_read() in cppc_get_reg_val()
 - add pr_debug() in cppc_get_reg_val_in_pcc() when pcc_ss_id < 0
 - rename 'cpunum' to 'cpu' in cppc_get_reg_val()
 - move some macros from drivers/cpufreq/cppc_cpufreq.c to
   include/acpi/cppc_acpi.h with a CPPC_XXX prefix

v2:

 - fix some incorrect placeholder
 - change kstrtoul to kstrtobool in store_auto_select

Lifeng Zheng (8):
  ACPI: CPPC: Add IS_OPTIONAL_CPC_REG macro to judge if a cpc_reg is
    optional
  ACPI: CPPC: Optimize cppc_get_perf()
  ACPI: CPPC: Rename cppc_get_perf() to cppc_get_reg_val()
  ACPI: CPPC: Add cppc_set_reg_val()
  ACPI: CPPC: Refactor register value get and set ABIs
  ACPI: CPPC: Modify cppc_get_auto_sel_caps() to cppc_get_auto_sel()
  ACPI: CPPC: Add three functions related to autonomous selection
  cpufreq: CPPC: Support for autonomous selection in cppc_cpufreq

 .../ABI/testing/sysfs-devices-system-cpu      |  54 ++++
 drivers/acpi/cppc_acpi.c                      | 303 +++++++++++-------
 drivers/cpufreq/amd-pstate.c                  |   3 +-
 drivers/cpufreq/cppc_cpufreq.c                | 109 +++++++
 include/acpi/cppc_acpi.h                      |  30 +-
 5 files changed, 372 insertions(+), 127 deletions(-)

-- 
2.33.0


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

end of thread, other threads:[~2025-03-21  1:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 13:14 [PATCH v5 0/8] Support for autonomous selection in cppc_cpufreq Lifeng Zheng
2025-02-06 13:14 ` [PATCH v5 1/8] ACPI: CPPC: Add IS_OPTIONAL_CPC_REG macro to judge if a cpc_reg is optional Lifeng Zheng
2025-02-06 13:14 ` [PATCH v5 2/8] ACPI: CPPC: Optimize cppc_get_perf() Lifeng Zheng
2025-02-06 13:14 ` [PATCH v5 3/8] ACPI: CPPC: Rename cppc_get_perf() to cppc_get_reg_val() Lifeng Zheng
2025-03-12 19:54   ` Rafael J. Wysocki
2025-03-14  9:24     ` zhenglifeng (A)
2025-03-14 10:32       ` Rafael J. Wysocki
2025-03-21  1:45         ` zhenglifeng (A)
2025-02-06 13:14 ` [PATCH v5 4/8] ACPI: CPPC: Add cppc_set_reg_val() Lifeng Zheng
2025-02-06 13:14 ` [PATCH v5 5/8] ACPI: CPPC: Refactor register value get and set ABIs Lifeng Zheng
2025-02-06 13:14 ` [PATCH v5 6/8] ACPI: CPPC: Modify cppc_get_auto_sel_caps() to cppc_get_auto_sel() Lifeng Zheng
2025-02-06 13:14 ` [PATCH v5 7/8] ACPI: CPPC: Add three functions related to autonomous selection Lifeng Zheng
2025-02-06 13:14 ` [PATCH v5 8/8] cpufreq: CPPC: Support for autonomous selection in cppc_cpufreq Lifeng Zheng
2025-02-06 13:16 ` [PATCH v5 0/8] " zhenglifeng (A)
2025-02-13  1:55 ` zhenglifeng (A)
2025-02-18 19:17   ` Rafael J. Wysocki
2025-02-22 10:07     ` zhenglifeng (A)
2025-02-24 10:31       ` Pierre Gondois
2025-02-24 12:49         ` zhenglifeng (A)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox