All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: Execute IP's hw_fini when hw_init failed
@ 2022-04-19 19:37 Alice Wong
  2022-04-19 19:45 ` Wong, Alice
  2022-04-19 19:59 ` Alex Deucher
  0 siblings, 2 replies; 4+ messages in thread
From: Alice Wong @ 2022-04-19 19:37 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alice Wong

amdgpu_device_ip_hw_init_phase1 and amdgpu_device_ip_hw_init_phase2
call IP blocks' respective hw_fini when hw_init failed.

BUG:SWDEV-332449
Signed-off-by: Alice Wong <shiwei.wong@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index ec38517ab33f..3abe647bbd2a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2281,6 +2281,7 @@ static int amdgpu_device_ip_hw_init_phase1(struct amdgpu_device *adev)
 			if (r) {
 				DRM_ERROR("hw_init of IP block <%s> failed %d\n",
 					  adev->ip_blocks[i].version->funcs->name, r);
+				adev->ip_blocks[i].version->funcs->hw_fini(adev);
 				return r;
 			}
 			adev->ip_blocks[i].status.hw = true;
@@ -2303,6 +2304,7 @@ static int amdgpu_device_ip_hw_init_phase2(struct amdgpu_device *adev)
 		if (r) {
 			DRM_ERROR("hw_init of IP block <%s> failed %d\n",
 				  adev->ip_blocks[i].version->funcs->name, r);
+			adev->ip_blocks[i].version->funcs->hw_fini(adev);
 			return r;
 		}
 		adev->ip_blocks[i].status.hw = true;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-20  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 19:37 [PATCH 1/2] drm/amdgpu: Execute IP's hw_fini when hw_init failed Alice Wong
2022-04-19 19:45 ` Wong, Alice
2022-04-19 19:59 ` Alex Deucher
2022-04-20  7:47   ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.