All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Set sensor->data to -ENODATA after write
@ 2021-02-01 19:59 Erik Rosen
  2021-02-01 19:59 ` [PATCH 1/2] Clear sensor data after chip write Erik Rosen
  2021-02-01 19:59 ` [PATCH 2/2] Remove unnecessary pmbus_clear_cache function call Erik Rosen
  0 siblings, 2 replies; 5+ messages in thread
From: Erik Rosen @ 2021-02-01 19:59 UTC (permalink / raw)
  To: linux-kernel, linux-hwmon, Guenter Roeck, Jean Delvare; +Cc: Erik Rosen

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-02  0:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 19:59 [PATCH 0/2] Set sensor->data to -ENODATA after write Erik Rosen
2021-02-01 19:59 ` [PATCH 1/2] Clear sensor data after chip write Erik Rosen
2021-02-02  0:24   ` Guenter Roeck
2021-02-01 19:59 ` [PATCH 2/2] Remove unnecessary pmbus_clear_cache function call Erik Rosen
2021-02-02  0:26   ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.