[SWDEV-230863] add two new interfaces for background health check (#4)

1. Get the bad pages threshold of a processor.
2. Verify the checksum of RAS EEPROM

Signed-off-by: Meng Li <li.meng@amd.com>
This commit is contained in:
Meng, Li (Jassmine)
2025-01-08 07:26:55 +08:00
committed by GitHub
parent d32f2a109a
commit dc400d916e
4 changed files with 124 additions and 0 deletions
+40
View File
@@ -260,6 +260,8 @@ typedef enum {
AMDSMI_STATUS_ARG_PTR_NULL = 53, //!< Parsed argument is invalid
AMDSMI_STATUS_AMDGPU_RESTART_ERR = 54, //!< AMDGPU restart failed
AMDSMI_STATUS_SETTING_UNAVAILABLE = 55, //!< Setting is not available
AMDSMI_STATUS_CORRUPTED_EEPROM = 56, //!< EEPROM is corrupted
// General errors
AMDSMI_STATUS_MAP_ERROR = 0xFFFFFFFE, //!< The internal library error did not map to a status code
AMDSMI_STATUS_UNKNOWN_ERROR = 0xFFFFFFFF, //!< An unknown error occurred
@@ -2640,6 +2642,44 @@ amdsmi_status_t
amdsmi_get_gpu_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages,
amdsmi_retired_page_record_t *info);
/**
* @brief Get the bad pages threshold of a processor. It is not supported on virtual
* machine guest
*
* @platform{gpu_bm_linux} @platform{host}
*
* @details This call will query the device @p processor_handle for the
* threshold of bad pages (written to @p threshold address).
* @param[in] processor_handle a processor handle
* @param[out] threshold of bad page count.
*
* @note This function requires root access
*
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
*/
amdsmi_status_t
amdsmi_get_gpu_bad_page_threshold(amdsmi_processor_handle processor_handle, uint32_t *threshold);
/**
* @brief Verify the checksum of RAS EEPROM. It is not supported on virtual
* machine guest
*
* @platform{gpu_bm_linux} @platform{host}
*
* @details This call will verify the device @p processor_handle for the
* checksum of RAS EEPROM.
* @param[in] processor_handle a processor handle
*
* @note This function requires root access
*
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success
* AMDSMI_STATUS_CORRUPTED_EEPROM on the device's EEPROM corruption
* others on fail
*/
amdsmi_status_t
amdsmi_gpu_validate_ras_eeprom(amdsmi_processor_handle processor_handle);
/**
* @brief Returns RAS features info.
*
+2
View File
@@ -45,6 +45,8 @@ amdsmi_status_t smi_amdgpu_get_power_cap(amd::smi::AMDSmiGPUDevice* device, int
amdsmi_status_t smi_amdgpu_get_ranges(amd::smi::AMDSmiGPUDevice* device, amdsmi_clk_type_t domain, int *max_freq, int *min_freq, int *num_dpm, int *sleep_state_freq);
amdsmi_status_t smi_amdgpu_get_enabled_blocks(amd::smi::AMDSmiGPUDevice* device, uint64_t *enabled_blocks);
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_bad_page_threshold(amd::smi::AMDSmiGPUDevice* device, uint32_t *threshold);
amdsmi_status_t smi_amdgpu_validate_ras_eeprom(amd::smi::AMDSmiGPUDevice* device);
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);