From: Arthur Korn <akorn@google.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Arthur Korn <akorn@google.com>,
sashiko-reviews@lists.linux.dev, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (pmbus) Fall back to CLEAR_FAULTS when STATUS_CML is read-only
Date: Wed, 25 Nov 2026 18:15:44 +0000 [thread overview]
Message-ID: <20261125181605.3299785-1-akorn@google.com> (raw)
In-Reply-To: <b5910c74-7e29-4138-9dd4-030c95c78ec3@roeck-us.net>
On 11/25/26 07:53, Guenter Roeck wrote:
> On 11/24/26 21:49, sashiko-bot@kernel.org wrote:
>> [Severity: Medium]
>> Does clearing data->has_status_cml on any negative return value from
>> _pmbus_write_byte_data() disable STATUS_CML write-1-to-clear across the
>> whole device when a driver exposes a read-only virtual page?
...
> Seems real. Arthur, what do you think ?
>
> [ PMBus is really annoying :-( ]
Confirmed -- Sashiko's finding is real.
I tested on a system with 30x MAX16600B.04 VRs driven by max16601 (which
sets PMBUS_PAGE_VIRTUAL on all 3 pages because the chip NACKs PMBUS_PAGE
0x00 and latches INVALID_COMMAND):
- Page 0 (VCORE at addr) and Page 2 (VSA dummy client at addr + 1)
both implement writable STATUS_CML (0x7e): writing 0xc0 clears
latched INVALID_COMMAND | INVALID_DATA cleanly to 0x00 on both I2C
addresses while preserving other STATUS_CML bits.
- Page 1 is a software-only virtual page exposing vendor registers
0xf1/0xf2 (IIN_SENSOR / TOTAL_INPUT_POWER); max16601_write_byte_data()
and max16601_write_byte() both return -EOPNOTSUPP for page == 1.
With v1, pmbus_clear_cml_faults() hit -EOPNOTSUPP on page 1 and set
data->has_status_cml = false for the whole device, causing page 2 and
subsequent register checks on page 0 to fall back to CLEAR_FAULTS.
In v2, I moved data->has_status_cml = false inside the readback check so
it is only cleared when _pmbus_write_byte_data() succeeds and the readback
still shows PB_CML_FAULT_CLEAR_MASK set (the read-only STATUS_CML case).
When _pmbus_write_byte_data() returns an error (such as -EOPNOTSUPP on a
virtual page), only that call falls back to pmbus_clear_fault_page(),
preserving the existing behavior from d9d30e1cb9ca.
(Side note noticed on the live MAX16600B.04 system: untouched devices boot
with status2 = 0x0002 / status2_cml = 0x80 latched on VSA because
pmbus_check_register() and pmbus_check_status_register() pass page = -1 to
pmbus_clear_cml_fault() / pmbus_check_status_cml(), which targets the
primary client 0x69 instead of data->vsa 0x6a when probing page 2. Happy
to look at that separately if useful.)
Sending [PATCH v2] shortly.
Thanks,
Arthur
next prev parent reply other threads:[~2026-11-25 18:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 5:37 [PATCH] hwmon: (pmbus) Fall back to CLEAR_FAULTS when STATUS_CML is read-only Arthur Korn
2026-11-25 5:49 ` sashiko-bot
2026-11-25 15:53 ` Guenter Roeck
2026-11-25 18:15 ` Arthur Korn [this message]
2026-11-25 20:28 ` Guenter Roeck
[not found] ` <CAJ5cSJE1_zxkS861BT-8-+pxMnp3ONiJkGYjk1jnLQG57EZxmQ@mail.gmail.com>
2026-11-25 18:32 ` 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=20261125181605.3299785-1-akorn@google.com \
--to=akorn@google.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=sashiko-reviews@lists.linux.dev \
/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.