From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: rui.zhang@intel.com, daniel.lezcano@linaro.org, amitk@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] thermal: intel: Initialize RW trip to THERMAL_TEMP_INVALID
Date: Wed, 12 May 2021 08:52:55 -0700 [thread overview]
Message-ID: <7dc2bb343052c6c8fbb60d38c2ce7dac708f568a.camel@linux.intel.com> (raw)
In-Reply-To: <20210430122343.1789899-1-srinivas.pandruvada@linux.intel.com>
On Fri, 2021-04-30 at 05:23 -0700, Srinivas Pandruvada wrote:
> After commit 81ad4276b505 ("Thermal: Ignore invalid trip points") all
> user_space governor notifications via RW trip point is broken in
> intel
> thermal drivers. This commits marks trip_points with value of 0
> during
> call to thermal_zone_device_register() as invalid. RW trip points can
> be
> 0 as user space will set the correct trip temperature later.
>
> During driver init, x86_package_temp and all int340x drivers sets RW
> trip
> temperature as 0. This results in all these trips marked as invalid
> by
> the thermal core.
>
> To fix this initialize RW trips to THERMAL_TEMP_INVALID instead of 0.
>
Any chance that we can take care of this issue during 5.13-rc*?
Thanks,
Srinivas
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Srinivas Pandruvada <
> srinivas.pandruvada@linux.intel.com>
> ---
> drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 4
> ++++
> drivers/thermal/intel/x86_pkg_temp_thermal.c | 2 +-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git
> a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> index d1248ba943a4..62c0aa5d0783 100644
> --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> @@ -237,6 +237,8 @@ struct int34x_thermal_zone
> *int340x_thermal_zone_add(struct acpi_device *adev,
> if (ACPI_FAILURE(status))
> trip_cnt = 0;
> else {
> + int i;
> +
> int34x_thermal_zone->aux_trips =
> kcalloc(trip_cnt,
> sizeof(*int34x_thermal_zone-
> >aux_trips),
> @@ -247,6 +249,8 @@ struct int34x_thermal_zone
> *int340x_thermal_zone_add(struct acpi_device *adev,
> }
> trip_mask = BIT(trip_cnt) - 1;
> int34x_thermal_zone->aux_trip_nr = trip_cnt;
> + for (i = 0; i < trip_cnt; ++i)
> + int34x_thermal_zone->aux_trips[i] =
> THERMAL_TEMP_INVALID;
> }
>
> trip_cnt = int340x_thermal_read_trips(int34x_thermal_zone);
> diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c
> b/drivers/thermal/intel/x86_pkg_temp_thermal.c
> index 295742e83960..4d8edc61a78b 100644
> --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
> +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
> @@ -166,7 +166,7 @@ static int sys_get_trip_temp(struct
> thermal_zone_device *tzd,
> if (thres_reg_value)
> *temp = zonedev->tj_max - thres_reg_value * 1000;
> else
> - *temp = 0;
> + *temp = THERMAL_TEMP_INVALID;
> pr_debug("sys_get_trip_temp %d\n", *temp);
>
> return 0;
next prev parent reply other threads:[~2021-05-12 15:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 12:23 [PATCH] thermal: intel: Initialize RW trip to THERMAL_TEMP_INVALID Srinivas Pandruvada
2021-05-12 15:52 ` Srinivas Pandruvada [this message]
2021-05-12 15:54 ` Daniel Lezcano
2021-05-12 16:02 ` Srinivas Pandruvada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7dc2bb343052c6c8fbb60d38c2ce7dac708f568a.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox