All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/amdgpu: stop all rings before doing gpu recover
@ 2018-02-28  7:21 Monk Liu
       [not found] ` <1519802463-9090-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 32+ messages in thread
From: Monk Liu @ 2018-02-28  7:21 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu

found recover_vram_from_shadow sometimes get executed
in paralle with SDMA scheduler, should stop all
schedulers before doing gpu reset/recover

Change-Id: Ibaef3e3c015f3cf88f84b2eaf95cda95ae1a64e3
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 40 +++++++++++-------------------
 1 file changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 75d1733..e9d81a8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2649,22 +2649,23 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 
 	/* block TTM */
 	resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
+
 	/* store modesetting */
 	if (amdgpu_device_has_dc_support(adev))
 		state = drm_atomic_helper_suspend(adev->ddev);
 
-	/* block scheduler */
+	/* block all schedulers and reset given job's ring */
 	for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
 		struct amdgpu_ring *ring = adev->rings[i];
 
 		if (!ring || !ring->sched.thread)
 			continue;
 
-		/* only focus on the ring hit timeout if &job not NULL */
+		kthread_park(ring->sched.thread);
+
 		if (job && job->ring->idx != i)
 			continue;
 
-		kthread_park(ring->sched.thread);
 		drm_sched_hw_job_reset(&ring->sched, &job->base);
 
 		/* after all hw jobs are reset, hw fence is meaningless, so force_completion */
@@ -2707,33 +2708,22 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 			}
 			dma_fence_put(fence);
 		}
+	}
 
-		for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
-			struct amdgpu_ring *ring = adev->rings[i];
-
-			if (!ring || !ring->sched.thread)
-				continue;
+	for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
+		struct amdgpu_ring *ring = adev->rings[i];
 
-			/* only focus on the ring hit timeout if &job not NULL */
-			if (job && job->ring->idx != i)
-				continue;
+		if (!ring || !ring->sched.thread)
+			continue;
 
+		/* only need recovery sched of the given job's ring
+		 * or all rings (in the case @job is NULL)
+		 * after above amdgpu_reset accomplished
+		 */
+		if ((!job || job->ring->idx == i) && !r)
 			drm_sched_job_recovery(&ring->sched);
-			kthread_unpark(ring->sched.thread);
-		}
-	} else {
-		for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
-			struct amdgpu_ring *ring = adev->rings[i];
 
-			if (!ring || !ring->sched.thread)
-				continue;
-
-			/* only focus on the ring hit timeout if &job not NULL */
-			if (job && job->ring->idx != i)
-				continue;
-
-			kthread_unpark(adev->rings[i]->sched.thread);
-		}
+		kthread_unpark(ring->sched.thread);
 	}
 
 	if (amdgpu_device_has_dc_support(adev)) {
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2018-03-01 10:11 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28  7:21 [PATCH 1/4] drm/amdgpu: stop all rings before doing gpu recover Monk Liu
     [not found] ` <1519802463-9090-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-28  7:21   ` [PATCH 2/4] drm/amdgpu: cleanups for vram lost handling Monk Liu
     [not found]     ` <1519802463-9090-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-28 12:22       ` Christian König
2018-02-28 13:29       ` Andrey Grodzovsky
     [not found]         ` <13337cd9-78e9-df36-f2ab-749cf182177b-5C7GfCeVMHo@public.gmane.org>
2018-02-28 13:36           ` Liu, Monk
     [not found]             ` <BLUPR12MB0449D9513F4798028569ED0884C70-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-28 13:41               ` Andrey Grodzovsky
2018-02-28 14:25       ` Alex Deucher
2018-02-28  7:21   ` [PATCH 3/4] drm/amdgpu: don't return when ring not ready for fill_buffer Monk Liu
     [not found]     ` <1519802463-9090-3-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-28 12:23       ` Christian König
     [not found]         ` <01879d0d-edea-680e-c9f2-1005d94f1dfd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-28 12:34           ` Liu, Monk
     [not found]             ` <BLUPR12MB0449BEDBC1FCE72C0021C88184C70-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-28 12:40               ` Liu, Monk
2018-02-28 12:45               ` Christian König
     [not found]                 ` <3a8945f9-848e-dd19-373d-5dddc69f76cb-5C7GfCeVMHo@public.gmane.org>
2018-03-01  6:01                   ` Liu, Monk
     [not found]                     ` <BLUPR12MB04498FBA36C747652758D56E84C60-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-01  8:16                       ` Christian König
     [not found]                         ` <7af9b6fb-28e8-4e25-5d4a-5b566a00cbea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-01  8:23                           ` Liu, Monk
     [not found]                             ` <BLUPR12MB04490BF8390F6270B265969984C60-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-01  8:41                               ` Christian König
     [not found]                                 ` <6dedfc7f-cf69-676f-463d-be52cda1b1bb-5C7GfCeVMHo@public.gmane.org>
2018-03-01  8:51                                   ` Liu, Monk
     [not found]                                     ` <BLUPR12MB04491577FB4B6D6A5BCC3B8784C60-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-01  9:25                                       ` Liu, Monk
     [not found]                                         ` <BLUPR12MB044933DC340A46EADC1F7A2784C60-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-01  9:30                                           ` Christian König
2018-03-01  9:37                                       ` Liu, Monk
     [not found]                                         ` <BLUPR12MB044905DB87968358166BDEF484C60-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-01  9:39                                           ` Christian König
     [not found]                                             ` <a6812ba2-1c34-c6a4-d65a-09f924ea0940-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-01  9:41                                               ` Liu, Monk
     [not found]                                                 ` <BLUPR12MB044923819BB9561C57EACA8584C60-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-01  9:51                                                   ` Christian König
     [not found]                                                     ` <26eb2e4c-33dd-2160-5b83-a7ff9e3a2558-5C7GfCeVMHo@public.gmane.org>
2018-03-01 10:11                                                       ` Liu, Monk
2018-02-28  7:21   ` [PATCH 4/4] drm/amdgpu: try again kiq access if not in IRQ Monk Liu
     [not found]     ` <1519802463-9090-4-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2018-02-28  7:41       ` Liu, Monk
2018-02-28 12:20   ` [PATCH 1/4] drm/amdgpu: stop all rings before doing gpu recover Christian König
     [not found]     ` <9e575c74-c6ce-76ef-a09c-1dec5a4807a3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-02-28 13:30       ` Andrey Grodzovsky
     [not found]         ` <e4756f8b-d8f9-9849-aad4-a23193e367f6-5C7GfCeVMHo@public.gmane.org>
2018-02-28 13:31           ` Liu, Monk
     [not found]             ` <BLUPR12MB04491C15749E9DCAB3DEF1A684C70-7LeqcoF/hwpTIQvHjXdJlwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-28 13:42               ` Andrey Grodzovsky
2018-02-28 16:40               ` Andrey Grodzovsky
     [not found]                 ` <a54b5a4f-a370-87ec-7bac-33e6036107f9-5C7GfCeVMHo@public.gmane.org>
2018-02-28 17:42                   ` Andrey Grodzovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.