Files
OpenBMC/meta-luxshare/meta-bhs/recipes-kernel/linux/linux-aspeed/0001-Force-set-pmbus-page-to-4-to-fix-Delta-PSU-reading-e.patch
T

65 lines
2.2 KiB
Diff
Raw Normal View History

2026-04-23 17:07:55 +08:00
From 44944d5fe90cd5a71b60d8393324c6a90779e635 Mon Sep 17 00:00:00 2001
From: "Chen.Zhao" <zhao.chen@luxshare-ict.com>
Date: Thu, 19 Sep 2024 17:08:07 +0800
Subject: [PATCH] Force set pmbus page to 4 to fix Delta PSU reading error
issue Because Delta PSU page command has bug. It not report error when set
page above 3. It will make pmbus logic confusion. So forece set max page to
3.
---
drivers/hwmon/pmbus/pmbus.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/pmbus/pmbus.c b/drivers/hwmon/pmbus/pmbus.c
index 9fa5e237a03f..2ac33333e7d2 100644
--- a/drivers/hwmon/pmbus/pmbus.c
+++ b/drivers/hwmon/pmbus/pmbus.c
@@ -78,6 +78,11 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
PMBUS_STATUS_TEMPERATURE))
info->func[0] |= PMBUS_HAVE_STATUS_TEMP;
+ /*
+ * because delta psu page commad has bug, it will make pmbus mask confusion
+ * force set pmbus mask to enable read current, voltage, fan, temperature and power
+ */
+ info->func[0] = 0x3f27d;
rv = pmbus_query_register(client, PMBUS_READ_EIN);
/* only direct format for EIN and EOUT supported */
if (rv > 0 && (rv & PB_QUERY_COMMAND_SUPPORTED) &&
@@ -97,6 +102,11 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
info->m[PSC_POWER_AVERAGE] = 1;
}
+ /*
+ * because delta psu page commad has bug, it will make pmbus mask confusion.
+ * remove read other page information.
+ */
+ #if 0
/* Sensors detected on all pages */
for (page = 0; page < info->pages; page++) {
if (pmbus_check_word_register(client, page, PMBUS_READ_VOUT)) {
@@ -114,6 +124,7 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
if (pmbus_check_word_register(client, page, PMBUS_READ_POUT))
info->func[page] |= PMBUS_HAVE_POUT;
}
+ #endif
}
/*
@@ -135,7 +146,11 @@ static int pmbus_identify(struct i2c_client *client,
int page;
for (page = 1; page < PMBUS_PAGES; page++) {
- if (pmbus_set_page(client, page, 0xff) < 0)
+ /*
+ * because delta psu page commad has bug, it will make pmbus mask confusion
+ * force set max page to 4.
+ */
+ if ((pmbus_set_page(client, page, 0xff) < 0) || (page > 3))
break;
}
pmbus_set_page(client, 0, 0xff);
--
2.25.1