Add errors for existing but empty dev files
Change-Id: Iad9febc50f9b8e6085f8b605249ee884d2f134d6
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
[ROCm/rocm_smi_lib commit: a4b470fe71]
This commit is contained in:
committed by
Dmitrii Galantsev
parent
24edb0acab
commit
6335bdb6e0
@@ -3740,6 +3740,10 @@ rsmi_dev_memory_reserved_pages_get(uint32_t dv_ind, uint32_t *num_pages,
|
||||
|
||||
ret = GetDevValueVec(amd::smi::kDevMemPageBad, dv_ind, &val_vec);
|
||||
|
||||
// file is empty, which is valid for no errors
|
||||
if (ret == RSMI_STATUS_UNEXPECTED_DATA) {
|
||||
ret = RSMI_STATUS_SUCCESS;
|
||||
}
|
||||
if (ret == RSMI_STATUS_FILE_ERROR) {
|
||||
return RSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
@@ -858,8 +858,8 @@ int Device::readDevInfoMultiLineStr(DevInfoTypes type,
|
||||
ss << "Read devInfoMultiLineStr for DevInfoType ("
|
||||
<< RocmSMI::devInfoTypesStrings.at(type) << ")"
|
||||
<< ", but contained no string lines";
|
||||
LOG_INFO(ss);
|
||||
return 0;
|
||||
LOG_ERROR(ss);
|
||||
return ENXIO;
|
||||
}
|
||||
// Remove any *trailing* empty (whitespace) lines
|
||||
while (!retVec->empty() &&
|
||||
@@ -882,6 +882,7 @@ int Device::readDevInfoMultiLineStr(DevInfoTypes type,
|
||||
<< RocmSMI::devInfoTypesStrings.at(type) << ")"
|
||||
<< ", but lines were empty";
|
||||
LOG_INFO(ss);
|
||||
return ENXIO;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user