Skip to content

Commit 3537d6a

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: stable@vger.kernel.org Fixes: 8424f2c ("drm/amdgpu/psp: Add vbflash sysfs interface support") Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 55682a8 commit 3537d6a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

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

3620+
if (adev->psp.vbflash_image_size == 0)
3621+
return -EINVAL;
3622+
36203623
dev_info(adev->dev, "VBIOS flash to PSP started");
36213624

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

0 commit comments

Comments
 (0)