From b71824910b03c2dda4f5ca58386d63d4113e8b9a Mon Sep 17 00:00:00 2001 From: brandonchuang Date: Tue, 14 Mar 2017 05:42:46 +0800 Subject: [PATCH] [as7712-32x] Correct thermal id and fan path of thermal plan (#173) --- .../onlp/builds/src/module/src/fani.c | 2 +- .../onlp/builds/src/module/src/sysi.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/fani.c b/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/fani.c index 7e48d6da..5fd76b00 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/fani.c +++ b/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/fani.c @@ -59,7 +59,7 @@ typedef struct fan_path_S #define _MAKE_FAN_PATH_ON_MAIN_BOARD(prj,id) \ { #prj"fan"#id"_present", #prj"fan"#id"_fault", #prj"fan"#id"_front_speed_rpm", \ - #prj"fan"#id"_direction", #prj"fan"#id"_duty_cycle_percentage", #prj"fan"#id"_rear_speed_rpm" } + #prj"fan"#id"_direction", #prj"fan_duty_cycle_percentage", #prj"fan"#id"_rear_speed_rpm" } #define MAKE_FAN_PATH_ON_MAIN_BOARD(prj,id) _MAKE_FAN_PATH_ON_MAIN_BOARD(prj,id) diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/sysi.c b/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/sysi.c index 6fa1ae73..e08f136d 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/sysi.c +++ b/packages/platforms/accton/x86-64/x86-64-accton-as7712-32x/onlp/builds/src/module/src/sysi.c @@ -205,6 +205,13 @@ onlp_sysi_platform_manage_fans(void) return onlp_fani_percentage_set(ONLP_FAN_ID_CREATE(1), FAN_DUTY_CYCLE_MAX); } + /* Decision 1.1: Set fan as full speed if any fan is not present. + */ + if (!(fan_info.status & ONLP_FAN_STATUS_PRESENT)) { + AIM_LOG_ERROR("Fan(%d) is not present, set the other fans as full speed\r\n", i); + return onlp_fani_percentage_set(ONLP_FAN_ID_CREATE(1), FAN_DUTY_CYCLE_MAX); + } + /* Get fan direction (Only get the first one since all fan direction are the same) */ if (i == 1) { @@ -252,9 +259,9 @@ onlp_sysi_platform_manage_fans(void) /* Get current temperature */ - if (onlp_thermali_info_get(ONLP_THERMAL_ID_CREATE(1), &thermal_1) != ONLP_STATUS_OK || - onlp_thermali_info_get(ONLP_THERMAL_ID_CREATE(2), &thermal_2) != ONLP_STATUS_OK || - onlp_thermali_info_get(ONLP_THERMAL_ID_CREATE(3), &thermal_3) != ONLP_STATUS_OK) { + if (onlp_thermali_info_get(ONLP_THERMAL_ID_CREATE(2), &thermal_1) != ONLP_STATUS_OK || + onlp_thermali_info_get(ONLP_THERMAL_ID_CREATE(3), &thermal_2) != ONLP_STATUS_OK || + onlp_thermali_info_get(ONLP_THERMAL_ID_CREATE(4), &thermal_3) != ONLP_STATUS_OK) { AIM_LOG_ERROR("Unable to read thermal status"); return ONLP_STATUS_E_INTERNAL; }