drm/amd/pm: print the timeout of smc message
authorHuang Rui <ray.huang@amd.com>
Wed, 20 Jan 2021 12:09:41 +0000 (20:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 21 Jan 2021 14:55:05 +0000 (09:55 -0500)
This patch is to help firmware designer to know the smc message timeout
status.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

index e4eff6d..d9ecaa0 100644 (file)
@@ -142,10 +142,15 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
 
        ret = smu_cmn_wait_for_response(smu);
        if (ret != 0x1) {
-               dev_err(adev->dev, "failed send message: %10s (%d) \tparam: 0x%08x response %#x\n",
-                       smu_get_message_name(smu, msg), index, param, ret);
-               if (ret != -ETIME)
+               if (ret == -ETIME) {
+                       dev_err(adev->dev, "message: %15s (%d) \tparam: 0x%08x is timeout (no response)\n",
+                               smu_get_message_name(smu, msg), index, param);
+               } else {
+                       dev_err(adev->dev, "failed send message: %15s (%d) \tparam: 0x%08x response %#x\n",
+                               smu_get_message_name(smu, msg), index, param,
+                               ret);
                        ret = -EIO;
+               }
                goto out;
        }