<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<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 dir="auto">Reviewed-by: Vignesh Chander <Vignesh.Chander@amd.com></div>
<div dir="auto"><br>
</div>
<div id="mail-editor-reference-message-container" dir="auto">
<hr style="display:inline-block;width:98%">
<div id="divRplyFwdMsg" style="font-size: 11pt;"><strong>From:</strong> Victor Lu <victorchengchi.lu@amd.com><br>
<strong>Sent:</strong> Friday, June 14, 2024 4:32:21 p.m.<br>
<strong>To:</strong> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<strong>Cc:</strong> Chander, Vignesh <Vignesh.Chander@amd.com>; Lu, Victor Cheng Chi (Victor) <VictorChengChi.Lu@amd.com><br>
<strong>Subject:</strong> [PATCH] drm/amdgpu: Do not wait for MP0_C2PMSG_33 IFWI init in SRIOV<br>
</div>
<br>
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><font size="2"><span style="font-size:11pt;">
<div class="PlainText">SRIOV does not need to wait for IFWI init, and MP0_C2PMSG_33 is blocked<br>
for VF access.<br>
<br>
Signed-off-by: Victor Lu <victorchengchi.lu@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 26 ++++++++++---------<br>
1 file changed, 14 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c<br>
index 9e0cfe06c8b1..4edcbd272fa4 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c<br>
@@ -264,19 +264,21 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,<br>
u32 msg;<br>
int i, ret = 0;<br>
<br>
- /* It can take up to a second for IFWI init to complete on some dGPUs,<br>
- * but generally it should be in the 60-100ms range. Normally this starts<br>
- * as soon as the device gets power so by the time the OS loads this has long<br>
- * completed. However, when a card is hotplugged via e.g., USB4, we need to<br>
- * wait for this to complete. Once the C2PMSG is updated, we can<br>
- * continue.<br>
- */<br>
+ if (!amdgpu_sriov_vf(adev)) {<br>
+ /* It can take up to a second for IFWI init to complete on some dGPUs,<br>
+ * but generally it should be in the 60-100ms range. Normally this starts<br>
+ * as soon as the device gets power so by the time the OS loads this has long<br>
+ * completed. However, when a card is hotplugged via e.g., USB4, we need to<br>
+ * wait for this to complete. Once the C2PMSG is updated, we can<br>
+ * continue.<br>
+ */<br>
<br>
- for (i = 0; i < 1000; i++) {<br>
- msg = RREG32(mmMP0_SMN_C2PMSG_33);<br>
- if (msg & 0x80000000)<br>
- break;<br>
- usleep_range(1000, 1100);<br>
+ for (i = 0; i < 1000; i++) {<br>
+ msg = RREG32(mmMP0_SMN_C2PMSG_33);<br>
+ if (msg & 0x80000000)<br>
+ break;<br>
+ usleep_range(1000, 1100);<br>
+ }<br>
}<br>
<br>
vram_size = (uint64_t)RREG32(mmRCC_CONFIG_MEMSIZE) << 20;<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font><br>
</div>
</div>
</body>
</html>