Description
hello users:
we are noticing there's a chance that set pwm value via FanSensor property will fail
and it's easy to reproduce the issue
/test log as bellow/
===================================================================
root@test-machine:/sys/bus/i2c/devices/15-002f/hwmon/hwmon4# busctl set-property xyz.openbmc_project.FanSensor /xyz/openbmc_project/control/fanpwm/fan0_pwm xyz.openbmc_project.Control.FanPwm Target t 75
root@test-machine:/sys/bus/i2c/devices/15-002f/hwmon/hwmon4# cat pwm1
75
root@test-machine:/sys/bus/i2c/devices/15-002f/hwmon/hwmon4# busctl set-property xyz.openbmc_project.FanSensor /xyz/openbmc_project/control/fanpwm/fan0_pwm xyz.openbmc_project.Control.FanPwm Target t 90
root@test-machine:/sys/bus/i2c/devices/15-002f/hwmon/hwmon4# cat pwm1
75 -> issue
it should not happen because usually resp is updated properly via following line
https://github.com/openbmc/dbus-sensors/blob/master/src/PwmSensor.cpp#L132
but we found when the issue happens , the program will match following condition checking
https://github.com/openbmc/dbus-sensors/blob/master/src/PwmSensor.cpp#L127
and when it happens , the pwm value can be passed down to sysfs attribute
does anyone come accross the same issue?
thanks