All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunming Zhou <David1.Zhou-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Chunming Zhou <David1.Zhou-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 10/11] drm/amd: reset jobs to recover entity
Date: Thu, 28 Jul 2016 18:13:47 +0800	[thread overview]
Message-ID: <1469700828-25650-11-git-send-email-David1.Zhou@amd.com> (raw)
In-Reply-To: <1469700828-25650-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>

remove recover_entity for recover_rq when reset job.
add recover_entity back when recover job

Change-Id: Ic2e5cb6ab79d2abc49374e1770299487e327efe9
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
---
 drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 69a9d40..f832d0d 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -417,9 +417,10 @@ static void amd_sched_job_timedout(struct work_struct *work)
 	job->sched->ops->timedout_job(job);
 }
 
+/* scheduler must be parked before job reset */
 void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched)
 {
-	struct amd_sched_job *s_job;
+	struct amd_sched_job *s_job, *tmp;
 
 	spin_lock(&sched->job_list_lock);
 	list_for_each_entry_reverse(s_job, &sched->ring_mirror_list, node) {
@@ -429,14 +430,6 @@ void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched)
 		}
 	}
 	atomic_set(&sched->hw_rq_count, 0);
-	spin_unlock(&sched->job_list_lock);
-}
-
-void amd_sched_job_recovery(struct amd_gpu_scheduler *sched)
-{
-	struct amd_sched_job *s_job, *tmp;
-
-	spin_lock(&sched->job_list_lock);
 	list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {
 		list_del_init(&s_job->node);
 		spin_unlock(&sched->job_list_lock);
@@ -444,6 +437,14 @@ void amd_sched_job_recovery(struct amd_gpu_scheduler *sched)
 		spin_lock(&sched->job_list_lock);
 	}
 	spin_unlock(&sched->job_list_lock);
+	amd_sched_rq_remove_entity(&sched->sched_rq[AMD_SCHED_PRIORITY_RECOVER],
+				   &sched->recover_entity);
+}
+
+void amd_sched_job_recovery(struct amd_gpu_scheduler *sched)
+{
+	amd_sched_rq_add_entity(&sched->sched_rq[AMD_SCHED_PRIORITY_RECOVER],
+				&sched->recover_entity);
 }
 
 /**
-- 
1.9.1

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

  parent reply	other threads:[~2016-07-28 10:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 10:13 [PATCH 00/11] add recovery entity Chunming Zhou
     [not found] ` <1469700828-25650-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-28 10:13   ` [PATCH 01/11] drm/amdgpu: hw ring should be empty when gpu reset Chunming Zhou
     [not found]     ` <1469700828-25650-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-30  3:53       ` Edward O'Callaghan
2016-07-28 10:13   ` [PATCH 02/11] drm/amdgpu: specify entity to amdgpu_copy_buffer Chunming Zhou
2016-07-28 10:13   ` [PATCH 03/11] drm/amd: add recover run queue for scheduler Chunming Zhou
     [not found]     ` <1469700828-25650-4-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-30  3:52       ` Edward O'Callaghan
2016-07-28 10:13   ` [PATCH 04/11] drm/amdgpu: fix vm init error path Chunming Zhou
     [not found]     ` <1469700828-25650-5-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-30  3:41       ` Edward O'Callaghan
     [not found]         ` <7115f9e7-3afd-a693-3e23-1ad4acb3c700-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
2016-07-30  3:44           ` Edward O'Callaghan
2016-07-28 10:13   ` [PATCH 05/11] drm/amdgpu: add vm recover entity Chunming Zhou
     [not found]     ` <1469700828-25650-6-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-30  3:51       ` Edward O'Callaghan
2016-07-28 10:13   ` [PATCH 06/11] drm/amdgpu: use all pte rings to recover page table Chunming Zhou
2016-07-28 10:13   ` [PATCH 07/11] drm/amd: add recover entity for every scheduler Chunming Zhou
2016-07-28 10:13   ` [PATCH 08/11] drm/amd: use scheduler to recover hw jobs Chunming Zhou
2016-07-28 10:13   ` [PATCH 09/11] drm/amd: hw job list should be exact Chunming Zhou
     [not found]     ` <1469700828-25650-10-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-30  3:46       ` Edward O'Callaghan
2016-07-28 10:13   ` Chunming Zhou [this message]
2016-07-28 10:13   ` [PATCH 11/11] drm/amdgpu: no need fence wait every time Chunming Zhou
2016-08-02  2:06   ` [PATCH 00/11] add recovery entity zhoucm1
2016-08-03 13:43   ` Christian König
     [not found]     ` <233bde9b-f7ff-2697-1fd9-419d08f8f359-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-08-04  3:10       ` zhoucm1
     [not found]         ` <57A2B217.2010100-5C7GfCeVMHo@public.gmane.org>
2016-08-04  8:39           ` Christian König
     [not found]             ` <a8ade743-309a-6982-7bad-a7c5648bd5e2-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-08-04  9:04               ` zhoucm1
2016-08-04  9:04               ` zhoucm1
2016-08-02  7:51 [PATCH 00/11] add recovery entity and run queue Chunming Zhou
     [not found] ` <1470124302-23615-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-08-02  7:51   ` [PATCH 10/11] drm/amd: reset jobs to recover entity Chunming Zhou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469700828-25650-11-git-send-email-David1.Zhou@amd.com \
    --to=david1.zhou-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.