drm/amdgpu: Add delay after enable RLC ucode
authorshaoyunl <shaoyun.liu@amd.com>
Thu, 22 Nov 2018 16:45:24 +0000 (11:45 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Dec 2018 08:28:53 +0000 (09:28 +0100)
commitcc92ade5f498bb56f2316588c954d7371849b27b
treeca76ab558259934d6eed51162ad002249b1ae3ed
parent8a69edb8f7db6908910334399a9829f98163252e
drm/amdgpu: Add delay after enable RLC ucode

[ Upstream commit ad97d9de45835b6a0f71983b0ae0cffd7306730a ]

Driver shouldn't try to access any GFX registers until RLC is idle.
During the test, it took 12 seconds for RLC to clear the BUSY bit
in RLC_GPM_STAT register which is un-acceptable for driver.
As per RLC engineer, it would take RLC Ucode less than 10,000 GFXCLK
cycles to finish its critical section. In a lowest 300M enginer clock
setting(default from vbios), 50 us delay is enough.

This commit fix the hang when RLC introduce the work around for XGMI
which requires more cycles to setup more registers than normal

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c