<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:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Reviewed-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> Tong Liu01 <Tong.Liu01@amd.com><br>
<b>Sent:</b> Tuesday, March 21, 2023 5:19 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> 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>; Liu01, Tong (Esther) <Tong.Liu01@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: skip unload tmr when tmr is not loaded</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[why]<br>
For Navi12 and CHIP_SIENNA_CICHLID SRIOV, TMR is not loaded. Should<br>
also skip tmr unload<br>
<br>
Signed-off-by: Tong Liu01 <Tong.Liu01@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++++<br>
1 file changed, 6 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c<br>
index 0b9e99c35a05..69addf2751aa 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c<br>
@@ -841,6 +841,12 @@ static int psp_tmr_unload(struct psp_context *psp)<br>
int ret;<br>
struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp);<br>
<br>
+ /* For Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR.<br>
+ * Already set up by host driver.<br>
+ */<br>
+ if (amdgpu_sriov_vf(psp->adev) && psp_skip_tmr(psp))<br>
+ return 0;<br>
+<br>
psp_prep_tmr_unload_cmd_buf(psp, cmd);<br>
dev_dbg(psp->adev->dev, "free PSP TMR buffer\n");<br>
<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>