All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erik Rosen <erik.rosen@metormote.com>
To: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>
Cc: Erik Rosen <erik.rosen@metormote.com>
Subject: [PATCH 0/2] Set sensor->data to -ENODATA after write
Date: Mon,  1 Feb 2021 20:59:27 +0100	[thread overview]
Message-ID: <20210201195929.1200-1-erik.rosen@metormote.com> (raw)

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


             reply	other threads:[~2021-02-01 20:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 19:59 Erik Rosen [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210201195929.1200-1-erik.rosen@metormote.com \
    --to=erik.rosen@metormote.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.