rocm_smi_lib: Fix rocm-smi --resetfans results in Permission Denied

For operations related to:
  --resetfans
  --setfan

We report 'Not supported' for these cases instead of 'Permission denied'

Code changes related to the following:
  * rocm_smi_properties
  * rocm_smi related APIs

Change-Id: I144646efc3804fabd45cc5a46351803950b4feb7
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
Этот коммит содержится в:
Oliveira, Daniel
2023-09-12 16:34:04 -05:00
коммит произвёл Daniel Oliveira
родитель d9381b6dae
Коммит 12f395e592
4 изменённых файлов: 43 добавлений и 16 удалений
+6 -2
Просмотреть файл
@@ -813,8 +813,10 @@ def resetFans(deviceList):
for device in deviceList:
sensor_ind = c_uint32(0)
ret = rocmsmi.rsmi_dev_fan_reset(device, sensor_ind)
if rsmi_ret_ok(ret, device, 'reset_fan'):
if rsmi_ret_ok(ret, device, silent=True):
printLog(device, 'Successfully reset fan speed to driver control', None)
else:
printLog(device, 'Not supported on the given system', None)
printLogSpacer()
@@ -1335,8 +1337,10 @@ def setFanSpeed(deviceList, fan):
else:
fanLevel = int(str(fan))
ret = rocmsmi.rsmi_dev_fan_speed_set(device, 0, int(fanLevel))
if rsmi_ret_ok(ret, device, 'set_fan_speed'):
if rsmi_ret_ok(ret, device, silent=True):
printLog(device, 'Successfully set fan speed to level %s' % (str(int(fanLevel))), None)
else:
printLog(device, 'Not supported on the given system', None)
printLogSpacer()