Skip to content

Commit

Permalink
drm/amdgpu: fix a page fault
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Sonny Jiang authored and Alex Deucher committed Nov 24, 2020
1 parent 4d6a953 commit dbbf272
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,6 @@ static int uvd_v3_1_sw_init(void *handle)
if (r)
return r;

/* Retrieval firmware validate key */
ptr = adev->uvd.inst[0].cpu_addr;
ptr += 192 + 16;
memcpy(&ucode_len, ptr, 4);
ptr += ucode_len;
memcpy(&adev->uvd.keyselect, ptr, 4);

ring = &adev->uvd.inst->ring;
sprintf(ring->name, "uvd");
r = amdgpu_ring_init(adev, ring, 512, &adev->uvd.inst->irq, 0,
Expand All @@ -573,6 +566,13 @@ static int uvd_v3_1_sw_init(void *handle)
if (r)
return r;

/* Retrieval firmware validate key */
ptr = adev->uvd.inst[0].cpu_addr;
ptr += 192 + 16;
memcpy(&ucode_len, ptr, 4);
ptr += ucode_len;
memcpy(&adev->uvd.keyselect, ptr, 4);

r = amdgpu_uvd_entity_init(adev);

return r;
Expand Down

0 comments on commit dbbf272

Please sign in to comment.