* [PATCH] thermal: int3400: Fix display of current_uuid for active policy
@ 2024-11-14 20:02 Srinivas Pandruvada
2024-11-25 14:11 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Srinivas Pandruvada @ 2024-11-14 20:02 UTC (permalink / raw)
To: rafael, rui.zhang, daniel.lezcano, lukasz.luba
Cc: linux-pm, linux-kernel, Srinivas Pandruvada, stable
When the current_uuid attribute is set to active policy UUID, reading
back the same attribute is displaying uuid as "INVALID" instead of active
policy UUID on some platforms before Ice Lake.
In platforms before Ice Lake, firmware provides list of supported thermal
policies. In this case user space can select any of the supported thermal
policy via a write to attribute "current_uuid".
With the 'commit c7ff29763989 ("thermal: int340x: Update OS policy
capability handshake")', OS policy handshake is updated to support
Ice Lake and later platforms. But this treated priv->current_uuid_index=0
as invalid. This priv->current_uuid_index=0 is for active policy.
Only priv->current_uuid_index=-1 is invalid.
Fix this issue by treating priv->current_uuid_index=0 as valid.
Fixes: c7ff29763989 ("thermal: int340x: Update OS policy capability handshake")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
CC: stable@vger.kernel.org # 5.18+
---
drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index b0c0f0ffdcb0..f547d386ae80 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -137,7 +137,7 @@ static ssize_t current_uuid_show(struct device *dev,
struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
int i, length = 0;
- if (priv->current_uuid_index > 0)
+ if (priv->current_uuid_index >= 0)
return sprintf(buf, "%s\n",
int3400_thermal_uuids[priv->current_uuid_index]);
--
2.47.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: int3400: Fix display of current_uuid for active policy
2024-11-14 20:02 [PATCH] thermal: int3400: Fix display of current_uuid for active policy Srinivas Pandruvada
@ 2024-11-25 14:11 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2024-11-25 14:11 UTC (permalink / raw)
To: Srinivas Pandruvada
Cc: rafael, rui.zhang, daniel.lezcano, lukasz.luba, linux-pm,
linux-kernel, stable
On Fri, Nov 15, 2024 at 4:42 AM Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
>
> When the current_uuid attribute is set to active policy UUID, reading
> back the same attribute is displaying uuid as "INVALID" instead of active
> policy UUID on some platforms before Ice Lake.
>
> In platforms before Ice Lake, firmware provides list of supported thermal
> policies. In this case user space can select any of the supported thermal
> policy via a write to attribute "current_uuid".
>
> With the 'commit c7ff29763989 ("thermal: int340x: Update OS policy
> capability handshake")', OS policy handshake is updated to support
> Ice Lake and later platforms. But this treated priv->current_uuid_index=0
> as invalid. This priv->current_uuid_index=0 is for active policy.
> Only priv->current_uuid_index=-1 is invalid.
>
> Fix this issue by treating priv->current_uuid_index=0 as valid.
>
> Fixes: c7ff29763989 ("thermal: int340x: Update OS policy capability handshake")
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> CC: stable@vger.kernel.org # 5.18+
> ---
> drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index b0c0f0ffdcb0..f547d386ae80 100644
> --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> @@ -137,7 +137,7 @@ static ssize_t current_uuid_show(struct device *dev,
> struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
> int i, length = 0;
>
> - if (priv->current_uuid_index > 0)
> + if (priv->current_uuid_index >= 0)
> return sprintf(buf, "%s\n",
> int3400_thermal_uuids[priv->current_uuid_index]);
>
> --
Applied as 6.13-rc material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-25 14:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-14 20:02 [PATCH] thermal: int3400: Fix display of current_uuid for active policy Srinivas Pandruvada
2024-11-25 14:11 ` Rafael J. Wysocki
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®