Add support for KFD Thermal Throttling SMI event

Add handling for receiving thermal throttling SMI event from the
kernel.
Also, update the event notification test to work with the new event.

Change-Id: Ib89c12b244f90998ccbae0a38b37f25705d156e0


[ROCm/amdsmi commit: aff75c955f]
This commit is contained in:
Mukul Joshi
2020-08-10 12:50:33 -04:00
committed by Mukul Joshi
parent d7e3e0f579
commit e6f5d59edf
4 changed files with 7 additions and 4 deletions
@@ -544,6 +544,7 @@ struct kfd_ioctl_import_dmabuf_args {
enum kfd_smi_event {
KFD_SMI_EVENT_NONE = 0, /* not used */
KFD_SMI_EVENT_VMFAULT = 1, /* event start counting at 1 */
KFD_SMI_EVENT_THERMAL_THROTTLE = 2,
};
#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
+4 -3
View File
@@ -280,8 +280,9 @@ typedef struct {
typedef enum {
RSMI_EVT_NOTIF_VMFAULT = KFD_SMI_EVENT_VMFAULT, //!< VM page fault
RSMI_EVT_NOTIF_FIRST = RSMI_EVT_NOTIF_VMFAULT,
RSMI_EVT_NOTIF_THERMAL_THROTTLE = KFD_SMI_EVENT_THERMAL_THROTTLE,
RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_VMFAULT
RSMI_EVT_NOTIF_LAST = RSMI_EVT_NOTIF_THERMAL_THROTTLE
} rsmi_evt_notification_type_t;
/*
@@ -3228,8 +3229,8 @@ rsmi_event_notification_init(uint32_t dv_ind);
* bit position starting from 1.
* For example, if the mask field is 0x0000000000000003, which means first bit,
* bit 1 (bit position start from 1) and bit 2 are set, which indicate interest
* in receiving RSMI_EVT_NOTIF_VMFAULT (which has a value of 1) and the next
* event in that list which has a value of 2.
* in receiving RSMI_EVT_NOTIF_VMFAULT (which has a value of 1) and
* RSMI_EVT_NOTIF_THERMAL_THROTTLE event (which has a value of 2).
*
* @retval ::RSMI_STATUS_INIT_ERROR is returned if
* ::rsmi_event_notification_init() has not been called before a call to this