Skip to contentSkip to conversation

thermal/core: Make 'forced_passive' as obsolete candidate

PATCH In review Daniel Lezcano 2 participants 8 messages Dec 8, 2020 – Dec 13, 2020 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal/core: Make 'forced_passive' as obsolete candidate

The passive file in sysfs forces the usage of a passive trip point set by the userspace when a broken BIOS does not provide the mitigation temperature for such thermal zone. The hardware evolved a lot since 2008 as a good thermal management is no longer an option.

Linux on the other side also provides now a way to load fixed ACPI table via the option ACPI_TABLE_UPGRADE, so additionnal trip point could be added there.

Set the option obsolete and plan to remove it, so the corresponding code can be removed from the core code and allow more cleanups the thermal framework deserves.

---
 Documentation/ABI/obsolete/sysfs-thermal-passive | 13 +++++++++++++
 drivers/thermal/thermal_sysfs.c                  |  2 ++
 2 files changed, 15 insertions(+)
 create mode 100644 Documentation/ABI/obsolete/sysfs-thermal-passive
Documentation/ABI/obsolete/sysfs-thermal-passive new file +13 -0
new file mode 100644
index 000000000000..2510724cc165
@@ -0,0 +1,13 @@
+What:		/sys/class/thermal/thermal_zone*/passive
+Date:		December 2008
+KernelVersion:	2.6.28
+Contact:	Daniel Lezcano <[email protected]>
+Description:
+
+  The passive file in sysfs forces the usage of a passive trip point
+  set by the userspace when a broken BIOS does not provide the
+  mitigation temperature for such thermal zone. However, the Linux
+  kernel evolved a lot since 2008 as well as the hardware and it is
+  able to manage correctly the thermal envelope. It does also provide
+  a way to load fixed ACPI table via the option ACPI_TABLE_UPGRADE, so
+  additionnal trip point could be added there.
drivers/thermal/thermal_sysfs.c +2 -0
index 0866e949339b..578099b520b1 100644
@@ -232,6 +232,8 @@ passive_store(struct device *dev, struct device_attribute *attr,
 	if (state && state < 1000)
 		return -EINVAL;
 
+	pr_warn("%s: Consider the 'passive' option obsolete\n", tz->type);
+
 	if (state && !tz->forced_passive) {
 		if (!tz->passive_delay)
 			tz->passive_delay = 1000;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Daniel Lezcano

The passive file in sysfs forces the usage of a passive trip point set by the userspace when a broken BIOS does not provide the mitigation temperature for such thermal zone. The hardware evolved a lot since 2008 as a good thermal management is no longer an option.

Linux on the other side also provides now a way to load fixed ACPI table via the option ACPI_TABLE_UPGRADE, so additionnal trip point could be added there.

Quoted 6 lines

Set the option obsolete and plan to remove it, so the corresponding code can be removed from the core code and allow more cleanups the thermal framework deserves.

---

Is there any concern about this change ?

Quoted 38 lines
 Documentation/ABI/obsolete/sysfs-thermal-passive | 13 +++++++++++++
 drivers/thermal/thermal_sysfs.c                  |  2 ++
 2 files changed, 15 insertions(+)
 create mode 100644 Documentation/ABI/obsolete/sysfs-thermal-passive
Documentation/ABI/obsolete/sysfs-thermal-passive new file +13 -0
new file mode 100644
index 000000000000..2510724cc165
@@ -0,0 +1,13 @@
+What:		/sys/class/thermal/thermal_zone*/passive
+Date:		December 2008
+KernelVersion:	2.6.28
+Contact:	Daniel Lezcano <[email protected]>
+Description:
+
+  The passive file in sysfs forces the usage of a passive trip point
+  set by the userspace when a broken BIOS does not provide the
+  mitigation temperature for such thermal zone. However, the Linux
+  kernel evolved a lot since 2008 as well as the hardware and it is
+  able to manage correctly the thermal envelope. It does also provide
+  a way to load fixed ACPI table via the option ACPI_TABLE_UPGRADE, so
+  additionnal trip point could be added there.
drivers/thermal/thermal_sysfs.c +2 -0
index 0866e949339b..578099b520b1 100644
@@ -232,6 +232,8 @@ passive_store(struct device *dev, struct device_attribute *attr,
 	if (state && state < 1000)
 		return -EINVAL;
 
+	pr_warn("%s: Consider the 'passive' option obsolete\n", tz->type);
+
 	if (state && !tz->forced_passive) {
 		if (!tz->passive_delay)
 			tz->passive_delay = 1000;
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#2 lore raw
Quoted 10 lines · Daniel Lezcano
Quoted 9 lines · Daniel Lezcano

The passive file in sysfs forces the usage of a passive trip point set by the userspace when a broken BIOS does not provide the mitigation temperature for such thermal zone. The hardware evolved a lot since 2008 as a good thermal management is no longer an option.

Linux on the other side also provides now a way to load fixed ACPI table via the option ACPI_TABLE_UPGRADE, so additionnal trip point could be added there.

Quoted 8 lines
Quoted 6 lines

Set the option obsolete and plan to remove it, so the corresponding code can be removed from the core code and allow more cleanups the thermal framework deserves.

---

Is there any concern about this change ?

Yes - what's the reason to do so? The code isn't specific to ACPI, so being able to override ACPI tables doesn't seem to justify it.

#3 lore raw
Quoted 15 lines · Matthew Garrett
Quoted 14 lines · Daniel Lezcano
Quoted 13 lines · Daniel Lezcano

The passive file in sysfs forces the usage of a passive trip point set by the userspace when a broken BIOS does not provide the mitigation temperature for such thermal zone. The hardware evolved a lot since 2008 as a good thermal management is no longer an option.

Linux on the other side also provides now a way to load fixed ACPI table via the option ACPI_TABLE_UPGRADE, so additionnal trip point could be added there.

Set the option obsolete and plan to remove it, so the corresponding code can be removed from the core code and allow more cleanups the thermal framework deserves.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

---

Is there any concern about this change ?

Yes - what's the reason to do so?

I'm cleaning up the thermal core code, so questioning every old ABI.

Quoted 2 lines

The code isn't specific to ACPI,
so being able to override ACPI tables doesn't seem to justify it.

I agree, the code is no specific to ACPI.

What non-ACPI architecture, without device tree or platform data would need the 'passive' option today ?

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#4 lore raw
Quoted 5 lines · Daniel Lezcano
Quoted 1 line · Matthew Garrett

Yes - what's the reason to do so?

I'm cleaning up the thermal core code, so questioning every old ABI.

Quoted 7 lines
Quoted 2 lines

The code isn't specific to ACPI,
so being able to override ACPI tables doesn't seem to justify it.

I agree, the code is no specific to ACPI.

What non-ACPI architecture, without device tree or platform data would need the 'passive' option today ?

Anything that provides a trip point that has no active notifications and doesn't provide any information that tells the kernel to poll it.

#5 lore raw
Quoted 9 lines · Matthew Garrett
Quoted 8 lines · Daniel Lezcano
Quoted 1 line · Matthew Garrett

Yes - what's the reason to do so?

I'm cleaning up the thermal core code, so questioning every old ABI.

Quoted 2 lines

The code isn't specific to ACPI,
so being able to override ACPI tables doesn't seem to justify it.

Quoted 7 lines
Quoted 4 lines

I agree, the code is no specific to ACPI.

What non-ACPI architecture, without device tree or platform data would need the 'passive' option today ?

Anything that provides a trip point that has no active notifications and doesn't provide any information that tells the kernel to poll it.

I'm not able to create a setup as you describe working correctly with the forced passive trip point.

The forced passive trip can not be detected as there is no comparison with the defined temperature in the thermal_zone_device_update() function.

The commit 0c01ebbfd3caf1 may be responsible of this.

If my analysis is correct, this 'feature' is broken since years, more than 8 years to be exact and nobody complained.

If I'm right, we can remove this feature directly.

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#6 lore raw
Quoted 9 lines · Daniel Lezcano
Quoted 2 lines · Matthew Garrett

Anything that provides a trip point that has no active notifications and doesn't provide any information that tells the kernel to poll it.

I'm not able to create a setup as you describe working correctly with the forced passive trip point.

The forced passive trip can not be detected as there is no comparison with the defined temperature in the thermal_zone_device_update() function.

The logic seems to be in the step_wise thermal governor. I'm not sure why it would be used in thermal_zone_device_update() - the entire point is that we don't get updates from the device?

Quoted 2 lines

If my analysis is correct, this 'feature' is broken since years, more than 8 years to be exact and nobody complained.

I've no problem with it being removed if there are no users, but in that case the justification should be rewritten - ACPI table updates aren't a complete replacement for the functionality offered (and can't be used if the lockdown LSM is being used in any case).

#7 lore raw
Quoted 8 lines · Matthew Garrett
Quoted 7 lines · Daniel Lezcano
Quoted 2 lines · Matthew Garrett

Anything that provides a trip point that has no active notifications and doesn't provide any information that tells the kernel to poll it.

I'm not able to create a setup as you describe working correctly with the forced passive trip point.

Quoted 6 lines
Quoted 2 lines

The forced passive trip can not be detected as there is no comparison with the defined temperature in the thermal_zone_device_update() function.

The logic seems to be in the step_wise thermal governor. I'm not sure why it would be used in thermal_zone_device_update() - the entire point is that we don't get updates from the device?

The thermal_zone_device_update() loops the trip points:

        for (count = 0; count < tz->trips; count++)
                handle_thermal_trip(tz, count);

As the 'forced_passive' is not in this loop (because it was moved in the step_wise governor), the temperature crossing is never detected and the 'forced_passive' logic in the governor is never called.

That is something I realized when answering to your comment.

Quoted 7 lines
Quoted 2 lines

If my analysis is correct, this 'feature' is broken since years, more than 8 years to be exact and nobody complained.

I've no problem with it being removed if there are no users, but in that case the justification should be rewritten - ACPI table updates aren't a complete replacement for the functionality offered (and can't be used if the lockdown LSM is being used in any case).

Yes, I understand your point. Given it is not working since years, I think we can just drop the feature and change the reason of the removal in the log, instead of ACPI table updates, just say it is no longer used.

Does it sound fine ?

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog