From 1283c4aefa47a596a4a963a2de4db564300bdcb9 Mon Sep 17 00:00:00 2001 From: michael_shih Date: Thu, 21 Dec 2023 14:39:06 +0800 Subject: [PATCH] JIRA-ONSBUSWI-2698: [ec-sonic][common driver][pmbus][ym2651y.c] When psu_power_good is failed, temperature return 1023 degree. [why to do]: The driver will poll for 3 seconds at a time to update the pmbus value. Before modification, psu_power_good = failed ==>The temperature will be returned as 0 (degrees). This will cause the sonic to send syslog when the psu is powered up, but detect 0 degrees before updating the correct temperature. (misjudgment) Therefore, it is necessary to modify the value that when psu_power_good = failed ==> the temperature returns 1023 (degrees), so that the python program can know that the status of 1023 is for power_good is failed value(befor update the correct temperature value). --- .../sonic-platform-modules-accton/common/modules/ym2651y.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c b/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c index 82e5ba082..b41408184 100755 --- a/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c +++ b/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c @@ -983,6 +983,11 @@ static int ym2651y_update_thread(void *arg) /* PMBus STATUS_WORD(0x79): psu_power_good, high byte bit 3, 0=>OK, 1=>FAIL */ data->reg_val.status_word |= 0x800; + + /* psu_power_good = failed, modified to return 1023 degree for python used. */ + data->reg_val.temp_input[0] = 0x3ff; + data->reg_val.temp_input[1] = 0x3ff; + data->reg_val.temp_input[2] = 0x3ff; } mutex_unlock(&data->update_lock);