All of lore.kernel.org
 help / color / mirror / Atom feed
From: xinhui pan <xinhui.pan@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	"Felix Kuehling" <Felix.Kuehling@amd.com>,
	"xinhui pan" <xinhui.pan@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH] drm/amdgpu: Check entity rq
Date: Wed, 25 Mar 2020 19:07:02 +0800	[thread overview]
Message-ID: <20200325110702.30919-1-xinhui.pan@amd.com> (raw)

gpu recover will call sdma suspend/resume. In this period, ring will be
disabled. So the vm_pte_scheds(sdma.instance[X].ring.sched)->ready will
be false.

If we submit any jobs in this ring-disabled period. We fail to pick up
a rq for vm entity and entity->rq will set to NULL.
amdgpu_vm_sdma_commit did not check the entity->rq, so fix it. Otherwise
hit panic.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
index cf96c335b258..d30d103e48a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
@@ -95,6 +95,8 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,
 	int r;
 
 	entity = p->direct ? &p->vm->direct : &p->vm->delayed;
+	if (!entity->rq)
+		return -ENOENT;
 	ring = container_of(entity->rq->sched, struct amdgpu_ring, sched);
 
 	WARN_ON(ib->length_dw == 0);
-- 
2.17.1

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

             reply	other threads:[~2020-03-25 11:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 11:07 xinhui pan [this message]
2020-03-25 11:14 ` [PATCH] drm/amdgpu: Check entity rq Nirmoy
2020-03-25 11:13   ` Koenig, Christian
2020-03-25 11:34     ` Pan, Xinhui
2020-03-25 11:37     ` Pan, Xinhui
  -- strict thread matches above, loose matches on Subject: below --
2020-03-25  5:47 xinhui pan
2020-03-25  7:48 ` Christian König
2020-03-25  9:23   ` Pan, Xinhui
2020-03-25 10:54     ` Pan, Xinhui
2020-03-25 11:03     ` Nirmoy
2020-03-30 11:11       ` Christian König

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=20200325110702.30919-1-xinhui.pan@amd.com \
    --to=xinhui.pan@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /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.