[PATCH] drm/amdgpu: fix eGPU hotplug regression

Zhang, Hawking Hawking.Zhang at amd.com
Mon Aug 19 15:26:53 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>

Regards,
Hawking
-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Monday, August 19, 2024 23:24
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Ma Jun <Jun.Ma2 at amd.com>
Subject: [PATCH] drm/amdgpu: fix eGPU hotplug regression

The driver needs to wait for the on board firmware to finish its initialization before probing the card.
Commit 959056982a9b ("drm/amdgpu: Fix discovery initialization failure during pci rescan") switched from using msleep() to using usleep_range() which seems to have caused init failures on some navi1x boards. Switch back to msleep().

Fixes: 959056982a9b ("drm/amdgpu: Fix discovery initialization failure during pci rescan")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3559
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3500
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
Cc: Ma Jun <Jun.Ma2 at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index ac108fca64fe6..7b561e8e3cafc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -278,7 +278,7 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
                        msg = RREG32(mmMP0_SMN_C2PMSG_33);
                        if (msg & 0x80000000)
                                break;
-                       usleep_range(1000, 1100);
+                       msleep(1);
                }
        }

--
2.46.0



More information about the amd-gfx mailing list