mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Patryk Biel <pbiel7@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: Conditionally clear individual status bits for pmbus rev >= 1.2
Date: Mon, 9 Sep 2024 09:54:32 -0700	[thread overview]
Message-ID: <43cfe2e7-6b53-4ac0-8dbd-aad6d34a1ba8@roeck-us.net> (raw)
In-Reply-To: <20240909-pmbus-status-reg-clearing-v1-1-f1c0d68c6408@gmail.com>

On Mon, Sep 09, 2024 at 11:30:28AM +0200, Patryk Biel wrote:
> This change adds fetching PMBus revision and using it to conditionally
> clear individual status bits while calling pmbus_show_boolean, only if
> the device is compliant with PMBus specs >= 1.2.
> 
> Signed-off-by: Patryk Biel <pbiel7@gmail.com>
> ---
> Current implementation of pmbus_show_boolean assumes that all devices
> support write-back operation of status register so as to clear pending
> warning or faults. Since clearing individual bits in the status registers
> was introduced in PMBus specification 1.2, this operation may not be 
> supported by some older devices, thus resulting in error while reading 
> boolean attributes like e.g. temp1_max_alarm. 
> 
> This change adds fetching PMBus revision supported by device and
> modifies pmbus_show_boolean so that it only tries to clear individual
> status bits if the device is compilant with PMBus specs >= 1.2.
> 
Most of the above should have been in the description, and "This change
adds" should be "Add ...". See the "submitting Patches" document for
rationale.

> +	ret = i2c_smbus_read_byte_data(client, PMBUS_REVISION);
> +	if (ret > 0)

	>= 0 for consistency

> +		data->revision = ret;
> +

The code needs to be be further up, ahead of clearing faults, to have the
faults cleared if the command failed.

Never mind, though, I made those changes and applied the patch (I want to
make sure this patch is upstream in v6.11 final).

Thanks,
Guenter

  reply	other threads:[~2024-09-09 16:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09  9:30 Patryk Biel
2024-09-09 16:54 ` Guenter Roeck [this message]
2024-09-09 17:59 ` Guenter Roeck
2024-09-12 16:36 ` kernel test robot

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=43cfe2e7-6b53-4ac0-8dbd-aad6d34a1ba8@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbiel7@gmail.com \
    /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

all inboxes | Powered by JetHome®