Skip to content

Commit

Permalink
drm/amdgpu: fix uvd crash on Polaris12 during driver unloading
Browse files Browse the repository at this point in the history
There was a change(below) target for such issue:
d82e2c2 ("drm/amdgpu: Fix crash on device remove/driver unload")
But the fix for VI ASICs was missing there. This is a supplement for
that.

Fixes: d82e2c2 ("drm/amdgpu: Fix crash on device remove/driver unload")

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Evan Quan authored and Alex Deucher committed Nov 9, 2021
1 parent 2d32ffd commit 4fc30ea
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,19 @@ static int uvd_v6_0_hw_fini(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

cancel_delayed_work_sync(&adev->uvd.idle_work);

if (RREG32(mmUVD_STATUS) != 0)
uvd_v6_0_stop(adev);

return 0;
}

static int uvd_v6_0_suspend(void *handle)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

/*
* Proper cleanups before halting the HW engine:
* - cancel the delayed idle work
Expand All @@ -558,17 +571,6 @@ static int uvd_v6_0_hw_fini(void *handle)
AMD_CG_STATE_GATE);
}

if (RREG32(mmUVD_STATUS) != 0)
uvd_v6_0_stop(adev);

return 0;
}

static int uvd_v6_0_suspend(void *handle)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

r = uvd_v6_0_hw_fini(adev);
if (r)
return r;
Expand Down

0 comments on commit 4fc30ea

Please sign in to comment.