<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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:#008000;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Are there any cases where the asic_type check would cause this register to fail to get programmed?</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div id="appendonsend"></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Victor Lu <victorchengchi.lu@amd.com><br>
<b>Sent:</b> Thursday, February 13, 2025 7:13 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Lu, Victor Cheng Chi (Victor) <VictorChengChi.Lu@amd.com>; hoarce.chen@amd.com <hoarce.chen@amd.com><br>
<b>Subject:</b> [PATCH 1/3] drm/amdgpu: Do not program AGP BAR regs under SRIOV</span>
<div> </div>
</div>
<div style="font-size: 11pt;">SRIOV VF does not have write access to AGP BAR regs.<br>
Skip the writes to avoid a dmesg warning.<br>
<br>
Signed-off-by: Victor Lu <victorchengchi.lu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 10 +++++-----<br>
 1 file changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c<br>
index 0e3ddea7b8e0..a7bfc9f41d0e 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c<br>
@@ -92,12 +92,12 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)<br>
 {<br>
         uint64_t value;<br>
 <br>
-       /* Program the AGP BAR */<br>
-       WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BASE, 0);<br>
-       WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);<br>
-       WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);<br>
-<br>
         if (!amdgpu_sriov_vf(adev) || adev->asic_type <= CHIP_VEGA10) {<br>
+               /* Program the AGP BAR */<br>
+               WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BASE, 0);<br>
+               WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);<br>
+               WREG32_SOC15_RLC(GC, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);<br>
+<br>
                 /* Program the system aperture low logical page number. */<br>
                 WREG32_SOC15_RLC(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,<br>
                         min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);<br>
--<br>
2.34.1<br>
<br>
</div>
</div>
</body>
</html>