<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:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Assuming there are no issues resulting from the re-ordering of the function calls, it looks fine to me.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Acked-by: Alex Deucher <alexander.deucher@amd.com><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> Chen, Horace <Horace.Chen@amd.com><br>
<b>Sent:</b> Wednesday, May 17, 2023 2:27 AM<br>
<b>To:</b> Liu01, Tong (Esther) <Tong.Liu01@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Quan, Evan <Evan.Quan@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Xiao, Jack <Jack.Xiao@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>; Liu, Monk
<Monk.Liu@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; Kevin Wang <Kevin1.Wang@amd.com>; Chang, HaiJun <HaiJun.Chang@amd.com>; Liu01, Tong (Esther) <Tong.Liu01@amd.com><br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: fix incorrect pcie_gen_mask in passthrough case</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 - General]<br>
<br>
Hi Alex,<br>
<br>
Can you help review this patch?<br>
Currently on passthrough, GPU is also on the root bus but it is not APU. Current driver regard it as APU and limit the PCIE link speed to gen2. It causes some failure on some OCL benchmark.<br>
<br>
Thanks & Regards,<br>
Horace.<br>
<br>
-----Original Message-----<br>
From: Tong Liu01 <Tong.Liu01@amd.com><br>
Sent: Tuesday, May 16, 2023 5:47 PM<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Quan, Evan <Evan.Quan@amd.com>; Chen, Horace <Horace.Chen@amd.com>; Tuikov, Luben <Luben.Tuikov@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Xiao, Jack <Jack.Xiao@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>;
Liu, Monk <Monk.Liu@amd.com>; Xu, Feifei <Feifei.Xu@amd.com>; Kevin Wang <Kevin1.Wang@amd.com>; Chang, HaiJun <HaiJun.Chang@amd.com>; Liu01, Tong (Esther) <Tong.Liu01@amd.com><br>
Subject: [PATCH] drm/amdgpu: fix incorrect pcie_gen_mask in passthrough case<br>
<br>
[why]<br>
Passthrough case is treated as root bus and pcie_gen_mask is set as default value that does not support GEN 3 and GEN 4 for PCIe link speed. So PCIe link speed will be downgraded at smu hw init in passthrough condition<br>
<br>
[how]<br>
Move detect virtualization before get pcie info and check if it is passthrough case when set pcie_gen_mask<br>
<br>
Signed-off-by: Tong Liu01 <Tong.Liu01@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++----<br>
1 file changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index a9d9bbe8586b..255b0014b6a3 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -3813,6 +3813,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,<br>
DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base);<br>
DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size);<br>
<br>
+ /* detect hw virtualization here */<br>
+ amdgpu_detect_virtualization(adev);<br>
+<br>
amdgpu_device_get_pcie_info(adev);<br>
<br>
if (amdgpu_mcbp)<br>
@@ -3827,9 +3830,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,<br>
if (!adev->reset_domain)<br>
return -ENOMEM;<br>
<br>
- /* detect hw virtualization here */<br>
- amdgpu_detect_virtualization(adev);<br>
-<br>
r = amdgpu_device_get_job_timeout_settings(adev);<br>
if (r) {<br>
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n"); @@ -5589,7 +5589,7 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)<br>
adev->pm.pcie_mlw_mask = amdgpu_pcie_lane_cap;<br>
<br>
/* covers APUs as well */<br>
- if (pci_is_root_bus(adev->pdev->bus)) {<br>
+ if (pci_is_root_bus(adev->pdev->bus) && !amdgpu_passthrough(adev)) {<br>
if (adev->pm.pcie_gen_mask == 0)<br>
adev->pm.pcie_gen_mask = AMDGPU_DEFAULT_PCIE_GEN_MASK;<br>
if (adev->pm.pcie_mlw_mask == 0)<br>
--<br>
2.34.1<br>
<br>
</span></font></div>
</span></font></div>
</div>
</body>
</html>