[PATCH 0/2] Set sensor->data to -ENODATA after write

From: Erik Rosen
Date: Mon Feb 01 2021 - 15:07:27 EST


Problem:
When clear_cache() is called from within the pmbus_write_word_data()
callback, the sensor data is set _after_ the function returns to
pmbus_set_sensor(). The effect is that all sensor values are cleared
except the one just written to. This behaviour prevents reloading of
the sensor value as expected in the lm25066 driver.

Proposed solution:
Set the data field to -ENODATA after updates of the sensor value.
This will force a read from the chip next time the sensor value is
read. This will also ensure that the cached value matches the actual
value stored in the chip.
The impact would be that a sensor read after a write will always
trigger a chip access.


Erik Rosen (2):
Clear sensor data after chip write
Remove unnecessary pmbus_clear_cache function call

drivers/hwmon/pmbus/lm25066.c | 5 -----
drivers/hwmon/pmbus/pmbus_core.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)

--
2.20.1