drm/amdgpu:don't invoke srio-gpu-reset in gpu-reset (v2)
authorMonk Liu <Monk.Liu@amd.com>
Fri, 5 May 2017 07:09:42 +0000 (15:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 May 2017 21:40:37 +0000 (17:40 -0400)
because we don't want to do sriov-gpu-reset under certain
cases, so just split those two funtion and don't invoke
sr-iov one from bare-metal one.

V2:
remove debugfs_gpu_reset routine on SRIOV case.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

index ee0877342566da60e7a733a435652a7e8a58e9f0..5b8f7e59099ede894aa1ca4d5b2bce92b928d89a 100644 (file)
@@ -2731,9 +2731,6 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
        int resched;
        bool need_full_reset;
 
-       if (amdgpu_sriov_vf(adev))
-               return amdgpu_sriov_gpu_reset(adev, true);
-
        if (!amdgpu_check_soft_reset(adev)) {
                DRM_INFO("No hardware hang detected. Did some blocks stall?\n");
                return 0;
index 7b60fb79c3a679800874648fd93588517e92205e..ef6c643115b82446eee2e6ab8b263933ee0a6d2d 100644 (file)
@@ -660,11 +660,17 @@ static const struct drm_info_list amdgpu_debugfs_fence_list[] = {
        {"amdgpu_fence_info", &amdgpu_debugfs_fence_info, 0, NULL},
        {"amdgpu_gpu_reset", &amdgpu_debugfs_gpu_reset, 0, NULL}
 };
+
+static const struct drm_info_list amdgpu_debugfs_fence_list_sriov[] = {
+       {"amdgpu_fence_info", &amdgpu_debugfs_fence_info, 0, NULL},
+};
 #endif
 
 int amdgpu_debugfs_fence_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
+       if (amdgpu_sriov_vf(adev))
+               return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list_sriov, 1);
        return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_fence_list, 2);
 #else
        return 0;
index a6b7e367a8607694da3965ac664d2081c7f97dde..62da6c5c6095a03ca0bc0f2c93f783212abd1e94 100644 (file)
@@ -83,7 +83,8 @@ static void amdgpu_irq_reset_work_func(struct work_struct *work)
        struct amdgpu_device *adev = container_of(work, struct amdgpu_device,
                                                  reset_work);
 
-       amdgpu_gpu_reset(adev);
+       if (!amdgpu_sriov_vf(adev))
+               amdgpu_gpu_reset(adev);
 }
 
 /* Disable *all* interrupts */
index 874979cc320736e3262fce2581c4fbb0730fd1ab..1aac8b0e6273ea12e9fa6a1a5a15a9bfa9acaa31 100644 (file)
@@ -36,7 +36,11 @@ static void amdgpu_job_timedout(struct amd_sched_job *s_job)
                  job->base.sched->name,
                  atomic_read(&job->ring->fence_drv.last_seq),
                  job->ring->fence_drv.sync_seq);
-       amdgpu_gpu_reset(job->adev);
+
+       if (amdgpu_sriov_vf(job->adev))
+               amdgpu_sriov_gpu_reset(job->adev, true);
+       else
+               amdgpu_gpu_reset(job->adev);
 }
 
 int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,