[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acb102d2-c44b-f9a6-671f-d157d1827468@linaro.org>
Date: Mon, 25 Sep 2023 17:20:23 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux ACPI <linux-acpi@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>,
Zhang Rui <rui.zhang@...el.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Subject: Re: [PATCH v1 1/9] ACPI: thermal: Simplify initialization of critical
and hot trips
On 12/09/2023 20:35, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Use the observation that the critical and hot trip points are never
> updated by the ACPI thermal driver, because the flags passed from
> acpi_thermal_notify() to acpi_thermal_trips_update() do not include
> ACPI_TRIPS_CRITICAL or ACPI_TRIPS_HOT, to move the initialization
> of those trip points directly into acpi_thermal_get_trip_points() and
> reduce the size of __acpi_thermal_trips_update().
>
> Also make the critical and hot trip points initialization code more
> straightforward and drop the flags that are not needed any more.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
[ ... ]
> +static void acpi_thermal_get_critical_trip(struct acpi_thermal *tz)
> +{
> + unsigned long long tmp;
> + acpi_status status;
> +
> + if (crt > 0) {
> + tmp = celsius_to_deci_kelvin(crt);
> + goto set;
> + }
> + if (crt == -1) {
> + acpi_handle_debug(tz->device->handle, "Critical threshold disabled\n");
> + goto fail;
> + }
> +
> + status = acpi_evaluate_integer(tz->device->handle, "_CRT", NULL, &tmp);
> + if (ACPI_FAILURE(status)) {
> + acpi_handle_debug(tz->device->handle, "No critical threshold\n");
> + goto fail;
> + }
> + if (tmp <= 2732) {
> + /*
> + * Below zero (Celsius) values clearly aren't right for sure,
> + * so discard them as invalid.
> + */
> + pr_info(FW_BUG "Invalid critical threshold (%llu)\n", tmp);
> + goto fail;
> + }
> +
> +set:
> + tz->trips.critical.valid = true;
> + tz->trips.critical.temperature = tmp;
> + acpi_handle_debug(tz->device->handle, "Critical threshold [%lu]\n",
> + tz->trips.critical.temperature);
> + return;
> +
> +fail:
nit: 'notset' may be more adequate
> + tz->trips.critical.valid = false;
> + tz->trips.critical.temperature = THERMAL_TEMP_INVALID;
> +}
Other than that,
Reviewed-by: Daniel Lezcano <daniel.lezcano@...aro.org>
--
<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
Powered by blists - more mailing lists