2
0

Don't assert when fan is not supported.

Add a check when RSMI_STATUS_NOT_SUPPORTED is returned for fanRead/fanReadWrite.
Fix for SWDEV-314176 & SWDEV-314175 reported.

Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: Icf2cc541a3fa5ca4794aff5d6bc91104adc45e6d
Este cometimento está contido em:
Divya Shikre
2022-01-18 14:58:13 -05:00
cometido por Divya Uday Shikre
ascendente 3356084074
cometimento 11a71c63b1
2 ficheiros modificados com 19 adições e 2 eliminações
+10 -1
Ver ficheiro
@@ -102,7 +102,16 @@ void TestFanRead::Run(void) {
std::cout << "\t**Current Fan Speed: ";
}
err = rsmi_dev_fan_speed_get(i, 0, &val_i64);
CHK_ERR_ASRT(err)
if (err == RSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout << "\t**" << ": " <<
"Not supported on this machine" << std::endl;
}
return;
} else {
CHK_ERR_ASRT(err)
}
// Verify api support checking functionality is working
err = rsmi_dev_fan_speed_get(i, 0, nullptr);
+9 -1
Ver ficheiro
@@ -101,7 +101,15 @@ void TestFanReadWrite::Run(void) {
PrintDeviceHeader(dv_ind);
ret = rsmi_dev_fan_speed_get(dv_ind, 0, &orig_speed);
CHK_ERR_ASRT(ret)
if (ret == RSMI_STATUS_NOT_SUPPORTED) {
IF_VERB(STANDARD) {
std::cout << "\t**" << ": " <<
"Not supported on this machine" << std::endl;
}
return;
} else {
CHK_ERR_ASRT(ret)
}
IF_VERB(STANDARD) {
std::cout << "Original fan speed: " << orig_speed << std::endl;
}