<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If it needs to be in drm-next, please make sure it lands there.</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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Liu, Shaoyun <Shaoyun.Liu@amd.com><br>
<b>Sent:</b> Thursday, December 16, 2021 12:51 PM<br>
<b>To:</b> Skvortsov, Victor <Victor.Skvortsov@amd.com>; Alex Deucher <alexdeucher@gmail.com><br>
<b>Cc:</b> Ming, Davis <Davis.Ming@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; amd-gfx list <amd-gfx@lists.freedesktop.org>; Deng, Emily <Emily.Deng@amd.com>; Chen, Horace <Horace.Chen@amd.com>; Liu, Monk <Monk.Liu@amd.com>; Nieto, David M <David.Nieto@amd.com><br>
<b>Subject:</b> RE: [PATCH 4/5] drm/amdgpu: Initialize Aldebaran RLC function pointers</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[AMD Official Use Only]<br>
<br>
Actually I don't know why the change " a35f147621bc drm/amdgpu: get xgmi info at eary_init " not in drm-next , instead it’s in amd-mainline-dkms-5.13. That change is necessary for passthrough XGMI hive to a VM and rely on our driver to do the reset on
whole hive when driver is loaded . <br>
<br>
I checked the code again, it seems we should be ok as long as we get xgmi info at eary_init. So since gfx_v9_0_set_rlc_funcs() already gets called in gfx_v9_0_early_init(), we can move get xgmi info out of gmc_early_init and call it at the last step early_init
. <br>
<br>
Regards<br>
Shaoyun.liu<br>
<br>
-----Original Message-----<br>
From: Skvortsov, Victor <Victor.Skvortsov@amd.com> <br>
Sent: Thursday, December 16, 2021 9:28 AM<br>
To: Alex Deucher <alexdeucher@gmail.com><br>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Deng, Emily <Emily.Deng@amd.com>; Liu, Monk <Monk.Liu@amd.com>; Ming, Davis <Davis.Ming@amd.com>; Liu, Shaoyun <Shaoyun.Liu@amd.com>; Zhou, Peng Ju <PengJu.Zhou@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>;
Chen, Horace <Horace.Chen@amd.com>; Nieto, David M <David.Nieto@amd.com><br>
Subject: RE: [PATCH 4/5] drm/amdgpu: Initialize Aldebaran RLC function pointers<br>
<br>
[AMD Official Use Only]<br>
<br>
Gotcha, I will skip this patch for drm-next<br>
<br>
-----Original Message-----<br>
From: Alex Deucher <alexdeucher@gmail.com><br>
Sent: Thursday, December 16, 2021 8:53 AM<br>
To: Skvortsov, Victor <Victor.Skvortsov@amd.com><br>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Deng, Emily <Emily.Deng@amd.com>; Liu, Monk <Monk.Liu@amd.com>; Ming, Davis <Davis.Ming@amd.com>; Liu, Shaoyun <Shaoyun.Liu@amd.com>; Zhou, Peng Ju <PengJu.Zhou@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>;
Chen, Horace <Horace.Chen@amd.com>; Nieto, David M <David.Nieto@amd.com><br>
Subject: Re: [PATCH 4/5] drm/amdgpu: Initialize Aldebaran RLC function pointers<br>
<br>
[CAUTION: External Email]<br>
<br>
On Wed, Dec 15, 2021 at 6:58 PM Skvortsov, Victor <Victor.Skvortsov@amd.com> wrote:<br>
><br>
> [AMD Official Use Only]<br>
><br>
> Hey Alex,<br>
><br>
> This change was based on the fact that amd-mainline-dkms-5.13 calls get_xgmi_info() in gmc_v9_0_early_init(). But I can see that drm-next it's instead called in gmc_v9_0_sw_init(). So, I'm not sure whats the correct behavior. But I do agree that the change
is kind of ugly. I don't know where else to put it if we do need to call get_xgmi_info() in early_init.<br>
><br>
<br>
We could skip this patch for drm-next and just apply it to the dkms branch. There's already a lot of ugly stuff in there to deal with multiple kernel versions.<br>
<br>
Alex<br>
<br>
<br>
> Thanks,<br>
> Victor<br>
><br>
> -----Original Message-----<br>
> From: Alex Deucher <alexdeucher@gmail.com><br>
> Sent: Wednesday, December 15, 2021 4:38 PM<br>
> To: Skvortsov, Victor <Victor.Skvortsov@amd.com><br>
> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Deng, Emily <br>
> <Emily.Deng@amd.com>; Liu, Monk <Monk.Liu@amd.com>; Ming, Davis <br>
> <Davis.Ming@amd.com>; Liu, Shaoyun <Shaoyun.Liu@amd.com>; Zhou, Peng <br>
> Ju <PengJu.Zhou@amd.com>; Chen, JingWen <JingWen.Chen2@amd.com>; Chen, <br>
> Horace <Horace.Chen@amd.com>; Nieto, David M <David.Nieto@amd.com><br>
> Subject: Re: [PATCH 4/5] drm/amdgpu: Initialize Aldebaran RLC function <br>
> pointers<br>
><br>
> [CAUTION: External Email]<br>
><br>
> On Wed, Dec 15, 2021 at 1:56 PM Victor Skvortsov <victor.skvortsov@amd.com> wrote:<br>
> ><br>
> > In SRIOV, RLC function pointers must be initialized early as we rely <br>
> > on the RLCG interface for all GC register access.<br>
> ><br>
> > Signed-off-by: Victor Skvortsov <victor.skvortsov@amd.com><br>
> > ---<br>
> > drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 ++<br>
> > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 +--<br>
> > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.h | 2 ++<br>
> > 3 files changed, 5 insertions(+), 2 deletions(-)<br>
> ><br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c<br>
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c<br>
> > index 65e1f6cc59dd..1bc92a38d124 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c<br>
> > @@ -844,6 +844,8 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev)<br>
> > case IP_VERSION(9, 4, 1):<br>
> > case IP_VERSION(9, 4, 2):<br>
> > amdgpu_device_ip_block_add(adev, <br>
> > &gfx_v9_0_ip_block);<br>
> > + if (amdgpu_sriov_vf(adev) && adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 2))<br>
> > + gfx_v9_0_set_rlc_funcs(adev);<br>
><br>
> amdgpu_discovery.c is IP independent. I'd rather not add random IP specific function calls. gfx_v9_0_set_rlc_funcs() already gets called in gfx_v9_0_early_init(). Is that not early enough? In general we shouldn't be touching the hardware much if at all
in early_init.<br>
><br>
> Alex<br>
><br>
> > break;<br>
> > case IP_VERSION(10, 1, 10):<br>
> > case IP_VERSION(10, 1, 2):<br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> > b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> > index edb3e3b08eed..d252b06efa43 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> > @@ -816,7 +816,6 @@ static void gfx_v9_0_sriov_wreg(struct <br>
> > amdgpu_device *adev, u32 offset, static void <br>
> > gfx_v9_0_set_ring_funcs(struct amdgpu_device *adev); static void <br>
> > gfx_v9_0_set_irq_funcs(struct amdgpu_device *adev); static void <br>
> > gfx_v9_0_set_gds_init(struct amdgpu_device *adev); -static void <br>
> > gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev); static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev,<br>
> > struct amdgpu_cu_info *cu_info); <br>
> > static uint64_t gfx_v9_0_get_gpu_clock_counter(struct amdgpu_device <br>
> > *adev); @@ -7066,7 +7065,7 @@ static void gfx_v9_0_set_irq_funcs(struct amdgpu_device *adev)<br>
> > adev->gfx.cp_ecc_error_irq.funcs = <br>
> > &gfx_v9_0_cp_ecc_error_irq_funcs; }<br>
> ><br>
> > -static void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)<br>
> > +void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev)<br>
> > {<br>
> > switch (adev->ip_versions[GC_HWIP][0]) {<br>
> > case IP_VERSION(9, 0, 1):<br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.h<br>
> > b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.h<br>
> > index dfe8d4841f58..1817e252354f 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.h<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.h<br>
> > @@ -29,4 +29,6 @@ extern const struct amdgpu_ip_block_version <br>
> > gfx_v9_0_ip_block; void gfx_v9_0_select_se_sh(struct amdgpu_device *adev, u32 se_num, u32 sh_num,<br>
> > u32 instance);<br>
> ><br>
> > +void gfx_v9_0_set_rlc_funcs(struct amdgpu_device *adev);<br>
> > +<br>
> > #endif<br>
> > --<br>
> > 2.25.1<br>
> ><br>
</div>
</span></font></div>
</div>
</body>
</html>