Skip to content

Commit 3eb1a3a

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Make sure image is written to trigger VBIOS image update flow
The VBIOS image update flow requires userspace to: 1) Write the image to `psp_vbflash` 2) Read `psp_vbflash` 3) Poll `psp_vbflash_status` to check for completion If userspace reads `psp_vbflash` before writing an image, it's possible that it causes problems that can put the dGPU into an invalid state. Explicitly check that an image has been written before letting a read succeed. Cc: [email protected] Fixes: 8424f2c ("drm/amdgpu/psp: Add vbflash sysfs interface support") Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e61f677 commit 3eb1a3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3548,6 +3548,9 @@ static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj,
35483548
void *fw_pri_cpu_addr;
35493549
int ret;
35503550

3551+
if (adev->psp.vbflash_image_size == 0)
3552+
return -EINVAL;
3553+
35513554
dev_info(adev->dev, "VBIOS flash to PSP started");
35523555

35533556
ret = amdgpu_bo_create_kernel(adev, adev->psp.vbflash_image_size,

0 commit comments

Comments
 (0)