Commit 9272bb34 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu: suspend KFD and KGD user queues for S0ix



We need to make sure the user queues are preempted so
GFX can enter gfxoff.

Reviewed-by: default avatarMario Limonciello (AMD) <superm1@kernel.org>
Tested-by: default avatarDavid Perry <david.perry@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f8b367e6)
Cc: stable@vger.kernel.org
parent 2ade36ea
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -5136,7 +5136,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
	adev->in_suspend = true;

	if (amdgpu_sriov_vf(adev)) {
		if (!adev->in_s0ix && !adev->in_runpm)
		if (!adev->in_runpm)
			amdgpu_amdkfd_suspend_process(adev);
		amdgpu_virt_fini_data_exchange(adev);
		r = amdgpu_virt_request_full_gpu(adev, false);
@@ -5156,10 +5156,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)

	amdgpu_device_ip_suspend_phase1(adev);

	if (!adev->in_s0ix) {
	amdgpu_amdkfd_suspend(adev, !amdgpu_sriov_vf(adev) && !adev->in_runpm);
	amdgpu_userq_suspend(adev);
	}

	r = amdgpu_device_evict_resources(adev);
	if (r)
@@ -5254,7 +5252,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
		goto exit;
	}

	if (!adev->in_s0ix) {
	r = amdgpu_amdkfd_resume(adev, !amdgpu_sriov_vf(adev) && !adev->in_runpm);
	if (r)
		goto exit;
@@ -5262,7 +5259,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
	r = amdgpu_userq_resume(adev);
	if (r)
		goto exit;
	}

	r = amdgpu_device_ip_late_init(adev);
	if (r)
@@ -5275,7 +5271,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
		amdgpu_virt_init_data_exchange(adev);
		amdgpu_virt_release_full_gpu(adev, true);

		if (!adev->in_s0ix && !r && !adev->in_runpm)
		if (!r && !adev->in_runpm)
			r = amdgpu_amdkfd_resume_process(adev);
	}