]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amd/amdgpu: skip ucode loading if ucode_size == 0
authorChengming Gui <Jack.Gui@amd.com>
Tue, 30 Aug 2022 08:33:01 +0000 (16:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2022 10:39:45 +0000 (12:39 +0200)
[ Upstream commit 39c84b8e929dbd4f63be7e04bf1a2bcd92b44177 ]

Restrict the ucode loading check to avoid frontdoor loading error.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 5b41c29f3ed5036398529258c74524bf1a53d938..65744c3bd3648ff22e12c84ab27d9ccc15cd4887 100644 (file)
@@ -2505,7 +2505,7 @@ static int psp_load_smu_fw(struct psp_context *psp)
 static bool fw_load_skip_check(struct psp_context *psp,
                               struct amdgpu_firmware_info *ucode)
 {
-       if (!ucode->fw)
+       if (!ucode->fw || !ucode->ucode_size)
                return true;
 
        if (ucode->ucode_id == AMDGPU_UCODE_ID_SMC &&