Rather than checking in the callbacks, check if the reset
type is supported in the caller.

Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  |  5 +++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 31 ++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c  |  3 ---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c   |  6 -----
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c   |  6 -----
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c   |  6 -----
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c    |  3 ---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c  |  3 ---
 drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c |  3 ---
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c |  3 ---
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c |  3 ---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c |  3 ---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c   |  3 ---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c    |  3 ---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c  |  6 -----
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c  |  3 ---
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c  |  3 ---
 25 files changed, 37 insertions(+), 79 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 45febdc2f3493..8635f66921335 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -111,6 +111,7 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct 
drm_sched_job *s_job)
                amdgpu_job_core_dump(adev, job);
 
        if (amdgpu_gpu_recovery &&
+           amdgpu_ring_is_reset_type_supported(ring, 
AMDGPU_RESET_TYPE_SOFT_RESET) &&
            amdgpu_ring_soft_recovery(ring, job->vmid, s_job->s_fence->parent)) 
{
                dev_err(adev->dev, "ring %s timeout, but soft recovered\n",
                        s_job->sched->name);
@@ -132,7 +133,9 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct 
drm_sched_job *s_job)
        /* attempt a per ring reset */
        if (unlikely(adev->debug_disable_gpu_ring_reset)) {
                dev_err(adev->dev, "Ring reset disabled by debug mask\n");
-       } else if (amdgpu_gpu_recovery && ring->funcs->reset) {
+       } else if (amdgpu_gpu_recovery &&
+                  amdgpu_ring_is_reset_type_supported(ring, 
AMDGPU_RESET_TYPE_PER_QUEUE) &&
+                  ring->funcs->reset) {
                dev_err(adev->dev, "Starting %s ring reset\n",
                        s_job->sched->name);
                r = amdgpu_ring_reset(ring, job->vmid, &job->hw_fence);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 09d7681b7a754..4f69aa60478a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -820,3 +820,34 @@ int amdgpu_ring_reset_helper_end(struct amdgpu_ring *ring,
        drm_sched_wqueue_start(&ring->sched);
        return 0;
 }
+
+bool amdgpu_ring_is_reset_type_supported(struct amdgpu_ring *ring,
+                                        u32 reset_type)
+{
+       switch (ring->funcs->type) {
+       case AMDGPU_RING_TYPE_GFX:
+               if (ring->adev->gfx.gfx_supported_reset & reset_type)
+                       return true;
+               break;
+       case AMDGPU_RING_TYPE_COMPUTE:
+               if (ring->adev->gfx.compute_supported_reset & reset_type)
+                       return true;
+               break;
+       case AMDGPU_RING_TYPE_SDMA:
+               if (ring->adev->sdma.supported_reset & reset_type)
+                       return true;
+               break;
+       case AMDGPU_RING_TYPE_VCN_DEC:
+       case AMDGPU_RING_TYPE_VCN_ENC:
+               if (ring->adev->vcn.supported_reset & reset_type)
+                       return true;
+               break;
+       case AMDGPU_RING_TYPE_VCN_JPEG:
+               if (ring->adev->jpeg.supported_reset & reset_type)
+                       return true;
+               break;
+       default:
+               break;
+       }
+       return false;
+}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
index 309e7bb6001bd..7670f5d82b9e4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
@@ -568,4 +568,6 @@ void amdgpu_ring_reset_helper_begin(struct amdgpu_ring 
*ring,
                                    struct amdgpu_fence *guilty_fence);
 int amdgpu_ring_reset_helper_end(struct amdgpu_ring *ring,
                                 struct amdgpu_fence *guilty_fence);
+bool amdgpu_ring_is_reset_type_supported(struct amdgpu_ring *ring,
+                                        u32 reset_type);
 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index d799bc74936c0..f1f67521c29ca 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -1522,9 +1522,6 @@ int amdgpu_vcn_ring_reset(struct amdgpu_ring *ring,
 {
        struct amdgpu_device *adev = ring->adev;
 
-       if (!(adev->vcn.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (adev->vcn.inst[ring->me].using_unified_queue)
                return -EINVAL;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 744f51a6f522d..7bd506f06eb15 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -9523,9 +9523,6 @@ static int gfx_v10_0_reset_kgq(struct amdgpu_ring *ring,
        u64 addr;
        int r;
 
-       if (!(adev->gfx.gfx_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
                return -EINVAL;
 
@@ -9591,9 +9588,6 @@ static int gfx_v10_0_reset_kcq(struct amdgpu_ring *ring,
        unsigned long flags;
        int i, r;
 
-       if (!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
                return -EINVAL;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 465fcd6503735..c01c241a1b063 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -6808,9 +6808,6 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r;
 
-       if (!(adev->gfx.gfx_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
 
        r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, false);
@@ -6974,9 +6971,6 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r = 0;
 
-       if (!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
 
        r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, true);
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index 5d32ae4b1a4c9..09bf72237d1d6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -5303,9 +5303,6 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r;
 
-       if (!(adev->gfx.gfx_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
 
        r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, false);
@@ -5421,9 +5418,6 @@ static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r;
 
-       if (!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
 
        r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, true);
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 9c0cdf4dde714..20b30f4b3c7d4 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -7183,9 +7183,6 @@ static int gfx_v9_0_reset_kcq(struct amdgpu_ring *ring,
        unsigned long flags;
        int i, r;
 
-       if (!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
                return -EINVAL;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index d80f1fb261d1e..e2a726669f7e6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -3563,9 +3563,6 @@ static int gfx_v9_4_3_reset_kcq(struct amdgpu_ring *ring,
        unsigned long flags;
        int r;
 
-       if (!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
                return -EINVAL;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c 
b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
index b93d6af8f6e54..58239c405fda5 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
@@ -773,9 +773,6 @@ static int jpeg_v2_0_ring_reset(struct amdgpu_ring *ring,
 {
        int r;
 
-       if (!(ring->adev->jpeg.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = jpeg_v2_0_stop(ring->adev);
        if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c 
b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
index b6d5ba0bdc143..3e2c389242dbe 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
@@ -650,9 +650,6 @@ static int jpeg_v2_5_ring_reset(struct amdgpu_ring *ring,
                                unsigned int vmid,
                                struct amdgpu_fence *timedout_fence)
 {
-       if (!(ring->adev->jpeg.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        jpeg_v2_5_stop_inst(ring->adev, ring->me);
        jpeg_v2_5_start_inst(ring->adev, ring->me);
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c 
b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
index a229d7eb900c9..a44eb2667664b 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
@@ -564,9 +564,6 @@ static int jpeg_v3_0_ring_reset(struct amdgpu_ring *ring,
 {
        int r;
 
-       if (!(ring->adev->jpeg.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = jpeg_v3_0_stop(ring->adev);
        if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c 
b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
index f3a9073b8b243..da3ee69f1a3ba 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
@@ -729,9 +729,6 @@ static int jpeg_v4_0_ring_reset(struct amdgpu_ring *ring,
 {
        int r;
 
-       if (!(ring->adev->jpeg.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = jpeg_v4_0_stop(ring->adev);
        if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c 
b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
index 1892c278ea3c4..481d1a2dbe5aa 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
@@ -774,9 +774,6 @@ static int jpeg_v4_0_5_ring_reset(struct amdgpu_ring *ring,
 {
        int r;
 
-       if (!(ring->adev->jpeg.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = jpeg_v4_0_5_stop(ring->adev);
        if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c 
b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
index 0b4de0c6476ae..e0a71909252be 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
@@ -650,9 +650,6 @@ static int jpeg_v5_0_0_ring_reset(struct amdgpu_ring *ring,
 {
        int r;
 
-       if (!(ring->adev->jpeg.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = jpeg_v5_0_0_stop(ring->adev);
        if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c 
b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c
index e622db1f818bf..54523dc1f7026 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c
@@ -836,9 +836,6 @@ static int jpeg_v5_0_1_ring_reset(struct amdgpu_ring *ring,
                                  unsigned int vmid,
                                  struct amdgpu_fence *timedout_fence)
 {
-       if (amdgpu_sriov_vf(ring->adev))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        jpeg_v5_0_1_core_stall_reset(ring);
        jpeg_v5_0_1_init_jrbc(ring);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
index c0c418aa2c299..0fe0f371f6fd5 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
@@ -1664,9 +1664,6 @@ static int sdma_v4_4_2_reset_queue(struct amdgpu_ring 
*ring,
        u32 id = ring->me;
        int r;
 
-       if (!(adev->sdma.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_amdkfd_suspend(adev, true);
        r = amdgpu_sdma_reset_engine(adev, id, false);
        amdgpu_amdkfd_resume(adev, true);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index d8c19601dd2e6..7dc67a22a7a01 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1547,9 +1547,6 @@ static int sdma_v5_0_reset_queue(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r;
 
-       if (!(adev->sdma.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (ring->me >= adev->sdma.num_instances) {
                dev_err(adev->dev, "sdma instance not found\n");
                return -EINVAL;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index 5d56029e88a62..3bd44c24f692d 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -1461,9 +1461,6 @@ static int sdma_v5_2_reset_queue(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r;
 
-       if (!(adev->sdma.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (ring->me >= adev->sdma.num_instances) {
                dev_err(adev->dev, "sdma instance not found\n");
                return -EINVAL;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
index 5d31f318cb3c7..e6d8eddda2bfa 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
@@ -1578,9 +1578,6 @@ static int sdma_v6_0_reset_queue(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r;
 
-       if (!(adev->sdma.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (ring->me >= adev->sdma.num_instances) {
                dev_err(adev->dev, "sdma instance not found\n");
                return -EINVAL;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
index 13abc0c46eab0..b8b06d4c5882c 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
@@ -809,9 +809,6 @@ static int sdma_v7_0_reset_queue(struct amdgpu_ring *ring,
        struct amdgpu_device *adev = ring->adev;
        int r;
 
-       if (!(adev->sdma.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        if (ring->me >= adev->sdma.num_instances) {
                dev_err(adev->dev, "sdma instance not found\n");
                return -EINVAL;
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
index f642a06a77b56..1924e075b66f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -1976,9 +1976,6 @@ static int vcn_v4_0_ring_reset(struct amdgpu_ring *ring,
        struct amdgpu_vcn_inst *vinst = &adev->vcn.inst[ring->me];
        int r;
 
-       if (!(adev->vcn.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = vcn_v4_0_stop(vinst);
        if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
index 3bda19b92cde7..2a3663b551af9 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
@@ -1603,12 +1603,6 @@ static int vcn_v4_0_3_ring_reset(struct amdgpu_ring 
*ring,
        struct amdgpu_device *adev = ring->adev;
        struct amdgpu_vcn_inst *vinst = &adev->vcn.inst[ring->me];
 
-       if (amdgpu_sriov_vf(ring->adev))
-               return -EOPNOTSUPP;
-
-       if (!(adev->vcn.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
 
        vcn_inst = GET_INST(VCN, ring->me);
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
index 039989ab452ad..caf2d95a85d43 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
@@ -1474,9 +1474,6 @@ static int vcn_v4_0_5_ring_reset(struct amdgpu_ring *ring,
        struct amdgpu_vcn_inst *vinst = &adev->vcn.inst[ring->me];
        int r;
 
-       if (!(adev->vcn.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = vcn_v4_0_5_stop(vinst);
        if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
index ec0268b5666cc..07a6e95828808 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
@@ -1201,9 +1201,6 @@ static int vcn_v5_0_0_ring_reset(struct amdgpu_ring *ring,
        struct amdgpu_vcn_inst *vinst = &adev->vcn.inst[ring->me];
        int r;
 
-       if (!(adev->vcn.supported_reset & AMDGPU_RESET_TYPE_PER_QUEUE))
-               return -EOPNOTSUPP;
-
        amdgpu_ring_reset_helper_begin(ring, timedout_fence);
        r = vcn_v5_0_0_stop(vinst);
        if (r)
-- 
2.50.1

Reply via email to