[PATCH v3 3/3] drm/amd: Retry delayed work handler if sensor is busy

Mario Limonciello mario.limonciello at amd.com
Fri Dec 15 19:55:36 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 963cf6e76935..5eb46b6bad43 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1182,6 +1182,12 @@ static void smu_swctf_delayed_work_handler(struct work_struct *work)
 			if (hotspot_tmp / 1000 < range->software_shutdown_temp)
 				return;
 			break;
+		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