]> git.baikalelectronics.ru Git - kernel.git/commit
thermal: int340x: Mode setting with new OS handshake
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 10 May 2022 18:22:21 +0000 (11:22 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 11 May 2022 18:08:15 +0000 (20:08 +0200)
commitdd1738e586ff8c8a4f4e445c09315c72b992a71f
treedc590fd3728c1c7d61d115b322334f1c4a67fa46
parent48b4b86538c8f7c4593ade46ab86104d8256d668
thermal: int340x: Mode setting with new OS handshake

With the new OS handshake introduced by commit: "3a67e835e8fc ("thermal:
int340x: Update OS policy capability handshake")", the "enabled" thermal
zone mode doesn't work in the same way as previously.

The "enabled" mode fails with -EINVAL when the new handshake is used.

To address this issue, when the new OS UUID mask is set:

 - When the mode is "enabled", return 0 as the firmware already has the
   latest policy mask.

 - When the mode is "disabled", update the firmware with the UUID mask
   of zero.

This way, the firmware can take over the thermal control.

Also reset the OS UUID mask, which allows user space to update with new
set of policies.

Fixes: 3a67e835e8fc ("thermal: int340x: Update OS policy capability handshake")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ rjw: Changelog edits, removed unneeded parens ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/int340x_thermal/int3400_thermal.c