Skip to contentSkip to conversation

drm/amdgpu: fix hive reference leak when reflecting psp topology info

PATCH In review Jonathan Kim 2 participants 3 messages Jul 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix hive reference leak when reflecting psp topology info

Hives that require psp topology info to be reflected will leak hive reference so fix it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -0
index 3ee363bfbac2..6c23e89366bf 100644
@@ -1292,6 +1292,8 @@ static void psp_xgmi_reflect_topology_info(struct psp_context *psp,
 
 		break;
 	}
+
+	amdgpu_put_xgmi_hive(hive);
 }
 
 int psp_xgmi_get_topology_info(struct psp_context *psp,
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Looks good to me .
BTW , why we didn't catch it on baremetal mode ?

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jonathan Kim
Sent: Thursday, July 28, 2022 1:06 PM
To: [email protected]
Cc: Kim, Jonathan <[email protected]>
Subject: [PATCH] drm/amdgpu: fix hive reference leak when reflecting psp topology info

Hives that require psp topology info to be reflected will leak hive reference so fix it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -0
index 3ee363bfbac2..6c23e89366bf 100644
@@ -1292,6 +1292,8 @@ static void psp_xgmi_reflect_topology_info(struct psp_context *psp,
 
                break;
        }
+
+       amdgpu_put_xgmi_hive(hive);
 }
 
 int psp_xgmi_get_topology_info(struct psp_context *psp,

--
2.25.1

#2 lore raw

[Public]

Quoted 9 lines

-----Original Message-----
From: Liu, Shaoyun <[email protected]>
Sent: July 28, 2022 1:10 PM
To: Kim, Jonathan <[email protected]>; amd- [email protected]
Cc: Kim, Jonathan <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: fix hive reference leak when reflecting psp topology info

Quoted 4 lines

[AMD Official Use Only - General]

Looks good to me .
BTW , why we didn't catch it on baremetal mode ?

Thanks for the review Shaoyun.
Good question. I'll double check what we're doing for unload testing.

Thanks,

Jon

Quoted 38 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jonathan Kim
Sent: Thursday, July 28, 2022 1:06 PM
To: [email protected]
Cc: Kim, Jonathan <[email protected]>
Subject: [PATCH] drm/amdgpu: fix hive reference leak when reflecting psp topology info

Hives that require psp topology info to be reflected will leak hive reference so fix it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -0
index 3ee363bfbac2..6c23e89366bf 100644
@@ -1292,6 +1292,8 @@ static void psp_xgmi_reflect_topology_info(struct
 psp_context *psp,
 
                break;
        }
+
+       amdgpu_put_xgmi_hive(hive);
 }
 

int psp_xgmi_get_topology_info(struct psp_context *psp,
--
2.25.1