]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amdgpu/soc15: don't abuse IP soft reset for adapter reset
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jan 2018 21:27:31 +0000 (16:27 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:18:31 +0000 (14:18 -0500)
The IP soft reset interface is for per IP reset but it was
being abused for adapter reset on soc15 asics.  Adjust the
interface to make it explicit.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
drivers/gpu/drm/amd/amdgpu/soc15.c

index e6cb9e2896f1ff5988debb94d9abd62635ca32a1..6e712f12eecddcab6ae42a96e979210468f994bb 100644 (file)
@@ -493,19 +493,8 @@ static int psp_resume(void *handle)
        return ret;
 }
 
-static bool psp_check_reset(void* handle)
+int psp_gpu_reset(struct amdgpu_device *adev)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
-       if (adev->flags & AMD_IS_APU)
-               return true;
-
-       return false;
-}
-
-static int psp_reset(void* handle)
-{
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        return psp_mode1_reset(&adev->psp);
 }
 
@@ -552,9 +541,9 @@ const struct amd_ip_funcs psp_ip_funcs = {
        .suspend = psp_suspend,
        .resume = psp_resume,
        .is_idle = NULL,
-       .check_soft_reset = psp_check_reset,
+       .check_soft_reset = NULL,
        .wait_for_idle = NULL,
-       .soft_reset = psp_reset,
+       .soft_reset = NULL,
        .set_clockgating_state = psp_set_clockgating_state,
        .set_powergating_state = psp_set_powergating_state,
 };
index cf28abc5ccbfe27f49a6686854b4ad1c176a342d..12920968684874045032360171e16366c063ea04 100644 (file)
@@ -158,4 +158,6 @@ extern int psp_wait_for(struct psp_context *psp, uint32_t reg_index,
 
 extern const struct amdgpu_ip_block_version psp_v10_0_ip_block;
 
+int psp_gpu_reset(struct amdgpu_device *adev);
+
 #endif
index 04a471b800644f4c3fbce76b0a50990e68e390e1..8dc8b72ed49b5560e379c2dfedd4a552520d3171 100644 (file)
@@ -417,12 +417,7 @@ static int soc15_asic_reset(struct amdgpu_device *adev)
 
        pci_save_state(adev->pdev);
 
-       for (i = 0; i < AMDGPU_MAX_IP_NUM; i++) {
-               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP){
-                       adev->ip_blocks[i].version->funcs->soft_reset((void *)adev);
-                       break;
-               }
-       }
+       psp_gpu_reset(adev);
 
        pci_restore_state(adev->pdev);