drm/amdgpu: remove old lockup detection infrastructure
authorChristian König <christian.koenig@amd.com>
Tue, 1 Sep 2015 08:50:26 +0000 (10:50 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Oct 2015 15:35:12 +0000 (11:35 -0400)
It didn't worked to well anyway.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
15 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c

index 736eb4560fd588a3d4a80b77f463b2fa8ef0f0e0..911d67032d57b60dab67dcc9a959517599851632 100644 (file)
@@ -345,7 +345,6 @@ struct amdgpu_ring_funcs {
        /* testing functions */
        int (*test_ring)(struct amdgpu_ring *ring);
        int (*test_ib)(struct amdgpu_ring *ring);
-       bool (*is_lockup)(struct amdgpu_ring *ring);
        /* insert NOP packets */
        void (*insert_nop)(struct amdgpu_ring *ring, uint32_t count);
 };
@@ -907,8 +906,6 @@ struct amdgpu_ring {
        unsigned                ring_size;
        unsigned                ring_free_dw;
        int                     count_dw;
-       atomic_t                last_rptr;
-       atomic64_t              last_activity;
        uint64_t                gpu_addr;
        uint32_t                align_mask;
        uint32_t                ptr_mask;
@@ -1230,8 +1227,6 @@ void amdgpu_ring_commit(struct amdgpu_ring *ring);
 void amdgpu_ring_unlock_commit(struct amdgpu_ring *ring);
 void amdgpu_ring_undo(struct amdgpu_ring *ring);
 void amdgpu_ring_unlock_undo(struct amdgpu_ring *ring);
-void amdgpu_ring_lockup_update(struct amdgpu_ring *ring);
-bool amdgpu_ring_test_lockup(struct amdgpu_ring *ring);
 unsigned amdgpu_ring_backup(struct amdgpu_ring *ring,
                            uint32_t **data);
 int amdgpu_ring_restore(struct amdgpu_ring *ring,
@@ -1974,7 +1969,6 @@ struct amdgpu_device {
        bool                            suspend;
        bool                            need_dma32;
        bool                            accel_working;
-       bool                            needs_reset;
        struct work_struct              reset_work;
        struct notifier_block           acpi_nb;
        struct amdgpu_i2c_chan          *i2c_bus[AMDGPU_MAX_I2C_BUS];
@@ -2253,7 +2247,6 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
 #define amdgpu_ring_parse_cs(r, p, ib) ((r)->funcs->parse_cs((p), (ib)))
 #define amdgpu_ring_test_ring(r) (r)->funcs->test_ring((r))
 #define amdgpu_ring_test_ib(r) (r)->funcs->test_ib((r))
-#define amdgpu_ring_is_lockup(r) (r)->funcs->is_lockup((r))
 #define amdgpu_ring_get_rptr(r) (r)->funcs->get_rptr((r))
 #define amdgpu_ring_get_wptr(r) (r)->funcs->get_wptr((r))
 #define amdgpu_ring_set_wptr(r) (r)->funcs->set_wptr((r))
index 901a460b2c5573bfe4ae1af93c16d8be95140420..28c9ee334dd7f51f0cc14c1928fd3dc81947857f 100644 (file)
@@ -1816,12 +1816,6 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
 
        down_write(&adev->exclusive_lock);
 
-       if (!adev->needs_reset) {
-               up_write(&adev->exclusive_lock);
-               return 0;
-       }
-
-       adev->needs_reset = false;
        atomic_inc(&adev->gpu_reset_counter);
 
        /* block TTM */
index fcad7e060938853c5f274a9fd2ddc3c438a1ab14..4010aa6b4e53bd566145754bb63d0369e2f2a732 100644 (file)
@@ -269,17 +269,6 @@ static void amdgpu_fence_check_lockup(struct work_struct *work)
        if (amdgpu_fence_activity(ring)) {
                wake_up_all(&ring->fence_drv.fence_queue);
        }
-       else if (amdgpu_ring_is_lockup(ring)) {
-               /* good news we believe it's a lockup */
-               dev_warn(ring->adev->dev, "GPU lockup (current fence id "
-                       "0x%016llx last fence id 0x%016llx on ring %d)\n",
-                       (uint64_t)atomic64_read(&fence_drv->last_seq),
-                       fence_drv->sync_seq[ring->idx], ring->idx);
-
-               /* remember that we need an reset */
-               ring->adev->needs_reset = true;
-               wake_up_all(&ring->fence_drv.fence_queue);
-       }
        up_read(&ring->adev->exclusive_lock);
 }
 
@@ -380,7 +369,6 @@ static bool amdgpu_fence_enable_signaling(struct fence *f)
  */
 static int amdgpu_fence_ring_wait_seq(struct amdgpu_ring *ring, uint64_t seq)
 {
-       struct amdgpu_device *adev = ring->adev;
        bool signaled = false;
 
        BUG_ON(!ring);
@@ -391,8 +379,7 @@ static int amdgpu_fence_ring_wait_seq(struct amdgpu_ring *ring, uint64_t seq)
                return 0;
 
        wait_event(ring->fence_drv.fence_queue, (
-                  (signaled = amdgpu_fence_seq_signaled(ring, seq))
-                  || adev->needs_reset));
+                  (signaled = amdgpu_fence_seq_signaled(ring, seq))));
 
        if (signaled)
                return 0;
@@ -939,11 +926,6 @@ signed long amdgpu_fence_wait_any(struct amdgpu_device *adev,
                if (amdgpu_test_signaled_any(array, count))
                        break;
 
-               if (adev->needs_reset) {
-                       t = -EDEADLK;
-                       break;
-               }
-
                t = schedule_timeout(t);
 
                if (t > 0 && intr && signal_pending(current))
index c439735ee670ddffa18930840b520c626017eca8..aad4c1c6944805164b482e0ed5a9f714193da790 100644 (file)
@@ -298,7 +298,6 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
                r = amdgpu_ring_test_ib(ring);
                if (r) {
                        ring->ready = false;
-                       adev->needs_reset = false;
 
                        if (ring == &adev->gfx.gfx_ring[0]) {
                                /* oh, oh, that's really bad */
index b13a74b273a690959dc79b9944a73c3a83fdf9a2..b2df348aa2231bf34d2e7a47657a8db69589d077 100644 (file)
@@ -67,8 +67,6 @@ void amdgpu_ring_free_size(struct amdgpu_ring *ring)
        if (!ring->ring_free_dw) {
                /* this is an empty ring */
                ring->ring_free_dw = ring->ring_size / 4;
-               /*  update lockup info to avoid false positive */
-               amdgpu_ring_lockup_update(ring);
        }
 }
 
@@ -208,46 +206,6 @@ void amdgpu_ring_unlock_undo(struct amdgpu_ring *ring)
        mutex_unlock(ring->ring_lock);
 }
 
-/**
- * amdgpu_ring_lockup_update - update lockup variables
- *
- * @ring: amdgpu_ring structure holding ring information
- *
- * Update the last rptr value and timestamp (all asics).
- */
-void amdgpu_ring_lockup_update(struct amdgpu_ring *ring)
-{
-       atomic_set(&ring->last_rptr, amdgpu_ring_get_rptr(ring));
-       atomic64_set(&ring->last_activity, jiffies_64);
-}
-
-/**
- * amdgpu_ring_test_lockup() - check if ring is lockedup by recording information
- * @ring:       amdgpu_ring structure holding ring information
- *
- */
-bool amdgpu_ring_test_lockup(struct amdgpu_ring *ring)
-{
-       uint32_t rptr = amdgpu_ring_get_rptr(ring);
-       uint64_t last = atomic64_read(&ring->last_activity);
-       uint64_t elapsed;
-
-       if (rptr != atomic_read(&ring->last_rptr)) {
-               /* ring is still working, no lockup */
-               amdgpu_ring_lockup_update(ring);
-               return false;
-       }
-
-       elapsed = jiffies_to_msecs(jiffies_64 - last);
-       if (amdgpu_lockup_timeout && elapsed >= amdgpu_lockup_timeout) {
-               dev_err(ring->adev->dev, "ring %d stalled for more than %llumsec\n",
-                       ring->idx, elapsed);
-               return true;
-       }
-       /* give a chance to the GPU ... */
-       return false;
-}
-
 /**
  * amdgpu_ring_backup - Back up the content of a ring
  *
@@ -436,7 +394,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
        if (amdgpu_debugfs_ring_init(adev, ring)) {
                DRM_ERROR("Failed to register debugfs file for rings !\n");
        }
-       amdgpu_ring_lockup_update(ring);
        return 0;
 }
 
index 814598e76c98d5b44432517ae0e5f19c0e1bb37d..5f712ceddf08e4765fb544aff0cad26e6bbcd890 100644 (file)
@@ -1290,24 +1290,6 @@ const struct amd_ip_funcs cik_sdma_ip_funcs = {
        .set_powergating_state = cik_sdma_set_powergating_state,
 };
 
-/**
- * cik_sdma_ring_is_lockup - Check if the DMA engine is locked up
- *
- * @ring: amdgpu_ring structure holding ring information
- *
- * Check if the async DMA engine is locked up (CIK).
- * Returns true if the engine appears to be locked up, false if not.
- */
-static bool cik_sdma_ring_is_lockup(struct amdgpu_ring *ring)
-{
-
-       if (cik_sdma_is_idle(ring->adev)) {
-               amdgpu_ring_lockup_update(ring);
-               return false;
-       }
-       return amdgpu_ring_test_lockup(ring);
-}
-
 static const struct amdgpu_ring_funcs cik_sdma_ring_funcs = {
        .get_rptr = cik_sdma_ring_get_rptr,
        .get_wptr = cik_sdma_ring_get_wptr,
@@ -1320,7 +1302,6 @@ static const struct amdgpu_ring_funcs cik_sdma_ring_funcs = {
        .emit_hdp_flush = cik_sdma_ring_emit_hdp_flush,
        .test_ring = cik_sdma_ring_test_ring,
        .test_ib = cik_sdma_ring_test_ib,
-       .is_lockup = cik_sdma_ring_is_lockup,
        .insert_nop = cik_sdma_ring_insert_nop,
 };
 
index e992bf2ff66ce23e8c1d5f81b6b093713c1fac90..72793f93e2fcc9989e5f936ec1d43ba0593ac69e 100644 (file)
@@ -5542,24 +5542,6 @@ const struct amd_ip_funcs gfx_v7_0_ip_funcs = {
        .set_powergating_state = gfx_v7_0_set_powergating_state,
 };
 
-/**
- * gfx_v7_0_ring_is_lockup - check if the 3D engine is locked up
- *
- * @adev: amdgpu_device pointer
- * @ring: amdgpu_ring structure holding ring information
- *
- * Check if the 3D engine is locked up (CIK).
- * Returns true if the engine is locked, false if not.
- */
-static bool gfx_v7_0_ring_is_lockup(struct amdgpu_ring *ring)
-{
-       if (gfx_v7_0_is_idle(ring->adev)) {
-               amdgpu_ring_lockup_update(ring);
-               return false;
-       }
-       return amdgpu_ring_test_lockup(ring);
-}
-
 static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
        .get_rptr = gfx_v7_0_ring_get_rptr_gfx,
        .get_wptr = gfx_v7_0_ring_get_wptr_gfx,
@@ -5573,7 +5555,6 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
        .emit_hdp_flush = gfx_v7_0_ring_emit_hdp_flush,
        .test_ring = gfx_v7_0_ring_test_ring,
        .test_ib = gfx_v7_0_ring_test_ib,
-       .is_lockup = gfx_v7_0_ring_is_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
@@ -5590,7 +5571,6 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
        .emit_hdp_flush = gfx_v7_0_ring_emit_hdp_flush,
        .test_ring = gfx_v7_0_ring_test_ring,
        .test_ib = gfx_v7_0_ring_test_ib,
-       .is_lockup = gfx_v7_0_ring_is_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
index 7dd7651b0ba7edb192c9a104450d64937d8fb736..e0355eaddabee6a9de117e965ad5186f92db9cd9 100644 (file)
@@ -4075,15 +4075,6 @@ static void gfx_v8_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
        }
 }
 
-static bool gfx_v8_0_ring_is_lockup(struct amdgpu_ring *ring)
-{
-       if (gfx_v8_0_is_idle(ring->adev)) {
-               amdgpu_ring_lockup_update(ring);
-               return false;
-       }
-       return amdgpu_ring_test_lockup(ring);
-}
-
 static u32 gfx_v8_0_ring_get_rptr_compute(struct amdgpu_ring *ring)
 {
        return ring->adev->wb.wb[ring->rptr_offs];
@@ -4365,7 +4356,6 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
        .emit_hdp_flush = gfx_v8_0_ring_emit_hdp_flush,
        .test_ring = gfx_v8_0_ring_test_ring,
        .test_ib = gfx_v8_0_ring_test_ib,
-       .is_lockup = gfx_v8_0_ring_is_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
@@ -4382,7 +4372,6 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
        .emit_hdp_flush = gfx_v8_0_ring_emit_hdp_flush,
        .test_ring = gfx_v8_0_ring_test_ring,
        .test_ib = gfx_v8_0_ring_test_ib,
-       .is_lockup = gfx_v8_0_ring_is_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
index f8b868c7c4960f80f6f33e472becb1aeaff9cafb..2cf50180cc51bd496289feb892a2a56b6d81abe0 100644 (file)
@@ -1295,24 +1295,6 @@ const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
        .set_powergating_state = sdma_v2_4_set_powergating_state,
 };
 
-/**
- * sdma_v2_4_ring_is_lockup - Check if the DMA engine is locked up
- *
- * @ring: amdgpu_ring structure holding ring information
- *
- * Check if the async DMA engine is locked up (VI).
- * Returns true if the engine appears to be locked up, false if not.
- */
-static bool sdma_v2_4_ring_is_lockup(struct amdgpu_ring *ring)
-{
-
-       if (sdma_v2_4_is_idle(ring->adev)) {
-               amdgpu_ring_lockup_update(ring);
-               return false;
-       }
-       return amdgpu_ring_test_lockup(ring);
-}
-
 static const struct amdgpu_ring_funcs sdma_v2_4_ring_funcs = {
        .get_rptr = sdma_v2_4_ring_get_rptr,
        .get_wptr = sdma_v2_4_ring_get_wptr,
@@ -1325,7 +1307,6 @@ static const struct amdgpu_ring_funcs sdma_v2_4_ring_funcs = {
        .emit_hdp_flush = sdma_v2_4_ring_emit_hdp_flush,
        .test_ring = sdma_v2_4_ring_test_ring,
        .test_ib = sdma_v2_4_ring_test_ib,
-       .is_lockup = sdma_v2_4_ring_is_lockup,
        .insert_nop = sdma_v2_4_ring_insert_nop,
 };
 
index 670555a45da91b052446bb99eba4599a082efa46..0271bf9c0609235becf3272c68ee71bd10992afa 100644 (file)
@@ -1428,24 +1428,6 @@ const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
        .set_powergating_state = sdma_v3_0_set_powergating_state,
 };
 
-/**
- * sdma_v3_0_ring_is_lockup - Check if the DMA engine is locked up
- *
- * @ring: amdgpu_ring structure holding ring information
- *
- * Check if the async DMA engine is locked up (VI).
- * Returns true if the engine appears to be locked up, false if not.
- */
-static bool sdma_v3_0_ring_is_lockup(struct amdgpu_ring *ring)
-{
-
-       if (sdma_v3_0_is_idle(ring->adev)) {
-               amdgpu_ring_lockup_update(ring);
-               return false;
-       }
-       return amdgpu_ring_test_lockup(ring);
-}
-
 static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = {
        .get_rptr = sdma_v3_0_ring_get_rptr,
        .get_wptr = sdma_v3_0_ring_get_wptr,
@@ -1458,7 +1440,6 @@ static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = {
        .emit_hdp_flush = sdma_v3_0_ring_emit_hdp_flush,
        .test_ring = sdma_v3_0_ring_test_ring,
        .test_ib = sdma_v3_0_ring_test_ib,
-       .is_lockup = sdma_v3_0_ring_is_lockup,
        .insert_nop = sdma_v3_0_ring_insert_nop,
 };
 
index ed50dd725788df2e766650868f1782b49dec2cdd..5e9f73af83a8431b25d6d153132df3a22ce31e31 100644 (file)
@@ -885,7 +885,6 @@ static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = {
        .emit_semaphore = uvd_v4_2_ring_emit_semaphore,
        .test_ring = uvd_v4_2_ring_test_ring,
        .test_ib = uvd_v4_2_ring_test_ib,
-       .is_lockup = amdgpu_ring_test_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
index 9ad8b9906c0bec4af7448884bf5b24149a490ad9..38864f5629814c7782682b4b8436b67e30aede3a 100644 (file)
@@ -824,7 +824,6 @@ static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = {
        .emit_semaphore = uvd_v5_0_ring_emit_semaphore,
        .test_ring = uvd_v5_0_ring_test_ring,
        .test_ib = uvd_v5_0_ring_test_ib,
-       .is_lockup = amdgpu_ring_test_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
index 7e9934fa41939f55255aa77ee6c828b888fc4f3f..121915bbc3b62f096024aa8c60a09a8aa8b579ba 100644 (file)
@@ -808,7 +808,6 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_funcs = {
        .emit_semaphore = uvd_v6_0_ring_emit_semaphore,
        .test_ring = uvd_v6_0_ring_test_ring,
        .test_ib = uvd_v6_0_ring_test_ib,
-       .is_lockup = amdgpu_ring_test_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
index cd16df543f64e881eaee35fd8dea409385e055d8..52ac7a8f1e58b91f3ad0c441b6a175062bddad29 100644 (file)
@@ -642,7 +642,6 @@ static const struct amdgpu_ring_funcs vce_v2_0_ring_funcs = {
        .emit_semaphore = amdgpu_vce_ring_emit_semaphore,
        .test_ring = amdgpu_vce_ring_test_ring,
        .test_ib = amdgpu_vce_ring_test_ib,
-       .is_lockup = amdgpu_ring_test_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };
 
index f0656dfb53f3ad2adfda85c61666246fa6a0ae21..b1bf27bb8f9e562532ec0cb1b26870181d4a9195 100644 (file)
@@ -643,7 +643,6 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_funcs = {
        .emit_semaphore = amdgpu_vce_ring_emit_semaphore,
        .test_ring = amdgpu_vce_ring_test_ring,
        .test_ib = amdgpu_vce_ring_test_ib,
-       .is_lockup = amdgpu_ring_test_lockup,
        .insert_nop = amdgpu_ring_insert_nop,
 };