Skip to contentSkip to conversation

ACPI: thermal: Properly support the _SCP control method

PATCH In review Armin Wolf 2 participants 14 messages Apr 10, 2025 – May 16, 2025

Subsystems (2)
lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

cover ACPI: thermal: Properly support the _SCP control method

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions" yet the ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Armin Wolf (3):
ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions"
ACPI: thermal: Execute _SCP before reading trip points
ACPI: thermal: Allow userspace applications to change the cooling mode

 .../ABI/testing/sysfs-driver-thermal          |  14 ++
 MAINTAINERS                                   |   1 +
 drivers/acpi/osi.c                            |   1 -
 drivers/acpi/thermal.c                        | 129 ++++++++++++++++--
 4 files changed, 133 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-thermal

--
2.39.5

author
#1 lore raw

PATCH 1/3 ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions"

As specified in section 5.7.2 of the ACPI specification the feature group string "3.0 _SCP Extensions" implies that the operating system evaluates the _SCP control method with additional parameters.

However the ACPI thermal driver evaluates the _SCP control method without those additional parameters, conflicting with the above feature group string advertised to the firmware thru _OSI.

Stop advertising support for this feature string to avoid confusing the ACPI firmware.

Fixes e5f660ebef68 ("ACPI / osi: Collect _OSI handling into one single file")
---
 drivers/acpi/osi.c | 1 -
 1 file changed, 1 deletion(-)
drivers/acpi/osi.c +0 -1
index df9328c850bd..f2c943b934be 100644
@@ -42,7 +42,6 @@ static struct acpi_osi_entry
 osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = {
 	{"Module Device", true},
 	{"Processor Device", true},
-	{"3.0 _SCP Extensions", true},
 	{"Processor Aggregator Device", true},
 };
 

--
2.39.5

author
#2 lore raw

PATCH 2/3 ACPI: thermal: Execute _SCP before reading trip points

In reply to Armin Wolf

As specified in section 11.4.13 of the ACPI specification the operating system is required to evaluate the _ACx and _PSV objects after executing the _SCP control method.

Move the execution of the _SCP control method before the invocation of acpi_thermal_get_trip_points() to avoid missing updates to the _ACx and _PSV objects.

Fixes b09872a652d3 ("ACPI: thermal: Fold acpi_thermal_get_info() into its caller")
---
 drivers/acpi/thermal.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/acpi/thermal.c +6 -4
index 0c874186f8ae..5c2defe55898 100644
@@ -803,6 +803,12 @@ static int acpi_thermal_add(struct acpi_device *device)
 
 	acpi_thermal_aml_dependency_fix(tz);
 
+	/*
+	 * Set the cooling mode [_SCP] to active cooling. This needs to happen before
+	 * we retrieve the trip point values.
+	 */
+	acpi_execute_simple_method(tz->device->handle, "_SCP", ACPI_THERMAL_MODE_ACTIVE);
+
 	/* Get trip points [_ACi, _PSV, etc.] (required). */
 	acpi_thermal_get_trip_points(tz);
 
@@ -814,10 +820,6 @@ static int acpi_thermal_add(struct acpi_device *device)
 	if (result)
 		goto free_memory;
 
-	/* Set the cooling mode [_SCP] to active cooling. */
-	acpi_execute_simple_method(tz->device->handle, "_SCP",
-				   ACPI_THERMAL_MODE_ACTIVE);
-
 	/* Determine the default polling frequency [_TZP]. */
 	if (tzp)
 		tz->polling_frequency = tzp;

--
2.39.5

author
#3 lore raw

PATCH 3/3 ACPI: thermal: Allow userspace applications to change the cooling mode

In reply to Armin Wolf

Users might want to signal the ACPI firmware whether active or passive cooling is preferred. This is already possible under Windows using the Windows power settings.

Add a new "cooling_mode" sysfs attribute which can be used by users to change the cooling mode of a given thermal zone. Only thermal zones supporting the _SCP control method will expose this new attribute.

---
 .../ABI/testing/sysfs-driver-thermal          |  14 ++
 MAINTAINERS                                   |   1 +
 drivers/acpi/thermal.c                        | 129 ++++++++++++++++--
 3 files changed, 132 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-thermal
Documentation/ABI/testing/sysfs-driver-thermal new file +14 -0
new file mode 100644
index 000000000000..bf2349f31863
@@ -0,0 +1,14 @@
+What:		/sys/bus/acpi/devices/LNXTHERM:*/cooling_mode
+Date:		April 2025
+KernelVersion:	6.16
+Contact:	Armin Wolf <[email protected]>
+Description:
+		A string representing the preferred cooling mode of the
+		associated ACPI thermal zone:
+
+		- "active" for preferring active cooling
+
+		- "passive" for preferring passive cooling
+
+		The exact characteristics of both cooling modes depend
+		on the underlying ACPI firmware implementation.
MAINTAINERS +1 -0
index 96b827049501..fd3102723518 100644
@@ -382,6 +382,7 @@ R:	Zhang Rui <[email protected]>
 L:	[email protected]
 S:	Supported
 B:	https://bugzilla.kernel.org
+F:	Documentation/ABI/testing/sysfs-driver-thermal
 F:	drivers/acpi/*thermal*
 
 ACPI VIOT DRIVER
drivers/acpi/thermal.c +117 -12

224 lines not on this page · raw message

--
2.39.5

author
#4 lore raw
In reply to Armin Wolf

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 22 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions" yet the ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode works. Additionally the first two patches fix two issues inside the underlying code itself, so having them inside the mainline tree would be beneficial to users.

Thanks,
Armin Wolf

Quoted 17 lines

Armin Wolf (3):
ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions"
ACPI: thermal: Execute _SCP before reading trip points
ACPI: thermal: Allow userspace applications to change the cooling mode

  .../ABI/testing/sysfs-driver-thermal          |  14 ++
  MAINTAINERS                                   |   1 +
  drivers/acpi/osi.c                            |   1 -
  drivers/acpi/thermal.c                        | 129 ++++++++++++++++--
  4 files changed, 133 insertions(+), 12 deletions(-)

create mode 100644 Documentation/ABI/testing/sysfs-driver-thermal

--
2.39.5

#5 lore raw
Quoted 30 lines · Armin Wolf

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 27 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions" yet the ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

Quoted 7 lines
Quoted 3 lines

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode works. Additionally the first two patches fix two issues inside the underlying code itself, so having them inside the mainline tree would be beneficial to users.

Sure.

I'm going to get to them next week, probably on Monday.

author
#6 lore raw

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 33 lines · Armin Wolf
Quoted 32 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 30 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions" yet the ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Quoted 6 lines
Quoted 3 lines

Any updates on this? I can proof that the new interface for setting the cooling mode works. Additionally the first two patches fix two issues inside the underlying code itself, so having them inside the mainline tree would be beneficial to users.

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

author
#7 lore raw

Am 27.04.25 um 00:52 schrieb Armin Wolf:

Quoted 38 lines

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 36 lines · Armin Wolf
Quoted 35 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 22 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

   - the kernel advertises support for the "3.0 _SCP Extensions" yet the ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

   - the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

       "OSPM will automatically evaluate _ACx and _PSV objects after executing _SCP."

   - the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode works. Additionally the first two patches fix two issues inside the underlying code itself, so having them inside the mainline tree would be beneficial to users.

Quoted 8 lines
Quoted 3 lines

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

I am a bit ashamed of myself but i think we need to put this patch series on hold after all :(.

The reason of this is that i am confused by the ACPI specification regarding _SCP:

11.1.2.1. OSPM Change of Cooling Policy

When OSPM changes the platform’s cooling policy from one cooling mode to the other, the following occurs:

1. OSPM notifies the platform of the new cooling mode by running the Set Cooling Policy (_SCP) control method in all thermal zones and invoking the OS-specific Set Cooling Policy interface to all participating devices in each thermal zone.

2. Thresholds are updated in the hardware and OSPM is notified of the change.

3. OSPM re-evaluates the active and passive cooling temperature trip points for the zone and all devices in the zone to obtain the new temperature thresholds.

This section of the ACPI specification tells me that we need to evaluate the _SCP control method of all ACPI thermal zones at the same time, yet section 11.4.13. tells me that each _SCP control methods belongs to the individual thermal zone.

The reason why i am concerned by this is because Windows adheres to section 11.1.2.1. and only exposes this setting as a global tunable. This might cause device manufacturers to depend on this behavior and lead to strange things should two thermal zones have different _SCP settings.

I will ask the UEFI mailing list which behavior is expected by the ACPI specification. Until then i suggest that we put this patch series on hold.

Thanks,
Armin Wolf

#8 lore raw
Quoted 70 lines · Armin Wolf

Am 27.04.25 um 00:52 schrieb Armin Wolf:

Quoted 42 lines

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 40 lines · Armin Wolf
Quoted 39 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 23 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions"
yet the
ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode
works. Additionally the first two patches fix two issues inside the underlying code
itself, so having them inside the mainline tree would be beneficial to users.

Quoted 8 lines
Quoted 3 lines

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

I am a bit ashamed of myself but i think we need to put this patch series on hold after all :(.

The reason of this is that i am confused by the ACPI specification regarding _SCP:

11.1.2.1. OSPM Change of Cooling Policy

When OSPM changes the platform’s cooling policy from one cooling mode to the other, the following occurs:

1. OSPM notifies the platform of the new cooling mode by running the Set Cooling Policy (_SCP) control method in all thermal zones and invoking the OS-specific Set Cooling Policy interface to all participating devices in each thermal zone.

2. Thresholds are updated in the hardware and OSPM is notified of the change.

3. OSPM re-evaluates the active and passive cooling temperature trip points for the zone and all devices in the zone to obtain the new temperature thresholds.

This section of the ACPI specification tells me that we need to evaluate the _SCP control method of all ACPI thermal zones at the same time, yet section 11.4.13. tells me that each _SCP control methods belongs to the individual thermal zone.

Quoted 6 lines

The reason why i am concerned by this is because Windows adheres to section 11.1.2.1. and only exposes this setting as a global tunable. This might cause device manufacturers to depend on this behavior and lead to strange things should two thermal zones have different _SCP settings.

I will ask the UEFI mailing list which behavior is expected by the ACPI specification. Until then i suggest that we put this patch series on hold.

Sure, no problem.

Please resend it when you think it is good to go.

Thanks!

author
#9 lore raw

Am 28.04.25 um 14:34 schrieb Rafael J. Wysocki:

Quoted 73 lines · Armin Wolf
Quoted 72 lines

Am 27.04.25 um 00:52 schrieb Armin Wolf:

Quoted 42 lines

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 40 lines · Armin Wolf
Quoted 39 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 23 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions"
yet the
ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode
works. Additionally the first two patches fix two issues inside the underlying code
itself, so having them inside the mainline tree would be beneficial to users.

Quoted 7 lines
Quoted 3 lines

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

I am a bit ashamed of myself but i think we need to put this patch series on hold after all :(.

The reason of this is that i am confused by the ACPI specification regarding _SCP:

11.1.2.1. OSPM Change of Cooling Policy

When OSPM changes the platform’s cooling policy from one cooling mode to the other, the following occurs:

1. OSPM notifies the platform of the new cooling mode by running the Set Cooling Policy (_SCP) control method in all thermal zones and invoking the OS-specific Set Cooling Policy interface to all participating devices in each thermal zone.

2. Thresholds are updated in the hardware and OSPM is notified of the change.

3. OSPM re-evaluates the active and passive cooling temperature trip points for the zone and all devices in the zone to obtain the new temperature thresholds.

This section of the ACPI specification tells me that we need to evaluate the _SCP control method of all ACPI thermal zones at the same time, yet section 11.4.13. tells me that each _SCP control methods belongs to the individual thermal zone.

The reason why i am concerned by this is because Windows adheres to section 11.1.2.1. and only exposes this setting as a global tunable. This might cause device manufacturers to depend on this behavior and lead to strange things should two thermal zones have different _SCP settings.

Quoted 7 lines
Quoted 2 lines

I will ask the UEFI mailing list which behavior is expected by the ACPI specification. Until then i suggest that we put this patch series on hold.

Sure, no problem.

Please resend it when you think it is good to go.

Thanks!

Alright, the UEFI mailing list gave no response, so i am kind of stuck.

It seems that many firmware implementation only have a single cooling policy register which is set by all _SCP control methods inside the whole system. The reason for this seems to be that Windows threats this setting as global, but the ACPI specification seemingly does not directly mandate this.

Do you thing we should take the risk and allow users to control each _SCP instance manually?

Apart from that the first two patches should be safe, so you can still pick them. Only the last patch needs some more work.

Thanks,
Armin Wolf

#10 lore raw
Quoted 82 lines · Armin Wolf

Am 28.04.25 um 14:34 schrieb Rafael J. Wysocki:

Quoted 79 lines · Armin Wolf
Quoted 68 lines

Am 27.04.25 um 00:52 schrieb Armin Wolf:

Quoted 42 lines

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 40 lines · Armin Wolf
Quoted 39 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 23 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions"
yet the
ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode
works. Additionally the first two patches fix two issues inside the underlying code
itself, so having them inside the mainline tree would be beneficial to users.

Quoted 7 lines
Quoted 3 lines

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

I am a bit ashamed of myself but i think we need to put this patch series on hold after all :(.

The reason of this is that i am confused by the ACPI specification regarding _SCP:

11.1.2.1. OSPM Change of Cooling Policy

When OSPM changes the platform’s cooling policy from one cooling mode to the other, the following occurs:

1. OSPM notifies the platform of the new cooling mode by running the Set Cooling Policy (_SCP) control method in all thermal zones and invoking the OS-specific Set Cooling Policy interface to all participating devices in each thermal zone.

2. Thresholds are updated in the hardware and OSPM is notified of the change.

3. OSPM re-evaluates the active and passive cooling temperature trip points for the zone and all devices in the zone to obtain the new temperature thresholds.

This section of the ACPI specification tells me that we need to evaluate the _SCP control method of all ACPI thermal zones at the same time, yet section 11.4.13. tells me that each _SCP control methods belongs to the individual thermal zone.

Quoted 6 lines

The reason why i am concerned by this is because Windows adheres to section 11.1.2.1. and only exposes this setting as a global tunable. This might cause device manufacturers to depend on this behavior and lead to strange things should two thermal zones have different _SCP settings.

I will ask the UEFI mailing list which behavior is expected by the ACPI specification. Until then i suggest that we put this patch series on hold.

Sure, no problem.

Please resend it when you think it is good to go.

Quoted 8 lines
Quoted 1 line

Thanks!

Alright, the UEFI mailing list gave no response, so i am kind of stuck.

It seems that many firmware implementation only have a single cooling policy register which is set by all _SCP control methods inside the whole system. The reason for this seems to be that Windows treats this setting as global, but the ACPI specification seemingly does not directly mandate this.

Do you think we should take the risk and allow users to control each _SCP instance manually?

No, I don't.

Doing things that are not done in Windows with ACPI objects is generally asking for trouble unless there is a specific use case and there is high confidence that it is actually going to work.

At least to begin with, I wouldn't do it.

Quoted 1 line

Apart from that the first two patches should be safe, so you can still pick them.

Done.

Quoted 1 line

Only the last patch needs some more work.

OK

Thanks!

#11 lore raw
Quoted 65 lines · Rafael J. Wysocki
Quoted 63 lines · Armin Wolf

Am 28.04.25 um 14:34 schrieb Rafael J. Wysocki:

Quoted 60 lines · Armin Wolf
Quoted 59 lines

Am 27.04.25 um 00:52 schrieb Armin Wolf:

Quoted 42 lines

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 40 lines · Armin Wolf
Quoted 39 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 23 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions"
yet the
ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode
works. Additionally the first two patches fix two issues inside the underlying code
itself, so having them inside the mainline tree would be beneficial to users.

Quoted 7 lines
Quoted 3 lines

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

I am a bit ashamed of myself but i think we need to put this patch series on hold after all :(.

The reason of this is that i am confused by the ACPI specification regarding _SCP:

11.1.2.1. OSPM Change of Cooling Policy

When OSPM changes the platform’s cooling policy from one cooling mode to the other, the following occurs:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

1. OSPM notifies the platform of the new cooling mode by running the Set Cooling Policy (_SCP) control method in all thermal zones and invoking the OS-specific Set Cooling Policy interface to all participating devices in each thermal zone.

2. Thresholds are updated in the hardware and OSPM is notified of the change.

3. OSPM re-evaluates the active and passive cooling temperature trip points for the zone and all devices in the zone to obtain the new temperature thresholds.

This section of the ACPI specification tells me that we need to evaluate the _SCP control method of all ACPI thermal zones at the same time, yet section 11.4.13. tells me that each _SCP control methods belongs to the individual thermal zone.

It just says "This object may exist under a thermal zone or a device" so I don't see any contradiction. Section 11.4.13 says where it is located and Section 11.1.2.1 says when to evaluate it.

However, Section 11.4.13 also says "OSPM will automatically evaluate _ACx and _PSV objects after executing _SCP" which is not arranged for in your patch [3/3] IIUC.

Thanks!

author
#12 lore raw

Am 16.05.25 um 18:56 schrieb Rafael J. Wysocki:

Quoted 76 lines · Rafael J. Wysocki
Quoted 63 lines · Armin Wolf
Quoted 62 lines

Am 28.04.25 um 14:34 schrieb Rafael J. Wysocki:

Quoted 60 lines · Armin Wolf
Quoted 59 lines

Am 27.04.25 um 00:52 schrieb Armin Wolf:

Quoted 42 lines

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 40 lines · Armin Wolf
Quoted 39 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 23 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions"
yet the
ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode
works. Additionally the first two patches fix two issues inside the underlying code
itself, so having them inside the mainline tree would be beneficial to users.

Quoted 7 lines
Quoted 3 lines

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

I am a bit ashamed of myself but i think we need to put this patch series on hold after all :(.

The reason of this is that i am confused by the ACPI specification regarding _SCP:

11.1.2.1. OSPM Change of Cooling Policy

When OSPM changes the platform’s cooling policy from one cooling mode to the other, the following occurs:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

1. OSPM notifies the platform of the new cooling mode by running the Set Cooling Policy (_SCP) control method in all thermal zones and invoking the OS-specific Set Cooling Policy interface to all participating devices in each thermal zone.

2. Thresholds are updated in the hardware and OSPM is notified of the change.

3. OSPM re-evaluates the active and passive cooling temperature trip points for the zone and all devices in the zone to obtain the new temperature thresholds.

This section of the ACPI specification tells me that we need to evaluate the _SCP control method of all ACPI thermal zones at the same time, yet section 11.4.13. tells me that each _SCP control methods belongs to the individual thermal zone.

It just says "This object may exist under a thermal zone or a device" so I don't see any contradiction. Section 11.4.13 says where it is located and Section 11.1.2.1 says when to evaluate it.

Quoted 5 lines

However, Section 11.4.13 also says "OSPM will automatically evaluate _ACx and _PSV objects after executing _SCP" which is not arranged for in your patch [3/3] IIUC.

Thanks!

This is incorrect, i do call acpi_thermal_trips_update() after setting _SCP in cooling_mode_store().

Thanks,
Armin Wolf

author
#13 lore raw
In reply to Rafael J. Wysocki

Am 16.05.25 um 15:59 schrieb Rafael J. Wysocki:

Quoted 88 lines · Armin Wolf
Quoted 87 lines

Am 28.04.25 um 14:34 schrieb Rafael J. Wysocki:

Quoted 73 lines · Armin Wolf
Quoted 72 lines

Am 27.04.25 um 00:52 schrieb Armin Wolf:

Quoted 42 lines

Am 26.04.25 um 15:12 schrieb Rafael J. Wysocki:

Quoted 40 lines · Armin Wolf
Quoted 39 lines

Am 10.04.25 um 18:54 schrieb Armin Wolf:

Quoted 23 lines

The ACPI specification defines an interface for the operating system to change the preferred cooling mode of a given ACPI thermal zone. This interface takes the form of a special ACPI control method called _SCP (see section 11.4.13 for details) and is already supported by the ACPI thermal driver.

However this support as many issues:

- the kernel advertises support for the "3.0 _SCP Extensions"
yet the
ACPI thermal driver does not support those extensions. This may confuse the ACPI firmware.

- the execution of the _SCP control method happens after the driver retrieved the trip point values. This conflicts with the ACPI specification:

"OSPM will automatically evaluate _ACx and _PSV objects after
executing _SCP."

- the cooling mode is hardcoded to active cooling and cannot be changed by the user.

Quoted 8 lines

Those issues are fixed in this patch series. In the end the user will be able to tell the ACPI firmware wether he prefers active or passive cooling. This setting will also be interesting for applications like TLP (https://linrunner.de/tlp/index.html).

The whole series was tested on various devices supporting the _SCP control method and on a device without the _SCP control method and appears to work flawlessly.

Any updates on this? I can proof that the new interface for setting the cooling mode
works. Additionally the first two patches fix two issues inside the underlying code
itself, so having them inside the mainline tree would be beneficial to users.

Quoted 7 lines
Quoted 3 lines

Sure.

I'm going to get to them next week, probably on Monday.

Ok, thanks.

Armin Wolf

I am a bit ashamed of myself but i think we need to put this patch series on hold after all :(.

The reason of this is that i am confused by the ACPI specification regarding _SCP:

11.1.2.1. OSPM Change of Cooling Policy

When OSPM changes the platform’s cooling policy from one cooling mode to the other, the following occurs:

1. OSPM notifies the platform of the new cooling mode by running the Set Cooling Policy (_SCP) control method in all thermal zones and invoking the OS-specific Set Cooling Policy interface to all participating devices in each thermal zone.

2. Thresholds are updated in the hardware and OSPM is notified of the change.

3. OSPM re-evaluates the active and passive cooling temperature trip points for the zone and all devices in the zone to obtain the new temperature thresholds.

This section of the ACPI specification tells me that we need to evaluate the _SCP control method of all ACPI thermal zones at the same time, yet section 11.4.13. tells me that each _SCP control methods belongs to the individual thermal zone.

The reason why i am concerned by this is because Windows adheres to section 11.1.2.1. and only exposes this setting as a global tunable. This might cause device manufacturers to depend on this behavior and lead to strange things should two thermal zones have different _SCP settings.

Quoted 7 lines
Quoted 2 lines

I will ask the UEFI mailing list which behavior is expected by the ACPI specification. Until then i suggest that we put this patch series on hold.

Sure, no problem.

Please resend it when you think it is good to go.

Thanks!

Alright, the UEFI mailing list gave no response, so i am kind of stuck.

It seems that many firmware implementation only have a single cooling policy register which is set by all _SCP control methods inside the whole system. The reason for this seems to be that Windows treats this setting as global, but the ACPI specification seemingly does not directly mandate this.

Quoted 8 lines
Quoted 1 line

Do you think we should take the risk and allow users to control each _SCP instance manually?

No, I don't.

Doing things that are not done in Windows with ACPI objects is generally asking for trouble unless there is a specific use case and there is high confidence that it is actually going to work.

At least to begin with, I wouldn't do it.

Alright, i will go with a single global interface then.

I am already thinking of using the platform profile interface (with performance and quiet profiles) instead of a custom sysfs interface to allow for better integration with tuned/platform-profiles-daemon/etc.

I am currently a bit preoccupied so this will take a while.

Quoted 2 lines
Quoted 1 line

Apart from that the first two patches should be safe, so you can still pick them.

Done.

Thanks :)

Armin Wolf

Quoted 4 lines
Quoted 1 line

Only the last patch needs some more work.

OK

Thanks!