From: Guenter Roeck <linux@roeck-us.net>
To: William Kennington <william@wkennington.com>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] hwmon: (pmbus): Introduce page_change_delay
Date: Fri, 4 Apr 2025 16:46:34 -0700 [thread overview]
Message-ID: <7d6d8740-9d9e-4cc4-9e7b-d005fb87fa2c@roeck-us.net> (raw)
In-Reply-To: <CAD_4BXg3WzRZWiRo42JF0-oxffdj+N0agkyeE_m0Gd1YGda8+w@mail.gmail.com>
On 4/4/25 12:31, William Kennington wrote:
> On Thu, Apr 3, 2025 at 5:28 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>> @@ -2530,7 +2527,7 @@ static int pmbus_read_coefficients(struct i2c_client *client,
>>> rv = i2c_smbus_xfer(client->adapter, client->addr, client->flags,
>>> I2C_SMBUS_WRITE, PMBUS_COEFFICIENTS,
>>> I2C_SMBUS_BLOCK_PROC_CALL, &data);
>>> - pmbus_update_ts(client, true);
>>> + pmbus_update_ts(client, PMBUS_OP_READ | PMBUS_OP_WRITE);
>>
>> I'd argue that this does not warrant a PMBUS_OP_WRITE in the first place.
>> From the chip's perspective, the operation is complete after the data
>> is returned. This is just as much a write as any other SMBus read operation
>> (a write of an address followed by a read). If you think otherwise, please
>> explain.
>>
>> Either case, the change warrants an explanation in the patch description.
>
> The previous behavior was to treat this as a write though? I updated
That dpesn't mean that the previous code was correct.
> the description about picking the maximum delay in the code change
> above, but this specific instance is still classified the same.
>
> I think technically we shouldn't do a single smbus transfer, but do
> the write followed by read with a write delay injected between them. I
> don't want to make that change here but it doesn't make sense to
> ignore the write delay IMHO.
>
Every single SMBus read transfer is a write (chip address plus register address)
followed by a read. Following your logic, every read should be treated as a write,
followed by the write delay, followed by the read.
Guenter
next prev parent reply other threads:[~2025-04-04 23:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 19:34 [PATCH] hwmon: (pmbus): Introduce page_change_delay William A. Kennington III
2025-04-02 20:27 ` [PATCH v2] " William A. Kennington III
2025-04-03 21:12 ` [PATCH v3] " William A. Kennington III
2025-04-04 0:27 ` Guenter Roeck
2025-04-04 19:31 ` William Kennington
2025-04-04 23:46 ` Guenter Roeck [this message]
2025-04-07 20:03 ` William Kennington
2025-04-04 19:31 ` [PATCH v4] " William A. Kennington III
2025-04-06 17:28 ` Guenter Roeck
2025-04-07 20:04 ` William Kennington
2025-04-07 20:10 ` [PATCH v5] " William A. Kennington III
2025-04-07 21:57 ` Guenter Roeck
2025-04-02 22:18 ` [PATCH] " Guenter Roeck
2025-04-03 21:06 ` William Kennington
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=7d6d8740-9d9e-4cc4-9e7b-d005fb87fa2c@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=william@wkennington.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