Searched hist:"9 bbeff75" (Results 1 – 1 of 1) sorted by relevance
/openbmc/dbus-sensors/src/ |
H A D | HwmonTempMain.cpp | 9bbeff75 Mon Dec 05 05:09:16 CST 2022 Joseph Fu <joseph.fu@quantatw.com> hwmontempsensor: Fix DBus update value after power on issue
HwmontempSensor failed to update value on DBus interface when the state changes from off to on and these sensors are static sensors (sensor filesystem created from device-tree setting). When the condition is satisfied "findI2CDev == devices.end()", it does not activate those sensors that already exist.
To fix this we move this condition to 'findI2CDev != devices.end()'. Only check the status of activateOnly and isActive() to make sure these sensors can be activated after power on.
Tested: Before ``` root@qbmc:~# ipmitool power status Chassis Power is on root@qbmc:~# busctl get-property xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/cputemp xyz.openbmc_project.Sensor.Value Value d 36.625
root@qbmc:~# ipmitool power off Chassis Power Control: Down/Off root@qbmc:~# ipmitool power status Chassis Power is off root@qbmc:~# busctl get-property xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/cputemp xyz.openbmc_project.Sensor.Value Value d nan
root@qbmc:~# ipmitool power on Chassis Power Control: Up/On root@qbmc:~# ipmitool power status Chassis Power is on root@qbmc:~# busctl get-property xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/cputemp xyz.openbmc_project.Sensor.Value Value d nan ```
After Power on this device which was already there, it can get value from dbus property. ``` root@qbmc:~# ipmitool power status Chassis Power is on root@qbmc:~# busctl get-property xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/cputemp xyz.openbmc_project.Sensor.Value Value d 36.5 root@qbmc:~# busctl get-property xyz.openbmc_project.HwmonTempSensor /xyz/openbmc_project/sensors/temperature/cputemp xyz.openbmc_project.Sensor.Value Value d 36.625 ```
Signed-off-by: Joseph Fu <joseph.fu@quantatw.com> Change-Id: Ic99c1f2dd292ab99656df06228210d3c714e27d5
|