drm/amdkfd: Avoid null pointer in SMI event
Subsystems (3)
PATCH 1/1 drm/amdkfd: Avoid null pointer in SMI event
Power Management IP is initialized/enabled before KFD init. When a thermal throttling happens before kfd_smi_init is done, calling the KFD SMI update function causes a stack dump by referring a NULL pointer ( smi_clients list). Check if kfd_init is completed before calling the function.
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -1
@@ -1297,7 +1297,7 @@ void kfd_dec_compute_active(struct kfd_dev *kfd)void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask) { -if (kfd) +if (kfd && kfd->init_complete)kfd_smi_event_update_thermal_throttling (kfd, throttle_bitmask); }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
Regards,
Mukul
-----Original Message-----
From: Lin, Amber <[email protected]>
Sent: Tuesday, March 30, 2021 5:03 PM
To: [email protected]
Cc: Joshi, Mukul <[email protected]>; Lin, Amber <[email protected]>
Subject: [PATCH] drm/amdkfd: Avoid null pointer in SMI event
Power Management IP is initialized/enabled before KFD init. When a thermal throttling happens before kfd_smi_init is done, calling the KFD SMI update function causes a stack dump by referring a NULL pointer ( smi_clients list). Check if kfd_init is completed before calling the function.
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -2
@@ -1297,7 +1297,7 @@ void kfd_dec_compute_active(struct kfd_dev *kfd)void kgd2kfd_smi_event_throttle (struct kfd_dev *kfd,uint32_t throttle_bitmask) { -if (kfd) +if (kfd && kfd->init_complete)kfd_smi_event_update_thermal_throttling (kfd, throttle_bitmask); } --
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx