Re: [PATCH V3] hwmon: scmi-hwmon: implement change_mode for thermal zones

From: Guenter Roeck
Date: Thu Jan 25 2024 - 11:17:00 EST


On 1/25/24 08:09, Cristian Marussi wrote:

Agreed, but it seems that indeed here the attempt is to make sure that
an accidentally disabled sensor is turned on.


From the patch:

+static int scmi_hwmon_thermal_change_mode(struct thermal_zone_device *tz,
+ enum thermal_device_mode new_mode)
+{
..
+ if (new_mode == THERMAL_DEVICE_ENABLED)
+ config |= SCMI_SENS_CFG_SENSOR_ENABLED_MASK;
+ else
+ config &= ~SCMI_SENS_CFG_SENSOR_ENABLED_MASK;

This clearly contradicts your statement. It leaves the sensor in full control
by the thermal subsystem. If the thermal subsystem decides to turn it off,
it is turned off.

Guenter