<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div dir="auto">
<div dir="auto">
<div dir="auto">Hi guys,
<div dir="auto"><br>
</div>
<div dir="auto">thanks for pointing this out Nirmoy.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Yeah, could be that I forgot to commit the patch. Currently I don't know at which end of the chaos I should start to clean up.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Christian.</div>
</div>
<div><br>
<div class="x_elided-text">Am 25.03.2020 12:09 schrieb "Das, Nirmoy" <Nirmoy.Das@amd.com>:<br type="attribution">
<blockquote style="margin:0 0 0 0.8ex; border-left:1px #ccc solid; padding-left:1ex">
<div><font size="2"><span style="font-size:11pt">
<div>Hi Xinhui,<br>
<br>
<br>
Can you please check if you can reproduce the crash with <br>
<a href="https://lists.freedesktop.org/archives/amd-gfx/2020-February/046414.html">https://lists.freedesktop.org/archives/amd-gfx/2020-February/046414.html</a><br>
<br>
Christian fix it earlier, I think he forgot to push it.<br>
<br>
<br>
Regards,<br>
<br>
Nirmoy<br>
<br>
On 3/25/20 12:07 PM, xinhui pan wrote:<br>
> gpu recover will call sdma suspend/resume. In this period, ring will be<br>
> disabled. So the vm_pte_scheds(sdma.instance[X].ring.sched)->ready will<br>
> be false.<br>
><br>
> If we submit any jobs in this ring-disabled period. We fail to pick up<br>
> a rq for vm entity and entity->rq will set to NULL.<br>
> amdgpu_vm_sdma_commit did not check the entity->rq, so fix it. Otherwise<br>
> hit panic.<br>
><br>
> Cc: Christian König <christian.koenig@amd.com><br>
> Cc: Alex Deucher <alexander.deucher@amd.com><br>
> Cc: Felix Kuehling <Felix.Kuehling@amd.com><br>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 2 ++<br>
> 1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> index cf96c335b258..d30d103e48a2 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> @@ -95,6 +95,8 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,<br>
> int r;<br>
> <br>
> entity = p->direct ? &p->vm->direct : &p->vm->delayed;<br>
> + if (!entity->rq)<br>
> + return -ENOENT;<br>
> ring = container_of(entity->rq->sched, struct amdgpu_ring, sched);<br>
> <br>
> WARN_ON(ib->length_dw == 0);<br>
</div>
</span></font></div>
</blockquote>
</div>
<br>
</div>
</div>
<div><br>
<div class="x_elided-text">Am 25.03.2020 12:09 schrieb "Das, Nirmoy" <Nirmoy.Das@amd.com>:<br type="attribution">
<blockquote style="margin:0 0 0 0.8ex; border-left:1px #ccc solid; padding-left:1ex">
<div><font size="2"><span style="font-size:11pt">
<div>Hi Xinhui,<br>
<br>
<br>
Can you please check if you can reproduce the crash with <br>
<a href="https://lists.freedesktop.org/archives/amd-gfx/2020-February/046414.html">https://lists.freedesktop.org/archives/amd-gfx/2020-February/046414.html</a><br>
<br>
Christian fix it earlier, I think he forgot to push it.<br>
<br>
<br>
Regards,<br>
<br>
Nirmoy<br>
<br>
On 3/25/20 12:07 PM, xinhui pan wrote:<br>
> gpu recover will call sdma suspend/resume. In this period, ring will be<br>
> disabled. So the vm_pte_scheds(sdma.instance[X].ring.sched)->ready will<br>
> be false.<br>
><br>
> If we submit any jobs in this ring-disabled period. We fail to pick up<br>
> a rq for vm entity and entity->rq will set to NULL.<br>
> amdgpu_vm_sdma_commit did not check the entity->rq, so fix it. Otherwise<br>
> hit panic.<br>
><br>
> Cc: Christian König <christian.koenig@amd.com><br>
> Cc: Alex Deucher <alexander.deucher@amd.com><br>
> Cc: Felix Kuehling <Felix.Kuehling@amd.com><br>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 2 ++<br>
> 1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> index cf96c335b258..d30d103e48a2 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> @@ -95,6 +95,8 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,<br>
> int r;<br>
> <br>
> entity = p->direct ? &p->vm->direct : &p->vm->delayed;<br>
> + if (!entity->rq)<br>
> + return -ENOENT;<br>
> ring = container_of(entity->rq->sched, struct amdgpu_ring, sched);<br>
> <br>
> WARN_ON(ib->length_dw == 0);<br>
</div>
</span></font></div>
</blockquote>
</div>
<br>
</div>
</div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">Am 25.03.2020 12:09 schrieb "Das, Nirmoy" <Nirmoy.Das@amd.com>:<br type="attribution">
</div>
</div>
</div>
<font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Xinhui,<br>
<br>
<br>
Can you please check if you can reproduce the crash with <br>
<a href="https://lists.freedesktop.org/archives/amd-gfx/2020-February/046414.html">https://lists.freedesktop.org/archives/amd-gfx/2020-February/046414.html</a><br>
<br>
Christian fix it earlier, I think he forgot to push it.<br>
<br>
<br>
Regards,<br>
<br>
Nirmoy<br>
<br>
On 3/25/20 12:07 PM, xinhui pan wrote:<br>
> gpu recover will call sdma suspend/resume. In this period, ring will be<br>
> disabled. So the vm_pte_scheds(sdma.instance[X].ring.sched)->ready will<br>
> be false.<br>
><br>
> If we submit any jobs in this ring-disabled period. We fail to pick up<br>
> a rq for vm entity and entity->rq will set to NULL.<br>
> amdgpu_vm_sdma_commit did not check the entity->rq, so fix it. Otherwise<br>
> hit panic.<br>
><br>
> Cc: Christian König <christian.koenig@amd.com><br>
> Cc: Alex Deucher <alexander.deucher@amd.com><br>
> Cc: Felix Kuehling <Felix.Kuehling@amd.com><br>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 2 ++<br>
> 1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> index cf96c335b258..d30d103e48a2 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c<br>
> @@ -95,6 +95,8 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p,<br>
> int r;<br>
> <br>
> entity = p->direct ? &p->vm->direct : &p->vm->delayed;<br>
> + if (!entity->rq)<br>
> + return -ENOENT;<br>
> ring = container_of(entity->rq->sched, struct amdgpu_ring, sched);<br>
> <br>
> WARN_ON(ib->length_dw == 0);<br>
</div>
</span></font>
</body>
</html>