drm/amd/amdgpu: skip ucode loading if ucode_size == 0
authorjsg <jsg@openbsd.org>
Tue, 20 Sep 2022 12:04:35 +0000 (12:04 +0000)
committerjsg <jsg@openbsd.org>
Tue, 20 Sep 2022 12:04:35 +0000 (12:04 +0000)
From Chengming Gui
985a5d3d491d558f785b77cc5b86837bfa408587 in linux 5.15.y/5.15.69
39c84b8e929dbd4f63be7e04bf1a2bcd92b44177 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c

index 82dcdb6..d60941b 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 &&