* [PATCH] ACPI: thermal_lib: Continue registering thermal zones even if trip points fail validation
@ 2024-03-25 4:42 Stephen Horvath
2024-03-27 15:34 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Horvath @ 2024-03-25 4:42 UTC (permalink / raw)
To: Rafael J. Wysocki, Zhang Rui, Len Brown, linux-acpi, linux-kernel
Cc: Stephen Horvath
Some laptops where the thermal control is handled by the EC may
provide trip points that fail the kernels new validation, but still have
working temperature sensors. An example of this is the Framework 13 AMD.
This patch allows the thermal zone to still be registered without trip
points if the trip points fail validation, allowing the temperature
sensor to be viewed and used by the user.
Signed-off-by: Stephen Horvath <s.horvath@outlook.com.au>
---
drivers/acpi/thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 302dce0b2b50..fd59e41037ec 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -903,8 +903,8 @@ static int acpi_thermal_add(struct acpi_device *device)
if (trip == trip_table) {
pr_warn(FW_BUG "No valid trip points!\n");
- result = -ENODEV;
- goto free_memory;
+ /* Effectively disable polling since it is not needed */
+ tz->polling_frequency = 0;
}
result = acpi_thermal_register_thermal_zone(tz, trip_table,
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: thermal_lib: Continue registering thermal zones even if trip points fail validation
2024-03-25 4:42 [PATCH] ACPI: thermal_lib: Continue registering thermal zones even if trip points fail validation Stephen Horvath
@ 2024-03-27 15:34 ` Rafael J. Wysocki
2024-03-27 23:04 ` Stephen Horvath
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2024-03-27 15:34 UTC (permalink / raw)
To: Stephen Horvath
Cc: Rafael J. Wysocki, Zhang Rui, Len Brown, linux-acpi, linux-kernel
On Mon, Mar 25, 2024 at 5:44 AM Stephen Horvath
<s.horvath@outlook.com.au> wrote:
>
> Some laptops where the thermal control is handled by the EC may
> provide trip points that fail the kernels new validation, but still have
> working temperature sensors. An example of this is the Framework 13 AMD.
I believe that this is a regression introduced recently, so would it
be possible to provide a pointer to the commit that introduced it?
> This patch allows the thermal zone to still be registered without trip
> points if the trip points fail validation, allowing the temperature
> sensor to be viewed and used by the user.
>
> Signed-off-by: Stephen Horvath <s.horvath@outlook.com.au>
> ---
> drivers/acpi/thermal.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> index 302dce0b2b50..fd59e41037ec 100644
> --- a/drivers/acpi/thermal.c
> +++ b/drivers/acpi/thermal.c
> @@ -903,8 +903,8 @@ static int acpi_thermal_add(struct acpi_device *device)
>
> if (trip == trip_table) {
> pr_warn(FW_BUG "No valid trip points!\n");
> - result = -ENODEV;
> - goto free_memory;
> + /* Effectively disable polling since it is not needed */
> + tz->polling_frequency = 0;
Because the thermal zone becomes effectively tripless, it should be
registered with thermal_tripless_zone_device_register().
> }
>
> result = acpi_thermal_register_thermal_zone(tz, trip_table,
> --
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: thermal_lib: Continue registering thermal zones even if trip points fail validation
2024-03-27 15:34 ` Rafael J. Wysocki
@ 2024-03-27 23:04 ` Stephen Horvath
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Horvath @ 2024-03-27 23:04 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Zhang Rui, Len Brown, linux-acpi, linux-kernel
On 28/3/24 01:34, Rafael J. Wysocki wrote:
> I believe that this is a regression introduced recently, so would it
> be possible to provide a pointer to the commit that introduced it?
Yeah sorry, here's the commit id: 9c8647224e9fabb765019193aa43c054a638f808
I've also created a bug report with slightly more info here:
https://bugzilla.kernel.org/show_bug.cgi?id=218586
> Because the thermal zone becomes effectively tripless, it should be
> registered with thermal_tripless_zone_device_register().
Cool I'll do that for v2.
Thanks a lot for your feedback!
Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-27 23:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 4:42 [PATCH] ACPI: thermal_lib: Continue registering thermal zones even if trip points fail validation Stephen Horvath
2024-03-27 15:34 ` Rafael J. Wysocki
2024-03-27 23:04 ` Stephen Horvath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®