Skip to content

Commit ccff914

Browse files
aloktiwagregkh
authored andcommitted
soc: qcom: aoss: compare against normalized cooling state
[ Upstream commit cd3c467 ] qmp_cdev_set_cur_state() normalizes the requested state to a boolean (cdev_state = !!state). The existing early-return check compares qmp_cdev->state == state, which can be wrong if state is non-boolean (any non-zero value). Compare qmp_cdev->state against cdev_state instead, so the check matches the effective state and avoids redundant updates. Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Fixes: 05589b3 ("soc: qcom: Extend AOSS QMP driver to support resources that are used to wake up the SoC.") Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260329195333.1478090-1-alok.a.tiwari@oracle.com Signed-off-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d672c76 commit ccff914

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/soc/qcom/qcom_aoss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev,
340340
/* Normalize state */
341341
cdev_state = !!state;
342342

343-
if (qmp_cdev->state == state)
343+
if (qmp_cdev->state == cdev_state)
344344
return 0;
345345

346346
ret = qmp_send(qmp_cdev->qmp, "{class: volt_flr, event:zero_temp, res:%s, value:%s}",

0 commit comments

Comments
 (0)