drm/amdgpu: fix eGPU hotplug regression
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Aug 2024 15:14:29 +0000 (11:14 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Aug 2024 03:07:11 +0000 (23:07 -0400)
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
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Ma Jun <Jun.Ma2@amd.com>
(cherry picked from commit c69b07f7bbc905022491c45097923d3487479529)
Cc: stable@vger.kernel.org # 6.10.x
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index ac108fca64fe62a8d7a9429a253ef0b0055fdd25..7b561e8e3cafc004b6ac808e09950494373f8a6b 100644 (file)
@@ -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);
                }
        }