SWDEV-371210 - [AMDSMI][LinuxBM] SMILIB returns wrong pcie speed value
Signed-off-by: Marko Oblak <Marko.Oblak@amd.com>
Change-Id: Ie3ca6997f11d18505df799fef9cd9d53716d53f9
[ROCm/amdsmi commit: 8429df989c]
This commit is contained in:
@@ -41,5 +41,6 @@ amdsmi_status_t smi_amdgpu_get_enabled_blocks(amd::smi::AMDSmiGPUDevice* device,
|
||||
amdsmi_status_t smi_amdgpu_get_bad_page_info(amd::smi::AMDSmiGPUDevice* device, uint32_t *num_pages, amdsmi_retired_page_record_t *info);
|
||||
amdsmi_status_t smi_amdgpu_get_ecc_error_count(amd::smi::AMDSmiGPUDevice* device, amdsmi_error_count_t *err_cnt);
|
||||
amdsmi_status_t smi_amdgpu_get_driver_version(amd::smi::AMDSmiGPUDevice* device, int *length, char *version);
|
||||
amdsmi_status_t smi_amdgpu_get_pcie_speed_from_pcie_type(uint16_t pcie_type, uint32_t *pcie_speed);
|
||||
|
||||
#endif //
|
||||
|
||||
@@ -1855,7 +1855,7 @@ amdsmi_get_pcie_link_status(amdsmi_device_handle device_handle, amdsmi_pcie_info
|
||||
return status;
|
||||
|
||||
info->pcie_lanes = metric_info.pcie_link_width;
|
||||
info->pcie_speed = metric_info.pcie_link_speed * 100; // convert to MT/s
|
||||
status = smi_amdgpu_get_pcie_speed_from_pcie_type(metric_info.pcie_link_speed, &info->pcie_speed); // mapping to MT/s
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -458,3 +458,25 @@ amdsmi_status_t smi_amdgpu_get_driver_version(amd::smi::AMDSmiGPUDevice* device,
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
amdsmi_status_t smi_amdgpu_get_pcie_speed_from_pcie_type(uint16_t pcie_type, uint32_t *pcie_speed)
|
||||
{
|
||||
switch (pcie_type) {
|
||||
case 0:
|
||||
*pcie_speed = 2500;
|
||||
break;
|
||||
case 1:
|
||||
*pcie_speed = 5000;
|
||||
break;
|
||||
case 2:
|
||||
*pcie_speed = 8000;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
*pcie_speed = 16000;
|
||||
break;
|
||||
default:
|
||||
return AMDSMI_STATUS_API_FAILED;
|
||||
}
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user