Skip to content

Commit

Permalink
drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.
Browse files Browse the repository at this point in the history
[Why]
SDMA ring buffer test failed if suspend is aborted during
S0i3 resume.

[How]
If suspend is aborted for some reason during S0i3 resume
cycle, it follows SDMA ring test failing and errors in amdgpu
resume. For RN/CZN/Picasso, SMU saves and restores SDMA
registers during S0ix cycle. So, skipping SDMA suspend and
resume from driver solves the issue. This time, the system
is able to resume gracefully even the suspend is aborted.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rajib Mahapatra <rajib.mahapatra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Rajib Mahapatra authored and Alex Deucher committed Feb 14, 2022
1 parent 0136f58 commit f8f4e2a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2057,13 +2057,21 @@ static int sdma_v4_0_suspend(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

/* SMU saves SDMA state for us */
if (adev->in_s0ix)
return 0;

return sdma_v4_0_hw_fini(adev);
}

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

/* SMU restores SDMA state for us */
if (adev->in_s0ix)
return 0;

return sdma_v4_0_hw_init(adev);
}

Expand Down

0 comments on commit f8f4e2a

Please sign in to comment.