Commit 1da2c326 authored by Monk Liu's avatar Monk Liu Committed by Alex Deucher

drm/amdgpu:fix vpost_needed routine

1,cleanup description/comments
2,for FIJI & passthrough, force post when smc fw version below 22.15
3,for other cases, follow regular rules
Signed-off-by: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cb434658
...@@ -658,12 +658,10 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev) ...@@ -658,12 +658,10 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev)
return false; return false;
if (amdgpu_passthrough(adev)) { if (amdgpu_passthrough(adev)) {
/* for FIJI: In whole GPU pass-through virtualization case /* for FIJI: In whole GPU pass-through virtualization case, after VM reboot
* old smc fw won't clear some registers (e.g. MEM_SIZE, BIOS_SCRATCH) * some old smc fw still need driver do vPost otherwise gpu hang, while
* so amdgpu_card_posted return false and driver will incorrectly skip vPost. * those smc fw version above 22.15 doesn't have this flaw, so we force
* but if we force vPost do in pass-through case, the driver reload will hang. * vpost executed for smc version below 22.15
* whether doing vPost depends on amdgpu_card_posted if smc version is above
* 00160e00 for FIJI.
*/ */
if (adev->asic_type == CHIP_FIJI) { if (adev->asic_type == CHIP_FIJI) {
int err; int err;
...@@ -674,22 +672,11 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev) ...@@ -674,22 +672,11 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev)
return true; return true;
fw_ver = *((uint32_t *)adev->pm.fw->data + 69); fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
if (fw_ver >= 0x00160e00) if (fw_ver < 0x00160e00)
return !amdgpu_card_posted(adev); return true;
} }
} else {
/* in bare-metal case, amdgpu_card_posted return false
* after system reboot/boot, and return true if driver
* reloaded.
* we shouldn't do vPost after driver reload otherwise GPU
* could hang.
*/
if (amdgpu_card_posted(adev))
return false;
} }
return !amdgpu_card_posted(adev);
/* we assume vPost is neede for all other cases */
return true;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment