drm/amdgpu: Fix discovery initialization failure during pci rescan
Waiting for system ready to fix the discovery initialization failure issue. This failure usually occurs when dGPU is removed and then rescanned via command line. It's caused by following two errors: [1] vram size is 0 [2] wrong binary signature Signed-off-by: Ma Jun <Jun.Ma2@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
394ae0603a
commit
959056982a
1 changed files with 6 additions and 11 deletions
|
@ -255,7 +255,6 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
|
||||||
uint64_t vram_size;
|
uint64_t vram_size;
|
||||||
u32 msg;
|
u32 msg;
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
int ip_discovery_ver = 0;
|
|
||||||
|
|
||||||
/* It can take up to a second for IFWI init to complete on some dGPUs,
|
/* It can take up to a second for IFWI init to complete on some dGPUs,
|
||||||
* but generally it should be in the 60-100ms range. Normally this starts
|
* but generally it should be in the 60-100ms range. Normally this starts
|
||||||
|
@ -265,17 +264,13 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
|
||||||
* continue.
|
* continue.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ip_discovery_ver = RREG32(mmIP_DISCOVERY_VERSION);
|
for (i = 0; i < 1000; i++) {
|
||||||
if ((dev_is_removable(&adev->pdev->dev)) ||
|
msg = RREG32(mmMP0_SMN_C2PMSG_33);
|
||||||
(ip_discovery_ver == IP_DISCOVERY_V2) ||
|
if (msg & 0x80000000)
|
||||||
(ip_discovery_ver == IP_DISCOVERY_V4)) {
|
break;
|
||||||
for (i = 0; i < 1000; i++) {
|
usleep_range(1000, 1100);
|
||||||
msg = RREG32(mmMP0_SMN_C2PMSG_33);
|
|
||||||
if (msg & 0x80000000)
|
|
||||||
break;
|
|
||||||
msleep(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vram_size = (uint64_t)RREG32(mmRCC_CONFIG_MEMSIZE) << 20;
|
vram_size = (uint64_t)RREG32(mmRCC_CONFIG_MEMSIZE) << 20;
|
||||||
|
|
||||||
if (vram_size) {
|
if (vram_size) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue