Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Monk Liu and committed by
Alex Deucher
1da2c326 cb434658

+7 -20
+7 -20
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 658 658 return false; 659 659 660 660 if (amdgpu_passthrough(adev)) { 661 - /* for FIJI: In whole GPU pass-through virtualization case 662 - * old smc fw won't clear some registers (e.g. MEM_SIZE, BIOS_SCRATCH) 663 - * so amdgpu_card_posted return false and driver will incorrectly skip vPost. 664 - * but if we force vPost do in pass-through case, the driver reload will hang. 665 - * whether doing vPost depends on amdgpu_card_posted if smc version is above 666 - * 00160e00 for FIJI. 661 + /* for FIJI: In whole GPU pass-through virtualization case, after VM reboot 662 + * some old smc fw still need driver do vPost otherwise gpu hang, while 663 + * those smc fw version above 22.15 doesn't have this flaw, so we force 664 + * vpost executed for smc version below 22.15 667 665 */ 668 666 if (adev->asic_type == CHIP_FIJI) { 669 667 int err; ··· 672 674 return true; 673 675 674 676 fw_ver = *((uint32_t *)adev->pm.fw->data + 69); 675 - if (fw_ver >= 0x00160e00) 676 - return !amdgpu_card_posted(adev); 677 + if (fw_ver < 0x00160e00) 678 + return true; 677 679 } 678 - } else { 679 - /* in bare-metal case, amdgpu_card_posted return false 680 - * after system reboot/boot, and return true if driver 681 - * reloaded. 682 - * we shouldn't do vPost after driver reload otherwise GPU 683 - * could hang. 684 - */ 685 - if (amdgpu_card_posted(adev)) 686 - return false; 687 680 } 688 - 689 - /* we assume vPost is neede for all other cases */ 690 - return true; 681 + return !amdgpu_card_posted(adev); 691 682 } 692 683 693 684 /**