Skip to contentSkip to conversation

thermal: int3400: Fix display of current_uuid for active policy

PATCH Applied Srinivas Pandruvada 2 participants 2 messages Nov 15, 2024 – Nov 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: int3400: Fix display of current_uuid for active policy

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")
---
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/int340x_thermal/int3400_thermal.c +1 -1
index b0c0f0ffdcb0..f547d386ae80 100644
@@ -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]);
 
Signature · 1 line
2.47.0
maintainer Applied
#1 lore raw
Quoted 29 lines · Srinivas Pandruvada

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")
---
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/int340x_thermal/int3400_thermal.c +0 -0
index b0c0f0ffdcb0..f547d386ae80 100644

drivers/thermal/intel/int340x_thermal/int3400_thermal.c static ssize_t current_uuid_show(struct device *dev,

Quoted 9 lines
drivers/thermal/intel/int340x_thermal/int3400_thermal.c +1 -2
@@ -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!