drm/amd: Make sure image is written to trigger VBIOS image update flow
authorjsg <jsg@openbsd.org>
Thu, 22 Jun 2023 05:10:03 +0000 (05:10 +0000)
committerjsg <jsg@openbsd.org>
Thu, 22 Jun 2023 05:10:03 +0000 (05:10 +0000)
From Mario Limonciello
b2706d862b6577b8218bdef1c238e175624b906d in linux-6.1.y/6.1.35
3eb1a3a04056ba3df3205e169b8acc9da0c65a94 in mainline linux

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

index 3ab88a1..cdd12fa 100644 (file)
@@ -3570,6 +3570,9 @@ static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj,
        void *fw_pri_cpu_addr;
        int ret;
 
+       if (adev->psp.vbflash_image_size == 0)
+               return -EINVAL;
+
        dev_info(adev->dev, "VBIOS flash to PSP started");
 
        ret = amdgpu_bo_create_kernel(adev, adev->psp.vbflash_image_size,