From 93eca5a03b71e8153405bb85e1323ae02d30183b Mon Sep 17 00:00:00 2001 From: Asad Kamal Date: Tue, 30 Jun 2026 21:37:11 +0800 Subject: [PATCH] drm/amd/pm: add 5s custom timeout for unload messages The default SMU message timeout may be too short for the PrepareMp1ForUnload message on smu_v15_0_8, leading to spurious -ETIME errors under load or slow firmware response conditions. Introduce SMU_V15_0_8_MSG_TIMEOUT_US (5 seconds) and apply it to: - smu_v15_0_8_notify_unload(): switch from smu_cmn_send_smc_msg() to smu_cmn_send_smc_msg_with_params_ext() to pass the explicit timeout. v2: Use c2pmsgctl and args directly (Lijo) Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c index aa4daf8f7d6f..b886208ad93d 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c @@ -72,6 +72,9 @@ #define NUM_JPEG_RINGS_FW 10 +/* Custom 5-second timeout (in us) for unload messages */ +#define SMU_V15_0_8_MSG_TIMEOUT_US (5 * 1000 * 1000) + #define to_amdgpu_device(x) (container_of(x, struct amdgpu_device, pm.smu_i2c)) #define SMU_15_0_8_FEA_MAP(smu_feature, smu_15_0_8_feature) \ @@ -1279,12 +1282,18 @@ static int smu_v15_0_8_register_irq_handler(struct smu_context *smu) static int smu_v15_0_8_notify_unload(struct smu_context *smu) { + struct smu_msg_ctl *ctl = &smu->msg_ctl; + struct smu_msg_args args = { + .msg = SMU_MSG_PrepareMp1ForUnload, + .timeout = SMU_V15_0_8_MSG_TIMEOUT_US, + }; + if (amdgpu_in_reset(smu->adev)) return 0; dev_dbg(smu->adev->dev, "Notify PMFW about driver unload"); /* Ignore return, just intimate FW that driver is not going to be there */ - smu_cmn_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL); + ctl->ops->send_msg(ctl, &args); return 0; }