Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Murad Masimov <m.masimov@maxima.ru>
To: Eric Tremblay <etremblay@distech-controls.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>, <linux-hwmon@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <lvc-project@linuxtesting.org>,
	Murad Masimov <m.masimov@maxima.ru>
Subject: [PATCH 0/3] hwmon: (tmp513) Fix interpretation of values of TMP513 registers
Date: Mon, 16 Dec 2024 20:36:45 +0300	[thread overview]
Message-ID: <20241216173648.526-1-m.masimov@maxima.ru> (raw)

The function tmp51x_get_value returns processed values of the TMP513 device
registers. Raw register values are converted to signed integer values by sign
extension in accordance with the algorithm provided in the specification, but
due to the off-by-one error in the sign bit index, the result is incorrect.
There are also some other mistakes, such as incorrect cast.

Changes introduced by these patches are based on the TMP512/TMP513 datasheets
that are specified in Documentation/hwmon/tmp513.rst. They have not actually
been tested in any real or virtual environment. However the calculations have
been tested separately to make sure they work as expected.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Murad Masimov (3):
  hwmon: (tmp513) Fix interpretation of values of Shunt Voltage and
    Limit Registers
  hwmon: (tmp513) Fix Current Register value interpretation
  hwmon: (tmp513) Fix interpretation of values of Temperature Result and
    Limit Registers

 drivers/hwmon/tmp513.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--
2.39.2


             reply	other threads:[~2024-12-16 17:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 17:36 Murad Masimov [this message]
2024-12-16 17:36 ` [PATCH 1/3] hwmon: (tmp513) Fix interpretation of values of Shunt Voltage and Limit Registers Murad Masimov
2024-12-16 23:53   ` Guenter Roeck
2024-12-16 17:36 ` [PATCH 2/3] hwmon: (tmp513) Fix Current Register value interpretation Murad Masimov
2024-12-16 23:55   ` Guenter Roeck
2024-12-16 17:36 ` [PATCH 3/3] hwmon: (tmp513) Fix interpretation of values of Temperature Result and Limit Registers Murad Masimov

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=20241216173648.526-1-m.masimov@maxima.ru \
    --to=m.masimov@maxima.ru \
    --cc=etremblay@distech-controls.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lvc-project@linuxtesting.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox