Skip to content

Commit dbbf272

Browse files
Sonny Jiangalexdeucher
authored andcommitted
drm/amdgpu: fix a page fault
The UVD firmware is copied to cpu addr in uvd_resume, so it should be used after that. This is to fix a bug introduced by patch drm/amdgpu: fix SI UVD firmware validate resume fail. Signed-off-by: Sonny Jiang <sonny.jiang@amd.com> Reviewed-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> CC: stable@vger.kernel.org
1 parent 4d6a953 commit dbbf272

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,13 +555,6 @@ static int uvd_v3_1_sw_init(void *handle)
555555
if (r)
556556
return r;
557557

558-
/* Retrieval firmware validate key */
559-
ptr = adev->uvd.inst[0].cpu_addr;
560-
ptr += 192 + 16;
561-
memcpy(&ucode_len, ptr, 4);
562-
ptr += ucode_len;
563-
memcpy(&adev->uvd.keyselect, ptr, 4);
564-
565558
ring = &adev->uvd.inst->ring;
566559
sprintf(ring->name, "uvd");
567560
r = amdgpu_ring_init(adev, ring, 512, &adev->uvd.inst->irq, 0,
@@ -573,6 +566,13 @@ static int uvd_v3_1_sw_init(void *handle)
573566
if (r)
574567
return r;
575568

569+
/* Retrieval firmware validate key */
570+
ptr = adev->uvd.inst[0].cpu_addr;
571+
ptr += 192 + 16;
572+
memcpy(&ucode_len, ptr, 4);
573+
ptr += ucode_len;
574+
memcpy(&adev->uvd.keyselect, ptr, 4);
575+
576576
r = amdgpu_uvd_entity_init(adev);
577577

578578
return r;

0 commit comments

Comments
 (0)