Skip to contentSkip to conversation

drm/amdgpu: fix a GPU hang issue when remove device

PATCH Superseded Dennis Li 2 participants 2 messages Dec 30, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Dennis Li

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix a GPU hang issue when remove device

When GFXOFF is enabled and GPU is idle, driver will fail to access some registers. Therefore disable GFXOFF before unload device.

amdgpu 0000:03:00.0: amdgpu: amdgpu: finishing device.
amdgpu: cp queue pipe 4 queue 0 preemption failed
amdgpu 0000:03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2 amdgpu 0000:03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706 amdgpu 0000:03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2 amdgpu 0000:03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706

Change-Id I42431f5d0bf54909e1df888a0d72fc009d8e196c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -0
index e365c4fdcfe3..47d1291d5053 100644
@@ -83,6 +83,8 @@ void amdgpu_driver_unload_kms(struct drm_device *dev)
 	if (adev == NULL)
 		return;
 
+	amdgpu_gfx_off_ctrl(adev, false);
+
 	amdgpu_unregister_gpu_instance(adev);
 
 	if (adev->rmmio == NULL)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

[AMD Public Use]

Hi Dennis,

Thanks for digging this out.

I'd like to understand where the mmio register access is from prior to driver call amdgpu_device_set_pg_state to disable gfxoff in ip_fini phase. I think we already move ungate gfx pg in very early stage of device_fini. The only GC register access, ahead of disabling gfxoff, I can think of is gfx eop interrupt disablement.

The call stack show register write failure through kiq, but that approach should be safe even with gfxoff enabled.

Regards,
Hawking

-----Original Message-----
From: Dennis Li <[email protected]>
Sent: Wednesday, December 30, 2020 19:51
To: [email protected]; Chen, Jiansong (Simon) <[email protected]>; Zhang, Hawking <[email protected]>; Koenig, Christian <[email protected]>
Cc: Li, Dennis <[email protected]>
Subject: [PATCH] drm/amdgpu: fix a GPU hang issue when remove device

When GFXOFF is enabled and GPU is idle, driver will fail to access some registers. Therefore disable GFXOFF before unload device.

amdgpu 0000:03:00.0: amdgpu: amdgpu: finishing device.
amdgpu: cp queue pipe 4 queue 0 preemption failed amdgpu 0000:03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2 amdgpu 0000:03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706 amdgpu 0000:03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2 amdgpu 0000:03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706

Change-Id I42431f5d0bf54909e1df888a0d72fc009d8e196c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -0
index e365c4fdcfe3..47d1291d5053 100644
@@ -83,6 +83,8 @@ void amdgpu_driver_unload_kms(struct drm_device *dev)
 	if (adev == NULL)
 		return;
 
+	amdgpu_gfx_off_ctrl(adev, false);
+
 	amdgpu_unregister_gpu_instance(adev);
 
 	if (adev->rmmio == NULL)

--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx