<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div dir="auto">This patch is Reviewed-by: Likun Gao <Likun.Gao@amd.com>.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards,</div>
<div dir="auto">Likun</div>
<div><br>
</div>
<div id="ms-outlook-mobile-signature" dir="auto">
<div><br>
</div>
<br>
</div>
<div id="mail-editor-reference-message-container" dir="auto"><br>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" style="font-size: 11pt;"><strong>发件人:</strong> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> 代表 Hawking Zhang <Hawking.Zhang@amd.com><br>
<strong>发送时间:</strong> 2023年3月6日星期一 下午7:38<br>
<strong>收件人:</strong> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Gao, Likun <Likun.Gao@amd.com><br>
<strong>抄送:</strong> Zhang, Hawking <Hawking.Zhang@amd.com><br>
<strong>主题:</strong> [PATCH] drm/amdgpu: Retire pcie_gen3_enable function<br>
</div>
<br>
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Not needed since from vi. drop the function so<br>
we don't duplicate code when introduce new asics.<br>
<br>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/nv.c    | 17 -----------------<br>
 drivers/gpu/drm/amd/amdgpu/soc15.c | 20 --------------------<br>
 drivers/gpu/drm/amd/amdgpu/soc21.c | 17 -----------------<br>
 drivers/gpu/drm/amd/amdgpu/vi.c    | 20 --------------------<br>
 4 files changed, 74 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c<br>
index 492a8b148227..d56cba10cd5a 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/nv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c<br>
@@ -519,21 +519,6 @@ static int nv_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)<br>
         return 0;<br>
 }<br>
 <br>
-static void nv_pcie_gen3_enable(struct amdgpu_device *adev)<br>
-{<br>
-       if (pci_is_root_bus(adev->pdev->bus))<br>
-               return;<br>
-<br>
-       if (amdgpu_pcie_gen2 == 0)<br>
-               return;<br>
-<br>
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |<br>
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))<br>
-               return;<br>
-<br>
-       /* todo */<br>
-}<br>
-<br>
 static void nv_program_aspm(struct amdgpu_device *adev)<br>
 {<br>
         if (!amdgpu_device_should_use_aspm(adev))<br>
@@ -1041,8 +1026,6 @@ static int nv_common_hw_init(void *handle)<br>
         if (adev->nbio.funcs->apply_l1_link_width_reconfig_wa)<br>
                 adev->nbio.funcs->apply_l1_link_width_reconfig_wa(adev);<br>
 <br>
-       /* enable pcie gen2/3 link */<br>
-       nv_pcie_gen3_enable(adev);<br>
         /* enable aspm */<br>
         nv_program_aspm(adev);<br>
         /* setup nbio registers */<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
index 2c37b49f5c00..1064972dc558 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
@@ -609,24 +609,6 @@ static int soc15_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk<br>
         return 0;<br>
 }<br>
 <br>
-static void soc15_pcie_gen3_enable(struct amdgpu_device *adev)<br>
-{<br>
-       if (pci_is_root_bus(adev->pdev->bus))<br>
-               return;<br>
-<br>
-       if (amdgpu_pcie_gen2 == 0)<br>
-               return;<br>
-<br>
-       if (adev->flags & AMD_IS_APU)<br>
-               return;<br>
-<br>
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |<br>
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))<br>
-               return;<br>
-<br>
-       /* todo */<br>
-}<br>
-<br>
 static void soc15_program_aspm(struct amdgpu_device *adev)<br>
 {<br>
         if (!amdgpu_device_should_use_aspm(adev))<br>
@@ -1183,8 +1165,6 @@ static int soc15_common_hw_init(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       /* enable pcie gen2/3 link */<br>
-       soc15_pcie_gen3_enable(adev);<br>
         /* enable aspm */<br>
         soc15_program_aspm(adev);<br>
         /* setup nbio registers */<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c<br>
index 21e271877c4c..e56f2bc73930 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c<br>
@@ -370,21 +370,6 @@ static int soc21_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk<br>
         return 0;<br>
 }<br>
 <br>
-static void soc21_pcie_gen3_enable(struct amdgpu_device *adev)<br>
-{<br>
-       if (pci_is_root_bus(adev->pdev->bus))<br>
-               return;<br>
-<br>
-       if (amdgpu_pcie_gen2 == 0)<br>
-               return;<br>
-<br>
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |<br>
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))<br>
-               return;<br>
-<br>
-       /* todo */<br>
-}<br>
-<br>
 static void soc21_program_aspm(struct amdgpu_device *adev)<br>
 {<br>
         if (!amdgpu_device_should_use_aspm(adev))<br>
@@ -714,8 +699,6 @@ static int soc21_common_hw_init(void *handle)<br>
 {<br>
         struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
 <br>
-       /* enable pcie gen2/3 link */<br>
-       soc21_pcie_gen3_enable(adev);<br>
         /* enable aspm */<br>
         soc21_program_aspm(adev);<br>
         /* setup nbio registers */<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c<br>
index 12ef782eb478..2512b70ea992 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/vi.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c<br>
@@ -1105,24 +1105,6 @@ static int vi_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)<br>
         return 0;<br>
 }<br>
 <br>
-static void vi_pcie_gen3_enable(struct amdgpu_device *adev)<br>
-{<br>
-       if (pci_is_root_bus(adev->pdev->bus))<br>
-               return;<br>
-<br>
-       if (amdgpu_pcie_gen2 == 0)<br>
-               return;<br>
-<br>
-       if (adev->flags & AMD_IS_APU)<br>
-               return;<br>
-<br>
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |<br>
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))<br>
-               return;<br>
-<br>
-       /* todo */<br>
-}<br>
-<br>
 static void vi_enable_aspm(struct amdgpu_device *adev)<br>
 {<br>
         u32 data, orig;<br>
@@ -1743,8 +1725,6 @@ static int vi_common_hw_init(void *handle)<br>
 <br>
         /* move the golden regs per IP block */<br>
         vi_init_golden_registers(adev);<br>
-       /* enable pcie gen2/3 link */<br>
-       vi_pcie_gen3_enable(adev);<br>
         /* enable aspm */<br>
         vi_program_aspm(adev);<br>
         /* enable the doorbell aperture */<br>
-- <br>
2.17.1<br>
<br>
</div>
</span></font><br>
</div>
</div>
</body>
</html>