<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div style="font-family: inherit; font-size: inherit; color: inherit; background-color: transparent;">
Looks OK to me.</div>
<div style="font-family: inherit; font-size: inherit; color: inherit; background-color: transparent;">
Reviewed by : shaoyun.liu <shaoyun.liu@amd.com></div>
<div style="font-family: inherit; font-size: inherit; color: inherit; background-color: transparent;">
<br>
</div>
<br>
<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> Chander, Vignesh <Vignesh.Chander@amd.com><br>
<b>Sent:</b> September 28, 2022 3:03 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Liu, Shaoyun <Shaoyun.Liu@amd.com>; Chander, Vignesh <Vignesh.Chander@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: Skip put_reset_domain if it doesnt exist</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">For xgmi sriov, the reset is handled by host driver and hive->reset_domain<br>
is not initialized so need to check if it exists before doing a put.<br>
Signed-off-by: Vignesh Chander <Vignesh.Chander@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 3 ++-<br>
1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h<br>
index dc43fcb93eac..f5318fedf2f0 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h<br>
@@ -113,7 +113,8 @@ static inline bool amdgpu_reset_get_reset_domain(struct amdgpu_reset_domain *dom<br>
<br>
static inline void amdgpu_reset_put_reset_domain(struct amdgpu_reset_domain *domain)<br>
{<br>
- kref_put(&domain->refcount, amdgpu_reset_destroy_reset_domain);<br>
+ if (domain)<br>
+ kref_put(&domain->refcount, amdgpu_reset_destroy_reset_domain);<br>
}<br>
<br>
static inline bool amdgpu_reset_domain_schedule(struct amdgpu_reset_domain *domain,<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</body>
</html>