aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorYintian Tao <yttao@amd.com>2018-08-22 05:08:13 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-08-28 12:55:20 -0400
commite78196444b43caed136bf424b09352d8433cdb95 (patch)
tree509f65f3389f206ae4928a54a45435b7db7e2a06 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parent0c79c0bb872e393d507fb7a0835b2ec124f8266b (diff)
drm/amdgpu: move full access into amdgpu_device_ip_suspend
It will be more safe to make full-acess include both phase1 and phase2. Then accessing special registeris wherever at phase1 or phase2 will not block any shutdown and suspend process under virtualization. Signed-off-by: Yintian Tao <yttao@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 8f431740c424..a20c13c6f6f1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1932,9 +1932,6 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
1932{ 1932{
1933 int i, r; 1933 int i, r;
1934 1934
1935 if (amdgpu_sriov_vf(adev))
1936 amdgpu_virt_request_full_gpu(adev, false);
1937
1938 amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); 1935 amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
1939 amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); 1936 amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
1940 1937
@@ -1953,9 +1950,6 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
1953 } 1950 }
1954 } 1951 }
1955 1952
1956 if (amdgpu_sriov_vf(adev))
1957 amdgpu_virt_release_full_gpu(adev, false);
1958
1959 return 0; 1953 return 0;
1960} 1954}
1961 1955
@@ -2007,11 +2001,17 @@ int amdgpu_device_ip_suspend(struct amdgpu_device *adev)
2007{ 2001{
2008 int r; 2002 int r;
2009 2003
2004 if (amdgpu_sriov_vf(adev))
2005 amdgpu_virt_request_full_gpu(adev, false);
2006
2010 r = amdgpu_device_ip_suspend_phase1(adev); 2007 r = amdgpu_device_ip_suspend_phase1(adev);
2011 if (r) 2008 if (r)
2012 return r; 2009 return r;
2013 r = amdgpu_device_ip_suspend_phase2(adev); 2010 r = amdgpu_device_ip_suspend_phase2(adev);
2014 2011
2012 if (amdgpu_sriov_vf(adev))
2013 amdgpu_virt_release_full_gpu(adev, false);
2014
2015 return r; 2015 return r;
2016} 2016}
2017 2017