CPUFreq driver using CPPC methods
Subsystems (8)
v6 cover CPUFreq driver using CPPC methods
CPPC:
====
CPPC (Collaborative Processor Performance Control) is a new way to control CPU performance using an abstract continous scale as against a discretized P-state scale which is tied to CPU frequency only. It is defined in the ACPI 5.0+ spec. In brief, the basic operation involves:
- OS makes a CPU performance request. (Can provide min and max tolerable bounds)
- Platform (such as BMC) is free to optimize request within requested bounds depending on power/thermal budgets etc.
- Platform conveys its decision back to OS
The communication between OS and platform occurs through another medium called (PCC) Platform communication Channel. This is a generic mailbox like mechanism which includes doorbell semantics to indicate register updates. See drivers/mailbox/pcc.c
This patchset introduces a CPPC based CPUFreq driver that works with existing governors such as ondemand. The CPPC table parsing and the CPPC communication semantics are abstracted into separate files to allow future CPPC based drivers to implement their own governors if required.
Initial patchsets included an adaptation of the PID governor from intel_pstate.c. However recent experiments led to extensive modifications of the algorithm to calculate CPU busyness. Until it is verified that these changes are worthwhile, the existing governors should provide for a good enough starting point for ARM64 servers.
Finer details about the PCC and CPPC spec are available in the latest ACPI 5.1 specification.[2]
Testing:
=======
This was tested on an SBSA compatible ARMv8 server with CPPCv2 firmware running on a remote processor. I verified that each CPUs performance limits were detected and that new performance requests were made by the on-demand governor proportional to the load on each CPU. I also verified that using the acpi_processor driver correctly maps the physical CPU ids to logical CPU ids, which helps in picking up the proper _CPC details from a processor object, in the case where CPU physical ids may not be contiguous.
Changes since V5:
- Checkpatch cleanups.
- Change pss_init to pss_perf_init. Rec by Srinivas Pandruvada.
- Explicit comment explaining why postcore_initcall to pcc mailbox.
- Fold acpi_processor_syscore_init/exit into CONFIG_ACPI_CST.
- Added patch with dummy functions used by ACPI_HOTPLUG_CPU.
Changes since V4:
- Misc cleanups. Addressed feedback from Rafael.
- Made acpi_processor.c independent of C-states, P-states and others.
- Per CPU scanning for _CPC is now made from acpi_processor.c
- Added new Kconfig options for legacy C states and P states to enable future support for newer alternatives as defined in the ACPI spec 6.0.
Changes since V3:
- Split CPPC backend methods into separate files.
- Add frontend driver which plugs into existing CPUfreq governors.
- Simplify PCC driver by moving communication space mapping and read/write into client drivers.
Changes since V2:
- Select driver if !X86, since intel_pstate will use HWP extensions instead.
- Added more comments.
- Added Freq domain awareness and PSD parsing.
Changes since V1:
- Create a new driver based on Dirks suggestion.
- Fold in CPPC backend hooks into main driver.
Changes since V0: [1]
- Split intel_pstate.c into a generic PID governor and platform specific backend.
- Add CPPC accessors as PID backend.
[1] - http://lwn.net/Articles/608715/
[2] - http://www.uefi.org/sites/default/files/resources/ACPI_5_1release.pdf
[3] - https://patches.linaro.org/40705/
Ashwin Chaugule (7):
PCC: Initialize PCC Mailbox earlier at boot
ACPI: Make ACPI processor driver more extensible
ACPI: Introduce CPU performance controls using CPPC
CPPC: Add a CPUFreq driver for use with CPPC
CPPC: Probe for CPPC tables for each ACPI Processor object
PCC: Enable PCC only when needed
ACPI: Add weak routines for ACPI CPU Hotplug
drivers/acpi/Kconfig | 48 ++- drivers/acpi/Makefile | 8 +- drivers/acpi/acpi_processor.c | 18 + drivers/acpi/cppc_acpi.c | 812 ++++++++++++++++++++++++++++++++++++++++ drivers/acpi/processor_driver.c | 90 +++-- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.arm | 16 + drivers/cpufreq/Kconfig.x86 | 2 + drivers/cpufreq/Makefile | 2 + drivers/cpufreq/cppc_cpufreq.c | 197 ++++++++++ drivers/mailbox/Kconfig | 2 +- drivers/mailbox/pcc.c | 8 +- include/acpi/cppc_acpi.h | 137 +++++++ include/acpi/processor.h | 129 +++++-- 14 files changed, 1397 insertions(+), 74 deletions(-) create mode 100644 drivers/acpi/cppc_acpi.c create mode 100644 drivers/cpufreq/cppc_cpufreq.c create mode 100644 include/acpi/cppc_acpi.h
Signature · 1 line
1.9.1
PATCH v6 1/7 PCC: Initialize PCC Mailbox earlier at boot
This change initializes the PCC Mailbox earlier than the ACPI processor driver. This enables drivers introduced in follow up patches (e.g. CPPC) to be probed via the ACPI processor driver interface. The CPPC probe requires the PCC channel to be initialized for it to query each CPUs performance capabilities.
--- drivers/mailbox/pcc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mailbox/pcc.c +7 -1
@@ -352,4 +352,10 @@ static int __init pcc_init(void)return 0 ; } -device_initcall (pcc_init); + +/* +* Make pcc init postcore so that users of this mailbox +* such as the ACPI Processor driver have it available +* at their init. +*/ +postcore_initcall (pcc_init);
Signature · 1 line
1.9.1
PATCH v6 2/7 ACPI: Make ACPI processor driver more extensible
In reply to Ashwin ChauguleThe ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new Kconfig symbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.
The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)
drivers/acpi/Kconfig +26 -5
@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver" + depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers. +config ACPI_PROCESSOR + tristate "Processor" + depends on X86 || IA64 + default y + help + This driver adds support for the ACPI Processor package. It is required + by several flavors of cpufreq performance-state, thermal, throttling and + idle drivers. + To compile this driver as a module, choose M here: the module will be called processor.
drivers/acpi/Makefile +4 -3
@@ -82,9 +82,10 @@ obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o obj-$(CONFIG_ACPI_BGRT) += bgrt.o # processor has its own "processor." module_param namespace -processor-y := processor_driver.o processor_throttling.o -processor-y += processor_idle.o processor_thermal.o -processor-$(CONFIG_CPU_FREQ) += processor_perflib.o +processor-y := processor_driver.o +processor-$(CONFIG_ACPI_CST) += processor_idle.o +processor-$(CONFIG_ACPI_PSS) += processor_perflib.o \ + processor_throttling.o processor_thermal.o obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
drivers/acpi/processor_driver.c +58 -28
130 lines not on this page · raw message
drivers/cpufreq/Kconfig +1 -1
@@ -223,7 +223,7 @@ endif if IA64 config IA64_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" - depends on ACPI_PROCESSOR + depends on ACPI_PROCESSOR && ACPI_PSS && ACPI_CST help This driver adds a CPUFreq driver which utilizes the ACPI Processor Performance States.
drivers/cpufreq/Kconfig.x86 +2 -0
@@ -18,6 +18,7 @@ config X86_INTEL_PSTATE config X86_PCC_CPUFREQ tristate "Processor Clocking Control interface driver" depends on ACPI && ACPI_PROCESSOR + depends on ACPI_PSS && ACPI_CST help This driver adds support for the PCC interface.
@@ -32,6 +33,7 @@ config X86_PCC_CPUFREQ config X86_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" depends on ACPI_PROCESSOR + depends on ACPI_PSS && ACPI_CST help This driver adds a CPUFreq driver which utilizes the ACPI Processor Performance States.
include/acpi/processor.h +85 -35
183 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"
drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.
For starters, I don't like these new Kconfig options.
Isn't there a way to implement what you need without adding them?
Rafael
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 70 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.
Quoted 1 line
Isn't there a way to implement what you need without adding them?
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue. I considered the alternative of adding a probe routine which matches ACPI_PROCESSOR_OBJECT/DEVICE_HID to each driver, but this seemed like a better option. Do you have any other ideas?
Thanks,
Ashwin.
Rafael J. Wysocki
maintainerRe: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Hi Ashwin,
Quoted 71 lines · Ashwin Chaugule
Quoted 70 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.
Quoted 8 lines
Quoted 1 line
Isn't there a way to implement what you need without adding them?
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue. I considered the alternative of adding a probe routine which matches ACPI_PROCESSOR_OBJECT/DEVICE_HID to each driver, but this seemed like a better option. Do you have any other ideas?
First of all, I don't see what _CST has to do with CPPC.
Second, it looks like the problem is that x86 probably won't use CPPC, while arm64 probably won't use _PSS.
That can be addressed by adding Kconfig options, but those options should not be user-selectable (because quite honestly users don't have to know what those things are and they don't care *and* things break if they make a wrong choice). Instead, I'd make architecture Kconfigs select those options automatically.
Thanks,
Rafael
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Hello,
Quoted 77 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 73 lines · Ashwin Chaugule
Quoted 71 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.Isn't there a way to implement what you need without adding them?
Quoted 8 lines
Quoted 6 lines
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue. I considered the alternative of adding a probe routine which matches ACPI_PROCESSOR_OBJECT/DEVICE_HID to each driver, but this seemed like a better option. Do you have any other ideas?
First of all, I don't see what
_CSThas to do with CPPC.
Agree, it doesn't. I was implying that the current acpi processor driver is tied to CST as well. CST and CPPC can co-exist. But Sudeep's LPI patchwork would need to separate CST out of the processor driver anyway. He actually proposed a similar-ish solution a while back.
Quoted 3 lines
Second, it looks like the problem is that x86 probably won't use CPPC, while arm64 probably won't use
_PSS.
Yep.
Quoted 6 lines
That can be addressed by adding
Kconfigoptions, but those options should not be user-selectable (because quite honestly users don't have to know what those things are and they don't care *and* things break if they make a wrong choice). Instead, I'd make architecture Kconfigs select those options automatically.
Ok. I'll look into moving these config options into the ARCH_HAS_ .. sort of variants.
Thanks,
Ashwin.
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
In reply to Rafael J. WysockiHi Rafael,
Quoted 86 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 71 lines · Ashwin Chaugule
Quoted 70 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.Quoted 8 lines
Quoted 1 line
Isn't there a way to implement what you need without adding them?
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue. I considered the alternative of adding a probe routine which matches ACPI_PROCESSOR_OBJECT/DEVICE_HID to each driver, but this seemed like a better option. Do you have any other ideas?
First of all, I don't see what
_CSThas to do with CPPC.
Quoted 9 lines
Second, it looks like the problem is that x86 probably won't use CPPC, while arm64 probably won't use
_PSS.That can be addressed by adding
Kconfigoptions, but those options should not be user-selectable (because quite honestly users don't have to know what those things are and they don't care *and* things break if they make a wrong choice). Instead, I'd make architecture Kconfigs select those options automatically.
I've made changes locally. Basically s/ACPI_PSS/HAVE_ACPI_PSS/ and in arch/x86/Kconfig; select HAVE_ACPI_PSS if ACPI. Similarly for CST. Just wanted to check if there were any other comments before sending out v7.
Thanks,
Ashwin.
Rafael J. Wysocki
maintainerRe: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Hi Ashwin,
Quoted 99 lines · Ashwin Chaugule
Hi Rafael,
Quoted 86 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 71 lines · Ashwin Chaugule
Quoted 70 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.Quoted 8 lines
Quoted 1 line
Isn't there a way to implement what you need without adding them?
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue. I considered the alternative of adding a probe routine which matches ACPI_PROCESSOR_OBJECT/DEVICE_HID to each driver, but this seemed like a better option. Do you have any other ideas?
First of all, I don't see what
_CSThas to do with CPPC.Quoted 9 lines
Second, it looks like the problem is that x86 probably won't use CPPC, while arm64 probably won't use
_PSS.That can be addressed by adding
Kconfigoptions, but those options should not be user-selectable (because quite honestly users don't have to know what those things are and they don't care *and* things break if they make a wrong choice). Instead, I'd make architecture Kconfigs select those options automatically.
Quoted 4 lines
I've made changes locally. Basically s/ACPI_PSS/HAVE_ACPI_PSS/ and in
arch/x86/Kconfig; selectHAVE_ACPI_PSSif ACPI. Similarly for CST. Just wanted to check if there were any other comments before sending out v7.
Can you please just send the new version of the $subject patch alone for now?
Also I'm still unsure what the connection between _CST and CPPC is.
Thanks,
Rafael
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 103 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 99 lines · Ashwin Chaugule
Hi Rafael,
Quoted 95 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 71 lines · Ashwin Chaugule
Quoted 70 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.Quoted 8 lines
Quoted 1 line
Isn't there a way to implement what you need without adding them?
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue. I considered the alternative of adding a probe routine which matches ACPI_PROCESSOR_OBJECT/DEVICE_HID to each driver, but this seemed like a better option. Do you have any other ideas?
First of all, I don't see what
_CSThas to do with CPPC.Second, it looks like the problem is that x86 probably won't use CPPC, while arm64 probably won't use
_PSS.That can be addressed by adding
Kconfigoptions, but those options should not be user-selectable (because quite honestly users don't have to know what those things are and they don't care *and* things break if they make a wrong choice). Instead, I'd make architecture Kconfigs select those options automatically.
Quoted 6 lines
Quoted 4 lines
I've made changes locally. Basically s/ACPI_PSS/HAVE_ACPI_PSS/ and in
arch/x86/Kconfig; selectHAVE_ACPI_PSSif ACPI. Similarly for CST. Just wanted to check if there were any other comments before sending out v7.Can you please just send the new version of the $subject patch alone for now?
Attached below. (hope that worked.)
Quoted 3 lines
Also I'm still unsure what the connection between
_CSTand CPPC is.
There isnt. But I'm missing where I've implied the dependency?
Thanks,
Ashwin.
From cd48987a681d6f6fcbdfe4da4a7b456abf5daa05 Mon Sep 17 00:00:00 2001
From: Ashwin Chaugule <[email protected]>
Date: Fri, 22 May 2015 14:55:30 -0400
Subject: [PATCH 2/7] ACPI: Make ACPI processor driver more extensible
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new Kconfig symbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and the options are auto-selected by the architecture Kconfig files.
The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig options lets us make these two mutually exclusive at compile time.
--- arch/x86/Kconfig | 2 + drivers/acpi/Kconfig | 31 ++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 +++++++++++++++++++--------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 122 +++++++++++++++++++++++++++++----------- 7 files changed, 180 insertions(+), 72 deletions(-)
arch/x86/Kconfig +2 -0
@@ -143,6 +143,8 @@ config X86 select ACPI_LEGACY_TABLES_LOOKUP if ACPI select X86_FEATURE_NAMES if PROC_FS select SRCU + select HAVE_ACPI_CST if ACPI + select HAVE_ACPI_PSS if ACPI config INSTRUCTION_DECODER def_bool y
drivers/acpi/Kconfig +25 -6
@@ -166,18 +166,37 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config HAVE_ACPI_CST + bool + depends on ACPI_PROCESSOR depends on X86 || IA64 - default y + select CPU_IDLE help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config HAVE_ACPI_PSS + bool + depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers. +config ACPI_PROCESSOR + tristate "Processor" + depends on X86 || IA64 + default y + help + This driver adds support for the ACPI Processor package. It is required + by several flavors of cpufreq performance-state, thermal, throttling and + idle drivers. + To compile this driver as a module, choose M here: the module will be called processor.
drivers/acpi/Makefile +4 -3
@@ -82,9 +82,10 @@ obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o obj-$(CONFIG_ACPI_BGRT) += bgrt.o # processor has its own "processor." module_param namespace -processor-y := processor_driver.o processor_throttling.o -processor-y += processor_idle.o processor_thermal.o -processor-$(CONFIG_CPU_FREQ) += processor_perflib.o +processor-y := processor_driver.o +processor-$(CONFIG_HAVE_ACPI_CST) += processor_idle.o +processor-$(CONFIG_HAVE_ACPI_PSS) += processor_perflib.o \ + processor_throttling.o processor_thermal.o obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
drivers/acpi/processor_driver.c +58 -28
130 lines not on this page · raw message
drivers/cpufreq/Kconfig +1 -1
@@ -223,7 +223,7 @@ endif if IA64 config IA64_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" - depends on ACPI_PROCESSOR + depends on ACPI_PROCESSOR && HAVE_ACPI_PSS && HAVE_ACPI_CST help This driver adds a CPUFreq driver which utilizes the ACPI Processor Performance States.
drivers/cpufreq/Kconfig.x86 +2 -0
@@ -18,6 +18,7 @@ config X86_INTEL_PSTATE config X86_PCC_CPUFREQ tristate "Processor Clocking Control interface driver" depends on ACPI && ACPI_PROCESSOR + depends on HAVE_ACPI_PSS && HAVE_ACPI_CST help This driver adds support for the PCC interface.
@@ -32,6 +33,7 @@ config X86_PCC_CPUFREQ config X86_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" depends on ACPI_PROCESSOR + depends on HAVE_ACPI_PSS && HAVE_ACPI_CST help This driver adds a CPUFreq driver which utilizes the ACPI Processor Performance States.
include/acpi/processor.h +88 -34
186 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 111 lines · Ashwin Chaugule
Quoted 103 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 99 lines · Ashwin Chaugule
Hi Rafael,
Quoted 95 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 71 lines · Ashwin Chaugule
Quoted 70 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.Quoted 8 lines
Quoted 1 line
Isn't there a way to implement what you need without adding them?
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue. I considered the alternative of adding a probe routine which matches ACPI_PROCESSOR_OBJECT/DEVICE_HID to each driver, but this seemed like a better option. Do you have any other ideas?
First of all, I don't see what
_CSThas to do with CPPC.Second, it looks like the problem is that x86 probably won't use CPPC, while arm64 probably won't use
_PSS.That can be addressed by adding
Kconfigoptions, but those options should not be user-selectable (because quite honestly users don't have to know what those things are and they don't care *and* things break if they make a wrong choice). Instead, I'd make architecture Kconfigs select those options automatically.Quoted 6 lines
Quoted 4 lines
I've made changes locally. Basically s/ACPI_PSS/HAVE_ACPI_PSS/ and in
arch/x86/Kconfig; selectHAVE_ACPI_PSSif ACPI. Similarly for CST. Just wanted to check if there were any other comments before sending out v7.Can you please just send the new version of the $subject patch alone for now?
Quoted 7 lines
Attached below. (hope that worked.)
Quoted 3 lines
Also I'm still unsure what the connection between
_CSTand CPPC is.There isnt. But I'm missing where I've implied the dependency?
Perhaps the confusion is coming from the introduction of ACPI_CST in this file. I could leave it as it is and just separate out the ACPI_PSS bits. But I figured, while I'm at it, I'd introduce ACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?
Thanks,
Ashwin.
Rafael J. Wysocki
maintainerRe: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Hi Ashwin,
Quoted 8 lines · Ashwin Chaugule
Quoted 7 lines · Ashwin Chaugule
Quoted 6 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 2 lines · Ashwin Chaugule
Hi Rafael,
[cut]
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Also I'm still unsure what the connection between
_CSTand CPPC is.
Quoted 8 lines
Quoted 1 line
There isnt. But I'm missing where I've implied the dependency?
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?
Yes, please. That would be much less confusing.
Thanks,
Rafael
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 1 line · Rafael J. Wysocki
Hi Ashwin,
Hi,
Quoted 19 lines
Quoted 8 lines · Ashwin Chaugule
Quoted 7 lines · Ashwin Chaugule
Quoted 6 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 2 lines · Ashwin Chaugule
Hi Rafael,
[cut]
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Also I'm still unsure what the connection between
_CSTand CPPC is.There isnt. But I'm missing where I've implied the dependency?
Quoted 8 lines
Quoted 6 lines
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?Yes, please. That would be much less confusing.
Deja Vu. :)
When I let processor_driver and processor_idle compile on ARM64, I get a bunch of errors because processor_idle.c contains a lot of X86 specific defines. That is why I'd created the ACPI_CST option which we'd enable only on X86.
I'm not entirely sure what these enums and functions should default to, or what they should be on ARM specifically. Given that on ARM64 we're likely to use LPI as against CST, it seems the original approach is better. Thoughts?
------8<------
rivers/acpi/processor_idle.c: In function ‘disabled_by_idle_boot_param’:drivers/acpi/processor_idle.c:73:9: error: ‘boot_option_idle_override’ undeclared (first use in this function)
return boot_option_idle_override == IDLE_POLL ||
^
drivers/acpi/processor_idle.c:73:9: note: each undeclared identifier is reported only once for each function it appears in drivers/acpi/processor_idle.c:73:38: error: ‘IDLE_POLL’ undeclared (first use in this function)
return boot_option_idle_override == IDLE_POLL ||
^
drivers/acpi/processor_idle.c:74:32: error: ‘IDLE_HALT’ undeclared
(first use in this function)
boot_option_idle_override == IDLE_HALT;
^drivers/acpi/processor_idle.c: In function ‘acpi_safe_halt’:drivers/acpi/processor_idle.c:121:3: error: implicit declaration of function ‘arch_safe_halt’ [-Werror=implicit-function-declaration]
safe_halt();
^drivers/acpi/processor_idle.c: In function ‘acpi_processor_get_power_info_cst’:drivers/acpi/processor_idle.c:435:9: error:
‘boot_option_idle_override’ undeclared (first use in this function)
(boot_option_idle_override == IDLE_NOMWAIT)) {
^
drivers/acpi/processor_idle.c:435:38: error: ‘IDLE_NOMWAIT’ undeclared
(first use in this function)
(boot_option_idle_override == IDLE_NOMWAIT)) {
^drivers/acpi/processor_idle.c: In function ‘acpi_idle_enter_bm’:drivers/acpi/processor_idle.c:749:2: error: implicit declaration of function ‘acpi_unlazy_tlb’ [-Werror=implicit-function-declaration]
acpi_unlazy_tlb(smp_processor_id());
^drivers/acpi/processor_idle.c: In function ‘acpi_processor_power_init’:drivers/acpi/processor_idle.c:1072:3: error: implicit declaration of function ‘acpi_processor_cstate_check’ [-Werror=implicit-function-declaration]
max_cstate = acpi_processor_cstate_check(max_cstate);
^drivers/acpi/processor_idle.c: In function ‘disabled_by_idle_boot_param’:drivers/acpi/processor_idle.c:75:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
------8<------
Regards,
Ashwin.
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 40 lines · Ashwin Chaugule
Quoted 1 line · Rafael J. Wysocki
Hi Ashwin,
Hi,
Quoted 19 lines
Quoted 8 lines · Ashwin Chaugule
Quoted 7 lines · Ashwin Chaugule
Quoted 6 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 2 lines · Ashwin Chaugule
Hi Rafael,
[cut]
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Also I'm still unsure what the connection between
_CSTand CPPC is.There isnt. But I'm missing where I've implied the dependency?
Quoted 8 lines
Quoted 6 lines
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?Yes, please. That would be much less confusing.
Deja Vu. :)
When I let
processor_driverandprocessor_idlecompile on ARM64, I get a bunch of errors becauseprocessor_idle.ccontains a lot of X86 specific defines. That is why I'd created theACPI_CSToption which we'd enable only on X86.
Quoted 4 lines
I'm not entirely sure what these enums and functions should default to, or what they should be on ARM specifically. Given that on ARM64 we're likely to use LPI as against CST, it seems the original approach is better. Thoughts?
Before we go anywhere deeper, have you checked what happens on ia64?
Rafael
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 19 lines · Rafael J. Wysocki
Quoted 18 lines · Ashwin Chaugule
Quoted 9 lines · Rafael J. Wysocki
Quoted 7 lines
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?Yes, please. That would be much less confusing.
Deja Vu. :)
When I let
processor_driverandprocessor_idlecompile on ARM64, I get a bunch of errors becauseprocessor_idle.ccontains a lot of X86 specific defines. That is why I'd created theACPI_CSToption which we'd enable only on X86.
Quoted 6 lines
Quoted 4 lines
I'm not entirely sure what these enums and functions should default to, or what they should be on ARM specifically. Given that on ARM64 we're likely to use LPI as against CST, it seems the original approach is better. Thoughts?
Before we go anywhere deeper, have you checked what happens on ia64?
I dont have access, but I'm really not changing anything functionally.
Thanks,
Ashwin.
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 20 lines · Ashwin Chaugule
Quoted 19 lines · Rafael J. Wysocki
Quoted 18 lines · Ashwin Chaugule
Quoted 9 lines · Rafael J. Wysocki
Quoted 7 lines
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?Yes, please. That would be much less confusing.
Deja Vu. :)
When I let
processor_driverandprocessor_idlecompile on ARM64, I get a bunch of errors becauseprocessor_idle.ccontains a lot of X86 specific defines. That is why I'd created theACPI_CSToption which we'd enable only on X86.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
I'm not entirely sure what these enums and functions should default to, or what they should be on ARM specifically. Given that on ARM64 we're likely to use LPI as against CST, it seems the original approach is better. Thoughts?
Before we go anywhere deeper, have you checked what happens on ia64?
I dont have access, but I'm really not changing anything functionally.
I mean ia64 is a non-x86 architecture using ACPI. It very well may be doing things that you want to be doing.
It looks like the only reason you want ACPI_CST for is to avoid building processor_idle.c on ARM64. Then add something like this to the ACPI Kconfig:
config ACPI_PROCESSOR_IDLE
def_bool Y depends on X86 || IA64
and don't make it user-selectable *and* under the ACPI_PROCESSOR config do
select CPU_IDLE if ACPI_PROCESSOR_IDLE
Then, make processor_idle.c conditional on ACPI_PROCESSOR_IDLE. That should do the trick and it may be changed by the LPI series as needed.
Also, I don't see a reason why the ACPI_PSS option should be user-selectable. I'd call it ACPI_CPU_FREQ_PSS, make it depend on CPU_FREQ and make architectures select it (or not) as appropriate.
Thanks,
Rafael
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 40 lines · Rafael J. Wysocki
Quoted 20 lines · Ashwin Chaugule
Quoted 19 lines · Rafael J. Wysocki
Quoted 18 lines · Ashwin Chaugule
Quoted 9 lines · Rafael J. Wysocki
Quoted 7 lines
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?Yes, please. That would be much less confusing.
Deja Vu. :)
When I let
processor_driverandprocessor_idlecompile on ARM64, I get a bunch of errors becauseprocessor_idle.ccontains a lot of X86 specific defines. That is why I'd created theACPI_CSToption which we'd enable only on X86.Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
I'm not entirely sure what these enums and functions should default to, or what they should be on ARM specifically. Given that on ARM64 we're likely to use LPI as against CST, it seems the original approach is better. Thoughts?
Before we go anywhere deeper, have you checked what happens on ia64?
I dont have access, but I'm really not changing anything functionally.
I mean ia64 is a non-x86 architecture using ACPI. It very well may be doing things that you want to be doing.
It looks like the only reason you want
ACPI_CSTfor is to avoid buildingprocessor_idle.con ARM64. Then add something like this to the ACPIKconfig:config
ACPI_PROCESSOR_IDLEdef_bool Y depends on X86 || IA64
Quoted 6 lines
and don't make it user-selectable *and* under the
ACPI_PROCESSORconfig doselect
CPU_IDLEifACPI_PROCESSOR_IDLEThen, make
processor_idle.cconditional onACPI_PROCESSOR_IDLE. That should do the trick and it may be changed by the LPI series as needed.
And do that in a separate patch with a clear changelog explaining why you're doing it.
Thanks,
Rafael
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
In reply to Ashwin ChauguleQuoted 40 lines · Ashwin Chaugule
Quoted 1 line · Rafael J. Wysocki
Hi Ashwin,
Hi,
Quoted 19 lines
Quoted 8 lines · Ashwin Chaugule
Quoted 7 lines · Ashwin Chaugule
Quoted 6 lines · Rafael J. Wysocki
Hi Ashwin,
Quoted 2 lines · Ashwin Chaugule
Hi Rafael,
[cut]
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Also I'm still unsure what the connection between
_CSTand CPPC is.There isnt. But I'm missing where I've implied the dependency?
Quoted 8 lines
Quoted 6 lines
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?Yes, please. That would be much less confusing.
Deja Vu. :)
When I let
processor_driverandprocessor_idlecompile on ARM64, I get a bunch of errors becauseprocessor_idle.ccontains a lot of X86 specific defines. That is why I'd created theACPI_CSToption which we'd enable only on X86.
Quoted 4 lines
I'm not entirely sure what these enums and functions should default to, or what they should be on ARM specifically. Given that on ARM64 we're likely to use LPI as against CST, it seems the original approach is better. Thoughts?
Correct, I addressed this in my RFC posting[1] and wanted to get feedback from Rafael before proceeding. As I said in other email, I will try to rebase and repost that series ASAP.
Regards,
Sudeep
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
In reply to Ashwin ChauguleHi,
Quoted 3 lines · Ashwin Chaugule
Quoted 2 lines · Ashwin Chaugule
Quoted 1 line · Rafael J. Wysocki
Hi Ashwin,
[...]
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines
Can you please just send the new version of the $subject patch alone for now?
Attached below. (hope that worked.)
Quoted 3 lines
Also I'm still unsure what the connection between
_CSTand CPPC is.
Quoted 9 lines
Quoted 1 line
There isnt. But I'm missing where I've implied the dependency?
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?
Correct, I will handle it as a prerequisite for introducing _LPI support. I had posted an RFC long back, will revive those patches and repost them soon.
It's better to enable ACPI_PROCESSOR on ARM64 only after we have all these dependencies resolved. Until then we need to carry some patches locally for testing.
Regards,
Sudeep
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Hi Sudeep,
Quoted 16 lines · Sudeep Holla
Hi,
Quoted 4 lines · Ashwin Chaugule
Quoted 1 line · Ashwin Chaugule
Quoted 8 lines
Quoted 1 line · Rafael J. Wysocki
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?
Quoted 7 lines
Correct, I will handle it as a prerequisite for introducing
_LPIsupport. I had posted an RFC long back, will revive those patches and repost them soon.It's better to enable
ACPI_PROCESSORon ARM64 only after we have all these dependencies resolved. Until then we need to carry some patches locally for testing.
With Rafaels latest suggestion of adding ACPI_PROCESSOR_IDLE, we dont need to wait until all dependencies are resolved to enable acpi_processor on ARM64. CPPC patchwork has been up for review for quite a long time and has been validated on hardware. There is no reason for it to be blocked until LPI is upstream ready.
Regards,
Ashwin.
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Hi Ashwin.
Quoted 28 lines · Ashwin Chaugule
Hi Sudeep,
Quoted 16 lines · Sudeep Holla
Hi,
Quoted 4 lines · Ashwin Chaugule
Quoted 1 line · Ashwin Chaugule
Quoted 8 lines
Quoted 1 line · Rafael J. Wysocki
Perhaps the confusion is coming from the introduction of
ACPI_CSTin this file. I could leave it as it is and just separate out theACPI_PSSbits. But I figured, while I'm at it, I'd introduceACPI_CST, since we know the LPI stuff is coming up soon as a CST alternative anyway. So if you prefer, I can drop the CST bits and maybe Sudeep can address that as part of his LPI patchset?Quoted 7 lines
Correct, I will handle it as a prerequisite for introducing
_LPIsupport. I had posted an RFC long back, will revive those patches and repost them soon.It's better to enable
ACPI_PROCESSORon ARM64 only after we have all these dependencies resolved. Until then we need to carry some patches locally for testing.
Quoted 6 lines
With Rafaels latest suggestion of adding
ACPI_PROCESSOR_IDLE, we dont need to wait until all dependencies are resolved to enableacpi_processoron ARM64. CPPC patchwork has been up for review for quite a long time and has been validated on hardware. There is no reason for it to be blocked until LPI is upstream ready.
Agreed, by the way I didn't mean to block CPPC work. It can be merged when/if it's ready irrespective of _LPI support, what I meant is to enable ACPI_PROCESSOR on ARM64 when other dependencies are resolved rather than introducing just build fixes for time-being.
I think we still have one dependency for hotplug. I don't like the weak definitions introduced, but don't have a better solution either.
Regards,
Sudeep
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
In reply to Ashwin ChauguleQuoted 71 lines · Ashwin Chaugule
Quoted 70 lines · Rafael J. Wysocki
Quoted 56 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +8
-5@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations and removable drive bays such as the IBM Ultrabay and the Dell Module Bay. -config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that - support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver"drivers/acpi/Kconfig config ACPI_DOCK · line 191
Quoted 10 lines
drivers/acpi/Kconfig +9
-0+ depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPU performance + using PSS methods as described in the ACPI spec. It also enables support + for ACPI based performance throttling (TSS) and ACPI based thermal + monitoring. It is required by several flavors of cpufreq performance-state drivers.For starters, I don't like these new
Kconfigoptions.
Quoted 5 lines
Quoted 1 line
Isn't there a way to implement what you need without adding them?
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue.
Ashwin, I am trying to keep Kconfig options minimum, iff necessary and selected by ARCH code(i.e. not user selectable). Also I am not entirely sure if we need to make PSS and CPPC mutually exclusive.
I had seen patches to support PSS on ARM and if we have to support single Image to handle both they can't be exclusive.
Regards,
Sudeep
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Hi Sudeep,
Quoted 87 lines · Sudeep Holla
Quoted 84 lines · Ashwin Chaugule
Quoted 80 lines · Rafael J. Wysocki
Quoted 66 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +0
-0@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations andremovable
drive bays such as the IBM Ultrabay and the Dell Module Bay.drivers/acpi/Kconfig +4
-4-config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux anduses
ACPI C2 and C3 processor states to save power on systems thatdrivers/acpi/Kconfig +10
-1- support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver" + depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPUQuoted 7 lines
performance
+ using PSS methods as described in the ACPI spec. It also enables
support
+ for ACPI based performance throttling (TSS) and ACPI based
thermal
+ monitoring. It is required by several flavors of cpufreq
performance-state drivers.For starters, I don't like these new
Kconfigoptions.Isn't there a way to implement what you need without adding them?
Quoted 8 lines
Quoted 3 lines
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue.
Ashwin, I am trying to keep
Kconfigoptions minimum, iff necessary and selected by ARCH code(i.e. not user selectable). Also I am not entirely sure if we need to make PSS and CPPC mutually exclusive.
Agree. Moving this to ARCH does seem like a better option. I need to explore that some more. Per the ACPI spec, the OS is not expected to support PSS and CPPC at runtime. I want to avoid getting into whitelist/blacklist issues which would be inevitable if we keep both available at runtime. Some of the X86 drivers run into this already.
Quoted 3 lines
I had seen patches to support PSS on ARM and if we have to support single Image to handle both they can't be exclusive.
Theres been one attempt about 1.5 years ago and AFAIK those folks have completely backed out of the ARM64 Server space . ;) We can revisit when someone proposes a more recent solution for PSS on ARM64. It shouldn't be too hard to change the Kconfig dependencies accordingly.
Regards,
Ashwin.
Re: [PATCH v6 2/7] ACPI: Make ACPI processor driver more extensible
Quoted 99 lines · Ashwin Chaugule
Hi Sudeep,
Quoted 87 lines · Sudeep Holla
Quoted 84 lines · Ashwin Chaugule
Quoted 80 lines · Rafael J. Wysocki
Quoted 66 lines · Ashwin Chaugule
The ACPI processor driver is currently tied too closely to the ACPI C-states (CST), P-states (PSS) and other related constructs for controlling CPU idle and CPU performance.
The newer ACPI specification (v5.1 onwards) introduces alternative methods to CST and PSS. These new mechanisms are described within each ACPI Processor object and so they need to be scanned whenever a new Processor object is detected. This patch introduces two new
Kconfigsymbols to allow for finer configurability among the various options for controlling CPU idle and performance states. There is no change in functionality and these options are defaulted to enabled to maintain previous behaviour.The following patchwork introduces CPPC: A newer method of controlling CPU performance. The OS is not expected to support CPPC and PSS at runtime. So the kconfig option lets us make these two mutually exclusive at compile time.
Signed-off-by Ashwin Chaugule <[email protected]>Reviewed-by Al Stone <[email protected]>--- drivers/acpi/Kconfig | 31 +++++++++-- drivers/acpi/Makefile | 7 ++- drivers/acpi/processor_driver.c | 86 ++++++++++++++++++---------- drivers/cpufreq/Kconfig | 2 +- drivers/cpufreq/Kconfig.x86 | 2 + include/acpi/processor.h | 120 ++++++++++++++++++++++++++++------------ 6 files changed, 176 insertions(+), 72 deletions(-)drivers/acpi/Kconfig +0
-0@@ -166,18 +166,39 @@ config ACPI_DOCK This driver supports ACPI-controlled docking stations andremovable
drive bays such as the IBM Ultrabay and the Dell Module Bay.drivers/acpi/Kconfig +4
-4-config ACPI_PROCESSOR - tristate "Processor" - select THERMAL - select CPU_IDLE +config ACPI_CST + bool "ACPI C states (CST) driver" + depends on ACPI_PROCESSOR depends on X86 || IA64 + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux anduses
ACPI C2 and C3 processor states to save power on systems thatdrivers/acpi/Kconfig +10
-1- support it. It is required by several flavors of cpufreq + support it. + +config ACPI_PSS + bool "ACPI P States (PSS) driver" + depends on ACPI_PROCESSOR + depends on X86 || IA64 + select THERMAL + default y + help + This driver implements ACPI methods for controlling CPUQuoted 7 lines
performance
+ using PSS methods as described in the ACPI spec. It also enables
support
+ for ACPI based performance throttling (TSS) and ACPI based
thermal
+ monitoring. It is required by several flavors of cpufreq
performance-state drivers.For starters, I don't like these new
Kconfigoptions.Isn't there a way to implement what you need without adding them?
Quoted 8 lines
Quoted 3 lines
We need to use the ACPI Processor driver for CPPC without including all its current dependencies. (i.e. PSS, TSS, CSS etc.). The upcoming LPI work from Sudeep will also face the same issue.
Ashwin, I am trying to keep
Kconfigoptions minimum, iff necessary and selected by ARCH code(i.e. not user selectable). Also I am not entirely sure if we need to make PSS and CPPC mutually exclusive.
Quoted 6 lines
Agree. Moving this to ARCH does seem like a better option. I need to explore that some more. Per the ACPI spec, the OS is not expected to support PSS and CPPC at runtime. I want to avoid getting into whitelist/blacklist issues which would be inevitable if we keep both available at runtime. Some of the X86 drivers run into this already.
OK, but as you say, both still be enabled statically while only one of then should be active at run-time.
Quoted 9 lines
Quoted 3 lines
I had seen patches to support PSS on ARM and if we have to support single Image to handle both they can't be exclusive.
Theres been one attempt about 1.5 years ago and AFAIK those folks have completely backed out of the ARM64 Server space . ;) We can revisit when someone proposes a more recent solution for PSS on ARM64. It shouldn't be too hard to change the
Kconfigdependencies accordingly.
While I too can only guess that they have backed off, since CPPC requires firmware, and if the hardware has PSS like interface, I can imagine vendors pushing for that for convenience, so I would not rule that out completely. But I agree as along as it can be changed easily, we can defer that until there's a real hardware.
Regards,
Sudeep
PATCH v6 3/7 ACPI: Introduce CPU performance controls using CPPC
In reply to Ashwin ChauguleCPPC stands for Collaborative Processor Performance Controls and is defined in the ACPI v5.0+ spec. It describes CPU performance controls on an abstract and continuous scale allowing the platform (e.g. remote power processor) to flexibly optimize CPU performance with its knowledge of power budgets and other architecture specific knowledge.
This patch adds a shim which exports commonly used functions to get and set CPPC specific controls for each CPU. This enables CPUFreq drivers to gather per CPU performance data and use with exisiting governors or even allows for customized governors which are implemented inside CPUFreq drivers.
--- drivers/acpi/Kconfig | 17 + drivers/acpi/Makefile | 1 + drivers/acpi/cppc_acpi.c | 812 +++++++++++++++++++++++++++++++++++++++++++++++ include/acpi/cppc_acpi.h | 137 ++++++++ 4 files changed, 967 insertions(+) create mode 100644 drivers/acpi/cppc_acpi.c create mode 100644 include/acpi/cppc_acpi.h
drivers/acpi/Kconfig +17 -0
@@ -190,6 +190,23 @@ config ACPI_PSS monitoring. It is required by several flavors of cpufreq performance-state drivers. +config ACPI_CPPC + bool "Common ACPI CPPC routines for CPU performance" + depends on ARM64 && ACPI_PROCESSOR + depends on !ACPI_PSS + select MAILBOX + select PCC + default n + help + This file implements common functionality to parse + CPPC tables as described in the ACPI 5.1+ spec. The + routines implemented are meant to be used by other + drivers to control CPU performance using CPPC semantics. + If your platform does not support CPPC in firmware, + leave this option disabled. + + If in doubt, say N. + config ACPI_PROCESSOR tristate "Processor" depends on X86 || IA64
drivers/acpi/Makefile +1 -0
@@ -80,6 +80,7 @@ obj-$(CONFIG_ACPI_HED) += hed.o obj-$(CONFIG_ACPI_EC_DEBUGFS) += ec_sys.o obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o obj-$(CONFIG_ACPI_BGRT) += bgrt.o +obj-$(CONFIG_ACPI_CPPC) += cppc_acpi.o # processor has its own "processor." module_param namespace processor-y := processor_driver.o
drivers/acpi/cppc_acpi.c new file +812 -0
812 lines not on this page · raw message
include/acpi/cppc_acpi.h new file +137 -0
137 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v6 4/7 CPPC: Add a CPUFreq driver for use with CPPC
In reply to Ashwin ChauguleThis driver utilizes the methods introduced in the previous patch - "ACPI: Introduce CPU performance controls using CPPC" and enables usage with existing CPUFreq governors.
--- drivers/cpufreq/Kconfig.arm | 16 ++++ drivers/cpufreq/Makefile | 2 + drivers/cpufreq/cppc_cpufreq.c | 197 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 215 insertions(+) create mode 100644 drivers/cpufreq/cppc_cpufreq.c
drivers/cpufreq/Kconfig.arm +16 -0
@@ -272,3 +272,19 @@ config ARM_PXA2xx_CPUFREQ This add the CPUFreq driver support for Intel PXA2xx SOCs. If in doubt, say N. + +config ACPI_CPPC_CPUFREQ + tristate "CPUFreq driver based on the ACPI CPPC spec" + depends on ACPI_CPPC + default n + help + This adds a CPUFreq driver which uses CPPC methods + as described in the ACPIv5.1 spec. CPPC stands for + Collaborative Processor Performance Controls. It + is based on an abstract continuous scale of CPU + performance values which allows the remote power + processor to flexibly optimize for power and + performance. CPPC relies on power management firmware + for its operation. + + If in doubt, say N.
drivers/cpufreq/Makefile +2 -0
@@ -79,6 +79,8 @@ obj-$(CONFIG_ARM_SA1110_CPUFREQ) += sa1110-cpufreq.o obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o obj-$(CONFIG_ARM_TEGRA_CPUFREQ) += tegra-cpufreq.o obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o +obj-$(CONFIG_ACPI_CPPC_CPUFREQ) += cppc_cpufreq.o + ################################################################################## # PowerPC platform drivers
drivers/cpufreq/cppc_cpufreq.c new file +197 -0
197 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v6 5/7 CPPC: Probe for CPPC tables for each ACPI Processor object
In reply to Ashwin ChauguleFor each detected ACPI Processor object (ACPI0007), search its device handle for CPPC specific tables (i.e. _CPC) and extract CPU specific performance capabilities.
--- drivers/acpi/Kconfig | 2 +- drivers/acpi/processor_driver.c | 4 ++++ include/acpi/processor.h | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
drivers/acpi/Kconfig +1 -1
@@ -209,7 +209,7 @@ config ACPI_CPPC config ACPI_PROCESSOR tristate "Processor" - depends on X86 || IA64 + depends on X86 || IA64 || ARM64 default y help This driver adds support for the ACPI Processor package. It is required
drivers/acpi/processor_driver.c +4 -0
@@ -246,6 +246,10 @@ static int __acpi_processor_start(struct acpi_device *device)if (pr->flags.need_hotplug_init)return 0 ; + result =acpi_cppc_processor_probe (pr); +if (result) +return -ENODEV ; +if (!cpuidle_get_driver () ||cpuidle_get_driver () == &acpi_idle_driver)acpi_processor_power_init (pr);
include/acpi/processor.h +9 -0
@@ -328,6 +328,15 @@ phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id);int acpi_map_cpuid (phys_cpuid_t phys_id,u32 acpi_id);int acpi_get_cpuid (acpi_handle ,int type,u32 acpi_id); +#ifdef CONFIG_ACPI_CPPC +extern int acpi_cppc_processor_probe (struct acpi_processor *pr); +#else +static inline int acpi_cppc_processor_probe (struct acpi_processor *pr) +{ +return 0 ; +} +#endif /* CONFIG_ACPI_CPPC */ +/* in processor_pdc.c */ void acpi_processor_set_pdc (acpi_handle handle);
Signature · 1 line
1.9.1
PATCH v6 6/7 PCC: Enable PCC only when needed
In reply to Ashwin ChauguleCPPC is the first client to make use of the PCC Mailbox channel. So enable it only when CPPC is also enabled.
--- drivers/mailbox/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/Kconfig +1 -1
@@ -45,7 +45,7 @@ config OMAP_MBOX_KFIFO_SIZE config PCC bool "Platform Communication Channel Driver" - depends on ACPI + depends on ACPI && ACPI_CPPC help ACPI 5.0+ spec defines a generic mode of communication between the OS and a platform such as the BMC. This medium
Signature · 1 line
1.9.1
PATCH v6 7/7 ACPI: Add weak routines for ACPI CPU Hotplug
In reply to Ashwin ChauguleAdd weak functions for architectures which do not support hot-adding and removing CPUs which aren't detected at bootup. (e.g. via MADT).
This helps preserve the Kconfig dependency from:
commit cbfc1bae55bb ("[ACPI] ACPI_HOTPLUG_CPU Kconfig dependency update")
prevent:
HOTPLUG_CPU=y
ACPI_PROCESSOR=y
ACPI_HOTPLUG_CPU=n
--- drivers/acpi/acpi_processor.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/acpi/acpi_processor.c +18 -0
@@ -164,6 +164,24 @@ static int acpi_processor_errata(void)-------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_HOTPLUG_CPU +int __weak acpi_map_cpu (acpi_handle handle, +phys_cpuid_t physid,int *pcpu) +{ +return -ENODEV ; +} + +int __weak acpi_unmap_cpu (int cpu) +{ +return -ENODEV ; +} + +int __weak arch_register_cpu (int cpu) +{ +return -ENODEV ; +} + +void __weak arch_unregister_cpu (int cpu) {} +static int acpi_processor_hotadd_init (struct acpi_processor *pr) {unsigned long long sta;
Signature · 1 line
1.9.1
Hi Rafael,
Quoted 81 lines · Ashwin Chaugule
CPPC:
====CPPC (Collaborative Processor Performance Control) is a new way to control CPU performance using an abstract continous scale as against a discretized P-state scale which is tied to CPU frequency only. It is defined in the ACPI 5.0+ spec. In brief, the basic operation involves:
- OS makes a CPU performance request. (Can provide min and max tolerable bounds)- Platform (such as BMC) is free to optimize request within requested bounds depending on power/thermal budgets etc.
- Platform conveys its decision back to OS
The communication between OS and platform occurs through another medium called (PCC) Platform communication Channel. This is a generic mailbox like mechanism which includes doorbell semantics to indicate register updates. See
drivers/mailbox/pcc.cThis patchset introduces a CPPC based CPUFreq driver that works with existing governors such as ondemand. The CPPC table parsing and the CPPC communication semantics are abstracted into separate files to allow future CPPC based drivers to implement their own governors if required.
Initial patchsets included an adaptation of the PID governor from
intel_pstate.c. However recent experiments led to extensive modifications of the algorithm to calculate CPU busyness. Until it is verified that these changes are worthwhile, the existing governors should provide for a good enough starting point for ARM64 servers.Finer details about the PCC and CPPC spec are available in the latest ACPI 5.1 specification.[2]
Testing:
=======This was tested on an SBSA compatible ARMv8 server with CPPCv2 firmware running on a remote processor. I verified that each CPUs performance limits were detected and that new performance requests were made by the on-demand governor proportional to the load on each CPU. I also verified that using the
acpi_processordriver correctly maps the physical CPU ids to logical CPU ids, which helps in picking up the proper_CPCdetails from a processor object, in the case where CPU physical ids may not be contiguous.Changes since V5:
- Checkpatch cleanups.
- Changepss_inittopss_perf_init. Rec by Srinivas Pandruvada.
- Explicit comment explaining whypostcore_initcallto pcc mailbox.
- Fold acpi_processor_syscore_init/exit intoCONFIG_ACPI_CST.
- Added patch with dummy functions used byACPI_HOTPLUG_CPU.Changes since V4:
- Misc cleanups. Addressed feedback from Rafael.
- Madeacpi_processor.cindependent of C-states, P-states and others.
- Per CPU scanning for_CPCis now made fromacpi_processor.c
- Added newKconfigoptions for legacy C states and P states to enable future support for newer alternatives as defined in the ACPI spec 6.0.Changes since V3:
- Split CPPC backend methods into separate files.
- Add frontend driver which plugs into existing CPUfreq governors.
- Simplify PCC driver by moving communication space mapping and read/write into client drivers.Changes since V2:
- Select driver if !X86, sinceintel_pstatewill use HWP extensions instead.
- Added more comments.
- Added Freq domain awareness and PSD parsing.Changes since V1:
- Create a new driver based on Dirks suggestion.
- Fold in CPPC backend hooks into main driver.Changes since V0: [1]
- Splitintel_pstate.cinto a generic PID governor and platform specific backend.
- Add CPPC accessors as PID backend.[1] - http://lwn.net/Articles/608715/
[2] - http://www.uefi.org/sites/default/files/resources/ACPI_5_1release.pdf
[3] - https://patches.linaro.org/40705/
Quoted 9 lines
Ashwin Chaugule (7):
PCC: Initialize PCC Mailbox earlier at boot
ACPI: Make ACPI processor driver more extensible
ACPI: Introduce CPU performance controls using CPPC
CPPC: Add a CPUFreq driver for use with CPPC
CPPC: Probe for CPPC tables for each ACPI Processor object
PCC: Enable PCC only when needed
ACPI: Add weak routines for ACPI CPU Hotplug
Any further comments/suggestions for these patches? Can they be picked up for merging in the next cycle?
Thanks,
Ashwin.