drm/amdkfd: Update SMI throttle event bitmask
PATCH 1/1 drm/amdkfd: Update SMI throttle event bitmask
Update Arcturus/Aldebaran thermal throttle SMI event path to use ASIC-independent throttler bits when logging.
Signed-off-by Graham Sider <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 ++-- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 10 +++++----- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 4 +++- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 4 +++- 6 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +2 -2
@@ -330,7 +330,7 @@ int kgd2kfd_pre_reset(struct kfd_dev *kfd);int kgd2kfd_post_reset (struct kfd_dev *kfd);void kgd2kfd_interrupt (struct kfd_dev *kfd,const void *ih_ring_entry);void kgd2kfd_set_sram_ecc_flag (struct kfd_dev *kfd); -void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask); +void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint64_t throttle_bitmask);#else static inline int kgd2kfd_init (void ) {
@@ -389,7 +389,7 @@ void kgd2kfd_set_sram_ecc_flag(struct kfd_dev *kfd) }static inline -void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask) +void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint64_t throttle_bitmask) { }#endif
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -1
@@ -1370,7 +1370,7 @@ void kfd_dec_compute_active(struct kfd_dev *kfd)WARN_ONCE (count <0 ,"Compute profile ref. count error" ); } -void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask) +void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint64_t throttle_bitmask) {if (kfd && kfd->init_complete)kfd_smi_event_update_thermal_throttling (kfd, throttle_bitmask);
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +5 -5
@@ -205,23 +205,23 @@ void kfd_smi_event_update_gpu_reset(struct kfd_dev *dev, bool post_reset) }void kfd_smi_event_update_thermal_throttling (struct kfd_dev *dev, -uint32_t throttle_bitmask) +uint64_t throttle_bitmask) {struct amdgpu_device *adev = (struct amdgpu_device *)dev->kgd;/* * ThermalThrottle msg = throttle_bitmask(8): * thermal_interrupt_count(16): -* 1 byte event + 1 byte space + 8 byte throttle_bitmask + +* 1 byte event + 1 byte space + 16 byte throttle_bitmask + * 1 byte : + 16 byte thermal_interupt_counter + 1 byte \n + -* 1 byte \0 = 29 +* 1 byte \0 = 37 */ -char fifo_in[29 ]; +char fifo_in[37 ];int len;if (list_empty (&dev->smi_clients))return ; - len =snprintf (fifo_in,sizeof (fifo_in),"%x %x:%llx\n" , + len =snprintf (fifo_in,sizeof (fifo_in),"%x %llx:%llx\n" ,KFD_SMI_EVENT_THERMAL_THROTTLE , throttle_bitmask,atomic64_read (&adev->smu.throttle_int_counter));
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h +1 -1
@@ -26,7 +26,7 @@int kfd_smi_event_open (struct kfd_dev *dev,uint32_t *fd);void kfd_smi_event_update_vmfault (struct kfd_dev *dev,uint16_t pasid);void kfd_smi_event_update_thermal_throttling (struct kfd_dev *dev, -uint32_t throttle_bitmask); +uint64_t throttle_bitmask);void kfd_smi_event_update_gpu_reset (struct kfd_dev *dev,bool post_reset);#endif
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -1
@@ -2178,7 +2178,9 @@ static void arcturus_log_thermal_throttling_event(struct smu_context *smu)dev_warn (adev->dev,"WARN: GPU thermal throttling temperature reached, expect performance decrease. %s.\n" , log_buf); -kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, throttler_status); +kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, +smu_cmn_get_indep_throttler_status (throttler_status, + arcturus_throttler_map)); }static uint16_t arcturus_get_current_pcie_link_speed (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +3 -1
@@ -1627,7 +1627,9 @@ static void aldebaran_log_thermal_throttling_event(struct smu_context *smu)dev_warn (adev->dev,"WARN: GPU thermal throttling temperature reached, expect performance decrease. %s.\n" , log_buf); -kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, throttler_status); +kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, +smu_cmn_get_indep_throttler_status (throttler_status, + aldebaran_throttler_map)); }static int aldebaran_get_current_pcie_link_speed (struct smu_context *smu)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only]
Reviewed-by Harish Kasiviswanathan <[email protected]>
-----Original Message-----
From: Sider, Graham <[email protected]>
Sent: Thursday, July 8, 2021 1:39 PM
To: [email protected]
Cc: Kasiviswanathan, Harish <[email protected]>; Sider, Graham <[email protected]>
Subject: [PATCH] drm/amdkfd: Update SMI throttle event bitmask
Update Arcturus/Aldebaran thermal throttle SMI event path to use ASIC-independent throttler bits when logging.
Signed-off-by Graham Sider <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 ++-- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 10 +++++----- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 4 +++- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 4 +++- 6 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +2 -2
@@ -330,7 +330,7 @@ int kgd2kfd_pre_reset(struct kfd_dev *kfd);int kgd2kfd_post_reset (struct kfd_dev *kfd);void kgd2kfd_interrupt (struct kfd_dev *kfd,const void *ih_ring_entry);void kgd2kfd_set_sram_ecc_flag (struct kfd_dev *kfd); -void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask); +void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint64_t throttle_bitmask);#else static inline int kgd2kfd_init (void ) {
@@ -389,7 +389,7 @@ void kgd2kfd_set_sram_ecc_flag(struct kfd_dev *kfd) }static inline -void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask) +void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint64_t throttle_bitmask) { }#endif
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -1
@@ -1370,7 +1370,7 @@ void kfd_dec_compute_active(struct kfd_dev *kfd)WARN_ONCE (count <0 ,"Compute profile ref. count error" ); } -void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask) +void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint64_t throttle_bitmask) {if (kfd && kfd->init_complete)kfd_smi_event_update_thermal_throttling (kfd, throttle_bitmask);
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +5 -5
@@ -205,23 +205,23 @@ void kfd_smi_event_update_gpu_reset(struct kfd_dev *dev, bool post_reset) }void kfd_smi_event_update_thermal_throttling (struct kfd_dev *dev, -uint32_t throttle_bitmask) +uint64_t throttle_bitmask) {struct amdgpu_device *adev = (struct amdgpu_device *)dev->kgd;/* * ThermalThrottle msg = throttle_bitmask(8): * thermal_interrupt_count(16): -* 1 byte event + 1 byte space + 8 byte throttle_bitmask + +* 1 byte event + 1 byte space + 16 byte throttle_bitmask + * 1 byte : + 16 byte thermal_interupt_counter + 1 byte \n + -* 1 byte \0 = 29 +* 1 byte \0 = 37 */ -char fifo_in[29 ]; +char fifo_in[37 ];int len;if (list_empty (&dev->smi_clients))return ; - len =snprintf (fifo_in,sizeof (fifo_in),"%x %x:%llx\n" , + len =snprintf (fifo_in,sizeof (fifo_in),"%x %llx:%llx\n" ,KFD_SMI_EVENT_THERMAL_THROTTLE , throttle_bitmask,atomic64_read (&adev->smu.throttle_int_counter));
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h +1 -1
@@ -26,7 +26,7 @@int kfd_smi_event_open (struct kfd_dev *dev,uint32_t *fd);void kfd_smi_event_update_vmfault (struct kfd_dev *dev,uint16_t pasid);void kfd_smi_event_update_thermal_throttling (struct kfd_dev *dev, -uint32_t throttle_bitmask); +uint64_t throttle_bitmask);void kfd_smi_event_update_gpu_reset (struct kfd_dev *dev,bool post_reset);#endif
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -1
@@ -2178,7 +2178,9 @@ static void arcturus_log_thermal_throttling_event(struct smu_context *smu)dev_warn (adev->dev,"WARN: GPU thermal throttling temperature reached, expect performance decrease. %s.\n" , log_buf); -kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, throttler_status); +kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, +smu_cmn_get_indep_throttler_status (throttler_status, + arcturus_throttler_map)); }static uint16_t arcturus_get_current_pcie_link_speed (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +3 -1
@@ -1627,7 +1627,9 @@ static void aldebaran_log_thermal_throttling_event(struct smu_context *smu)dev_warn (adev->dev,"WARN: GPU thermal throttling temperature reached, expect performance decrease. %s.\n" , log_buf); -kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, throttler_status); +kgd2kfd_smi_event_throttle (smu->adev->kfd.dev, +smu_cmn_get_indep_throttler_status (throttler_status, + aldebaran_throttler_map)); }static int aldebaran_get_current_pcie_link_speed (struct smu_context *smu)
Signature · 5 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx