]> git.itanic.dy.fi Git - linux-stable/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)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 3 Nov 2023 15:59:51 +0000 (11:59 -0400)
commit3938eb956e383ef88b8fc7d556492336ebee52df
tree7a1bbf37467ebfd3ac980cba11ec6688f07f9a9f
parent886b92f63573eab4ba30b06c4514b8f4af114e6a
drm/amdgpu: add a retry for IP discovery init

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
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c