[PATCH v2 3/3] drm/amd: Retry delayed work handler if sensor is busy
Mario Limonciello
mario.limonciello at amd.com
Fri Dec 15 17:27:40 UTC 2023
The SW CTF delayed work handler triggers a shutdown if a sensor
read failed for any reason.
The specific circumstance of a busy sensor should be retried
however to ensure that a good value can be returned.
Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index b259e67a229b..ed4feac83b46 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1179,6 +1179,12 @@ static void smu_swctf_delayed_work_handler(struct work_struct *work)
case 0:
if (hotspot_tmp / 1000 < range->software_shutdown_temp)
return;
+ case -EBUSY:
+ dev_warn(adev->dev, "Unable to read hotspot sensor, retrying in %d ms\n",
+ AMDGPU_SWCTF_EXTRA_DELAY);
+ schedule_delayed_work(&smu->swctf_delayed_work,
+ msecs_to_jiffies(AMDGPU_SWCTF_EXTRA_DELAY));
+ return;
default:
dev_err(adev->dev, "Failed to read hotspot temperature: %d\n", r);
}
--
2.34.1
More information about the amd-gfx
mailing list