<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
that breaks the device list in gpu recovery.</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Pan, Xinhui <Xinhui.Pan@amd.com><br>
<b>Sent:</b> Friday, April 17, 2020 7:11:40 PM<br>
<b>To:</b> Chen, Guchun <Guchun.Chen@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Zhang, Hawking <Hawking.Zhang@amd.com>; Li, Dennis <Dennis.Li@amd.com>; Clements, John <John.Clements@amd.com>; Koenig, Christian <Christian.Koenig@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: fix kernel page fault issue by ras recovery on sGPU</font>
<div> </div>
</div>
<div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
This patch shluld fix the panic.<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
but I would like you do NOT add adev xgmi head to the local device list. if ras ue occurs while the gpu is already in gpu recovery.
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Friday, April 17, 2020 5:17:22 PM<br>
<b>To:</b> Chen, Guchun <Guchun.Chen@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Zhang, Hawking <Hawking.Zhang@amd.com>; Li, Dennis <Dennis.Li@amd.com>; Clements, John <John.Clements@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: fix kernel page fault issue by ras recovery on sGPU</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">Am 16.04.20 um 17:47 schrieb Guchun Chen:<br>
> When running ras uncorrectable error injection and trigger GPU<br>
> reset on sGPU, below issue is observed. It's caused by the list<br>
> uninitialized when accessing.<br>
><br>
> [   80.047227] BUG: unable to handle page fault for address: ffffffffc0f4f750<br>
> [   80.047300] #PF: supervisor write access in kernel mode<br>
> [   80.047351] #PF: error_code(0x0003) - permissions violation<br>
> [   80.047404] PGD 12c20e067 P4D 12c20e067 PUD 12c210067 PMD 41c4ee067 PTE 404316061<br>
> [   80.047477] Oops: 0003 [#1] SMP PTI<br>
> [   80.047516] CPU: 7 PID: 377 Comm: kworker/7:2 Tainted: G           OE     5.4.0-rc7-guchchen #1<br>
> [   80.047594] Hardware name: System manufacturer System Product Name/TUF Z370-PLUS GAMING II, BIOS 0411 09/21/2018<br>
> [   80.047888] Workqueue: events amdgpu_ras_do_recovery [amdgpu]<br>
><br>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com><br>
> ---<br>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 +++--<br>
>   1 file changed, 3 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
> index b27d9d62c9df..260b4a42e0ae 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
> @@ -1448,9 +1448,10 @@ static void amdgpu_ras_do_recovery(struct work_struct *work)<br>
>        struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, false);<br>
>   <br>
>        /* Build list of devices to query RAS related errors */<br>
> -     if  (hive && adev->gmc.xgmi.num_physical_nodes > 1) {<br>
> +     if  (hive && adev->gmc.xgmi.num_physical_nodes > 1)<br>
>                device_list_handle = &hive->device_list;<br>
> -     } else {<br>
> +     else {<br>
<br>
The coding style here is incorrect. If one branch of an if/else uses {} <br>
the other(s) should use it as well.<br>
<br>
> +             INIT_LIST_HEAD(&device_list);<br>
<br>
That was suggested before but then reverted, but I'm not sure why.<br>
<br>
Regards,<br>
Christian.<br>
<br>
>                list_add_tail(&adev->gmc.xgmi.head, &device_list);<br>
>                device_list_handle = &device_list;<br>
>        }<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cxinhui.pan%40amd.com%7Ca2bb160328c942b51b4608d7e2b02579%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637227118528983724&amp;sdata=6bJVduxNT%2FVXKPDWDBAnJfVSe3CJI9mdGfwi5V89Kgw%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cxinhui.pan%40amd.com%7Ca2bb160328c942b51b4608d7e2b02579%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637227118528983724&amp;sdata=6bJVduxNT%2FVXKPDWDBAnJfVSe3CJI9mdGfwi5V89Kgw%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>