<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I dropped the KFD debugger hunks and just added the gfx 9.4.2 changes since these were required for a bunch of later patches that build on that file that are not dependent on debugger.  I can rework the commit message if you'd like.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></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> Kuehling, Felix <Felix.Kuehling@amd.com><br>
<b>Sent:</b> Wednesday, February 24, 2021 10:22 PM<br>
<b>To:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Kim, Jonathan <Jonathan.Kim@amd.com><br>
<b>Subject:</b> Re: [PATCH 147/159] drm/amdgpu: restore aldebaran save ttmp and trap config on init (v2)</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This patch is for the debugger functionality that's not on
<br>
amd-staging-drm-next yet. You can probably drop this patch for now.<br>
<br>
Regards,<br>
   Felix<br>
<br>
On 2021-02-24 5:18 p.m., Alex Deucher wrote:<br>
> From: Jonathan Kim <Jonathan.Kim@amd.com><br>
><br>
> Initialization of TRAP_DATA0/1 is still required for the debugger to detect<br>
> new waves on Aldebaran.  Also, per-vmid global trap enablement may be<br>
> required outside of debugger scope so move to init phase.<br>
><br>
> v2: just add the gfx 9.4.2 changes (Alex)<br>
><br>
> Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com><br>
> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com><br>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com><br>
> ---<br>
>   drivers/gpu/drm/amd/amdgpu/Makefile     |  1 +<br>
>   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c   |  1 +<br>
>   drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c | 50 +++++++++++++++++++++++++<br>
>   drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h | 30 +++++++++++++++<br>
>   4 files changed, 82 insertions(+)<br>
>   create mode 100644 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c<br>
>   create mode 100644 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile<br>
> index c5ec926bc6d5..741b68874e53 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/Makefile<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/Makefile<br>
> @@ -123,6 +123,7 @@ amdgpu-y += \<br>
>        gfx_v8_0.o \<br>
>        gfx_v9_0.o \<br>
>        gfx_v9_4.o \<br>
> +     gfx_v9_4_2.o \<br>
>        gfx_v10_0.o<br>
>   <br>
>   # add async DMA block<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> index 5bac5659e707..78bb4e28c27c 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> @@ -49,6 +49,7 @@<br>
>   <br>
>   #include "gfx_v9_4.h"<br>
>   #include "gfx_v9_0.h"<br>
> +#include "gfx_v9_4_2.h"<br>
>   <br>
>   #include "asic_reg/pwr/pwr_10_0_offset.h"<br>
>   #include "asic_reg/pwr/pwr_10_0_sh_mask.h"<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c<br>
> new file mode 100644<br>
> index 000000000000..0c2ccbe327ab<br>
> --- /dev/null<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c<br>
> @@ -0,0 +1,50 @@<br>
> +/*<br>
> + * Copyright 2020 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
> + * OTHER DEALINGS IN THE SOFTWARE.<br>
> + *<br>
> + */<br>
> +#include "amdgpu.h"<br>
> +#include "soc15.h"<br>
> +<br>
> +#include "gc/gc_9_4_2_offset.h"<br>
> +#include "gc/gc_9_4_2_sh_mask.h"<br>
> +<br>
> +void gfx_v9_4_2_debug_trap_config_init(struct amdgpu_device *adev,<br>
> +                             uint32_t first_vmid,<br>
> +                             uint32_t last_vmid)<br>
> +{<br>
> +     uint32_t data;<br>
> +     int i;<br>
> +<br>
> +     mutex_lock(&adev->srbm_mutex);<br>
> +<br>
> +     for (i = first_vmid; i < last_vmid; i++) {<br>
> +             data = 0;<br>
> +             soc15_grbm_select(adev, 0, 0, 0, i);<br>
> +             data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL, TRAP_EN, 1);<br>
> +             data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL, EXCP_EN, 0);<br>
> +             data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL, EXCP_REPLACE,<br>
> +                                     0);<br>
> +             WREG32(SOC15_REG_OFFSET(GC, 0, regSPI_GDBG_PER_VMID_CNTL), data);<br>
> +     }<br>
> +<br>
> +     soc15_grbm_select(adev, 0, 0, 0, 0);<br>
> +     mutex_unlock(&adev->srbm_mutex);<br>
> +}<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h<br>
> new file mode 100644<br>
> index 000000000000..5b175c10de23<br>
> --- /dev/null<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.h<br>
> @@ -0,0 +1,30 @@<br>
> +/*<br>
> + * Copyright 2020 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
> + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
> + * OTHER DEALINGS IN THE SOFTWARE.<br>
> + *<br>
> + */<br>
> +<br>
> +#ifndef __GFX_V9_4_2_H__<br>
> +#define __GFX_V9_4_2_H__<br>
> +<br>
> +void gfx_v9_4_2_debug_trap_config_init(struct amdgpu_device *adev,<br>
> +                             uint32_t first_vmid, uint32_t last_vmid);<br>
> +<br>
> +#endif /* __GFX_V9_4_2_H__ */<br>
</div>
</span></font></div>
</div>
</body>
</html>