]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (pmbus/core) clear faults after setting smbalert mask
authorJerome Brunet <jbrunet@baylibre.com>
Tue, 5 Nov 2024 17:58:42 +0000 (18:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:52:53 +0000 (13:52 +0100)
commit7cad9f0ba9e6e562101aa0f119fc8ba53d565079
treec4b4f053bd8857fb17c29dd30ae54d89bf011eb7
parent05b8ea1f16667f07c8e5843fb4bde3e49d49ead8
hwmon: (pmbus/core) clear faults after setting smbalert mask

[ Upstream commit 509c3a362675bc995771df74d545548f98e37621 ]

pmbus_write_smbalert_mask() ignores the errors if the chip can't set
smbalert mask the standard way. It is not necessarily a problem for the irq
support if the chip is otherwise properly setup but it may leave an
uncleared fault behind.

pmbus_core will pick the fault on the next register_check(). The register
check will fails regardless of the actual register support by the chip.

This leads to missing attributes or debugfs entries for chips that should
provide them.

We cannot rely on register_check() as PMBUS_SMBALERT_MASK may be read-only.

Unconditionally clear the page fault after setting PMBUS_SMBALERT_MASK to
avoid the problem.

Suggested-by: Guenter Roeck <linux@roeck-us.net>
Fixes: 221819ca4c36 ("hwmon: (pmbus/core) Add interrupt support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Message-ID: <20241105-tps25990-v4-5-0e312ac70b62@baylibre.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/pmbus/pmbus_core.c