]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: compare MES firmware version ucode for gfx11
authorSunil Khatri <sunil.khatri@amd.com>
Mon, 1 Jun 2026 14:41:17 +0000 (20:11 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Jun 2026 19:25:46 +0000 (15:25 -0400)
MES firmware should report the same version whether read from
the register or from the firmware ucode binary. This is not
always the case, so add a log when they mismatch.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c

index c9467b26e42ce0e86c4ccf0e2f3c5db8022a32ff..e3972673fd641611242c3b5ce6917b45675a5611 100644 (file)
@@ -781,6 +781,18 @@ out:
        return r;
 }
 
+void amdgpu_mes_validate_fw_version(struct amdgpu_device *adev)
+{
+       u32 fw_from_ucode = adev->mes.fw_version[AMDGPU_MES_SCHED_PIPE];
+       u32 fw_from_reg = adev->mes.sched_version & AMDGPU_MES_VERSION_MASK;
+
+       if (fw_from_ucode != fw_from_reg)
+               dev_info(adev->dev,
+                        "MES firmware reports incorrect version in ucode binary (0x%x vs 0x%x)\n",
+                        fw_from_ucode, fw_from_reg);
+}
+
+
 bool amdgpu_mes_suspend_resume_all_supported(struct amdgpu_device *adev)
 {
        uint32_t mes_rev = adev->mes.sched_version & AMDGPU_MES_VERSION_MASK;
index 93990d4990f2e4eccd1b33694e6972bd5e68b53e..fdd06a17520a29513983fb5cbef3b1deae11fc58 100644 (file)
@@ -441,6 +441,7 @@ struct amdgpu_mes_funcs {
        (adev)->mes.kiq_hw_fini((adev), (xcc_id))
 
 int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe);
+void amdgpu_mes_validate_fw_version(struct amdgpu_device *adev);
 int amdgpu_mes_init(struct amdgpu_device *adev);
 void amdgpu_mes_fini(struct amdgpu_device *adev);
 
index 147ba2942690fd391fbc2d42edb8c039b1642523..ac6d4f2773363c2320985110b7fddf6cc52b11c8 100644 (file)
@@ -1688,6 +1688,7 @@ static int mes_v11_0_hw_init(struct amdgpu_ip_block *ip_block)
        if (r)
                goto failure;
 
+       amdgpu_mes_validate_fw_version(adev);
 out:
        /*
         * Disable KIQ ring usage from the driver once MES is enabled.