Patch "hwmon: (pmbus/core) clear faults after setting smbalert mask" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    hwmon: (pmbus/core) clear faults after setting smbalert mask

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-pmbus-core-clear-faults-after-setting-smbalert.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit df0adf3944cf2b42893e56e24c81bb4218366c89
Author: Jerome Brunet <jbrunet@xxxxxxxxxxxx>
Date:   Tue Nov 5 18:58:42 2024 +0100

    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@xxxxxxxxxxxx>
    Fixes: 221819ca4c36 ("hwmon: (pmbus/core) Add interrupt support")
    Signed-off-by: Jerome Brunet <jbrunet@xxxxxxxxxxxx>
    Message-ID: <20241105-tps25990-v4-5-0e312ac70b62@xxxxxxxxxxxx>
    Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index ce7fd4ca9d89b..a68b0a98e8d4d 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -3279,7 +3279,17 @@ static int pmbus_regulator_notify(struct pmbus_data *data, int page, int event)
 
 static int pmbus_write_smbalert_mask(struct i2c_client *client, u8 page, u8 reg, u8 val)
 {
-	return _pmbus_write_word_data(client, page, PMBUS_SMBALERT_MASK, reg | (val << 8));
+	int ret;
+
+	ret = _pmbus_write_word_data(client, page, PMBUS_SMBALERT_MASK, reg | (val << 8));
+
+	/*
+	 * Clear fault systematically in case writing PMBUS_SMBALERT_MASK
+	 * is not supported by the chip.
+	 */
+	pmbus_clear_fault_page(client, page);
+
+	return ret;
 }
 
 static irqreturn_t pmbus_fault_handler(int irq, void *pdata)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux