Skip to content

Commit 748d495

Browse files
spandruvadagregkh
authored andcommitted
thermal: int3400: Fix reading of current_uuid for active policy
commit 7082503 upstream. When the current_uuid attribute is set to the active policy UUID, reading back the same attribute is returning "INVALID" instead of the active policy UUID on some platforms before Ice Lake. In platforms before Ice Lake, firmware provides a list of supported thermal policies. In this case, user space can select any of the supported thermal policies via a write to attribute "current_uuid". In commit c7ff297 ("thermal: int340x: Update OS policy capability handshake")', the OS policy handshake was updated to support Ice Lake and later platforms and it treated priv->current_uuid_index=0 as invalid. However, priv->current_uuid_index=0 is for the active policy, only priv->current_uuid_index=-1 is invalid. Fix this issue by updating the priv->current_uuid_index check. Fixes: c7ff297 ("thermal: int340x: Update OS policy capability handshake") Signed-off-by: Srinivas Pandruvada <[email protected]> Cc: 5.18+ <[email protected]> # 5.18+ Link: https://patch.msgid.link/[email protected] [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e8ceff4 commit 748d495

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static ssize_t current_uuid_show(struct device *dev,
145145
struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
146146
int i, length = 0;
147147

148-
if (priv->current_uuid_index > 0)
148+
if (priv->current_uuid_index >= 0)
149149
return sprintf(buf, "%s\n",
150150
int3400_thermal_uuids[priv->current_uuid_index]);
151151

0 commit comments

Comments
 (0)