]> git.hungrycats.org Git - linux/commit
drm/amdgpu: add a retry for IP discovery init
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Oct 2023 17:56:56 +0000 (13:56 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:15:18 +0000 (17:15 +0000)
commit6f617755800443ccf1d8c2991dcb672a15ab384f
treed566216bd9402e1395227d3aac0cd5fac3f07a3f
parenta5bd0c0d3189b5a8fdb6a2d80d2dd71c18b18659
drm/amdgpu: add a retry for IP discovery init

commit 3938eb956e383ef88b8fc7d556492336ebee52df upstream.

AMD dGPUs have integrated FW that runs as soon as the
device gets power and initializes the board (determines
the amount of memory, provides configuration details to
the driver, etc.).  For direct PCIe attached cards this
happens as soon as power is applied and normally completes
well before the OS has even started loading.  However, with
hotpluggable ports like USB4, the driver needs to wait for
this to complete before initializing the device.

This normally takes 60-100ms, but could take longer on
some older boards periodically due to memory training.

Retry for up to a second.  In the non-hotplug case, there
should be no change in behavior and this should complete
on the first try.

v2: adjust test criteria
v3: adjust checks for the masks, only enable on removable devices
v4: skip bif_fb_en check

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2925
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c