<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:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Hi Hawking,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Fixed the typo and a new email is sent.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Gavin</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> Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Sent:</b> Monday, July 8, 2024 10:23 PM<br>
<b>To:</b> Wan, Gavin <Gavin.Wan@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Wan, Gavin <Gavin.Wan@amd.com><br>
<b>Subject:</b> RE: [PATCH] drm/amd/amdgpu: fix SDMA IRQ client ID <-> req mapping.</font>
<div> </div>
</div>
<div class="BodyFragment"><font face="Times New Roman" size="3"><span style="font-size:12pt;"><a name="BM_BEGIN"></a>
<div><font size="2"><span style="font-size:11pt;">[AMD Official Use Only - AMD Internal Distribution Only]<br>
<br>
Please correct the typo in description<br>
CLIENTID_SDMA2 and CLIENTID_SDMA2<br>
<br>
With that fixed, the patch is<br>
<br>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com><br>
<br>
Regards,<br>
Hawking<br>
<br>
-----Original Message-----<br>
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Gavin Wan<br>
Sent: Tuesday, July 9, 2024 01:20<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Wan, Gavin <Gavin.Wan@amd.com><br>
Subject: [PATCH] drm/amd/amdgpu: fix SDMA IRQ client ID <-> req mapping.<br>
<br>
sdma has 2 instances in SRIOV cpx mode. Odd numbered VFs have<br>
sdma0/sdma1 instances. Even numbered vfs have sdma2/sdma3. For Even numbered vfs, the sdma2 & sdma3 (irq srouce id<br>
CLIENTID_SDMA2 and CLIENTID_SDMA2) shoud map to irq seq 0 & 1.<br>
<br>
Signed-off-by: Gavin Wan <Gavin.Wan@amd.com><br>
Change-Id: Ie850114932ca98ea3c9176370dde5dd393ddf7e7<br>
---<br>
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 20 +++++++++++++-------<br>
1 file changed, 13 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c<br>
index fec5a3d1c4bc..4516cb0b3ae8 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c<br>
@@ -82,7 +82,7 @@ static unsigned sdma_v4_4_2_seq_to_irq_id(int seq_num)<br>
}<br>
}<br>
<br>
-static int sdma_v4_4_2_irq_id_to_seq(unsigned client_id)<br>
+static int sdma_v4_4_2_irq_id_to_seq(struct amdgpu_device *adev,<br>
+unsigned client_id)<br>
{<br>
switch (client_id) {<br>
case SOC15_IH_CLIENTID_SDMA0:<br>
@@ -90,9 +90,15 @@ static int sdma_v4_4_2_irq_id_to_seq(unsigned client_id)<br>
case SOC15_IH_CLIENTID_SDMA1:<br>
return 1;<br>
case SOC15_IH_CLIENTID_SDMA2:<br>
- return 2;<br>
+ if (amdgpu_sriov_vf(adev) && (adev->gfx.xcc_mask == 0x1))<br>
+ return 0;<br>
+ else<br>
+ return 2;<br>
case SOC15_IH_CLIENTID_SDMA3:<br>
- return 3;<br>
+ if (amdgpu_sriov_vf(adev) && (adev->gfx.xcc_mask == 0x1))<br>
+ return 1;<br>
+ else<br>
+ return 3;<br>
default:<br>
return -EINVAL;<br>
}<br>
@@ -1541,7 +1547,7 @@ static int sdma_v4_4_2_process_trap_irq(struct amdgpu_device *adev,<br>
uint32_t instance, i;<br>
<br>
DRM_DEBUG("IH: SDMA trap\n");<br>
- instance = sdma_v4_4_2_irq_id_to_seq(entry->client_id);<br>
+ instance = sdma_v4_4_2_irq_id_to_seq(adev, entry->client_id);<br>
<br>
/* Client id gives the SDMA instance in AID. To know the exact SDMA<br>
* instance, interrupt entry gives the node id which corresponds to the AID instance.<br>
@@ -1584,7 +1590,7 @@ static int sdma_v4_4_2_process_ras_data_cb(struct amdgpu_device *adev,<br>
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA))<br>
goto out;<br>
<br>
- instance = sdma_v4_4_2_irq_id_to_seq(entry->client_id);<br>
+ instance = sdma_v4_4_2_irq_id_to_seq(adev, entry->client_id);<br>
if (instance < 0)<br>
goto out;<br>
<br>
@@ -1603,7 +1609,7 @@ static int sdma_v4_4_2_process_illegal_inst_irq(struct amdgpu_device *adev,<br>
<br>
DRM_ERROR("Illegal instruction in SDMA command stream\n");<br>
<br>
- instance = sdma_v4_4_2_irq_id_to_seq(entry->client_id);<br>
+ instance = sdma_v4_4_2_irq_id_to_seq(adev, entry->client_id);<br>
if (instance < 0)<br>
return 0;<br>
<br>
@@ -1647,7 +1653,7 @@ static int sdma_v4_4_2_print_iv_entry(struct amdgpu_device *adev,<br>
struct amdgpu_task_info task_info;<br>
u64 addr;<br>
<br>
- instance = sdma_v4_4_2_irq_id_to_seq(entry->client_id);<br>
+ instance = sdma_v4_4_2_irq_id_to_seq(adev, entry->client_id);<br>
if (instance < 0 || instance >= adev->sdma.num_instances) {<br>
dev_err(adev->dev, "sdma instance invalid %d\n", instance);<br>
return -EINVAL;<br>
--<br>
2.40.1<br>
<br>
</span></font></div>
</span></font></div>
</div>
</body>
</html>