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

drm/amdgpu: fix to clear ASIC INIT COMPLETE bit on resuming phase

ASIC_INIT_COMPLETE bit must be cleared during S3 resuming phase,
because VBIOS will check the bit to decide if execute ASIC_Init
posting via kernel driver.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Huang Rui and committed by
Alex Deucher
692bb1ac b4de2c5a

+13
+6
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
··· 1727 1727 { 1728 1728 int i; 1729 1729 1730 + /* 1731 + * VBIOS will check ASIC_INIT_COMPLETE bit to decide if 1732 + * execute ASIC_Init posting via driver 1733 + */ 1734 + adev->bios_scratch[7] &= ~ATOM_S7_ASIC_INIT_COMPLETE_MASK; 1735 + 1730 1736 for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++) 1731 1737 WREG32(mmBIOS_SCRATCH_0 + i, adev->bios_scratch[i]); 1732 1738 }
+7
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
··· 26 26 #include "atomfirmware.h" 27 27 #include "amdgpu_atomfirmware.h" 28 28 #include "atom.h" 29 + #include "atombios.h" 29 30 30 31 #define get_index_into_master_table(master_table, table_name) (offsetof(struct master_table, table_name) / sizeof(uint16_t)) 31 32 ··· 77 76 void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev) 78 77 { 79 78 int i; 79 + 80 + /* 81 + * VBIOS will check ASIC_INIT_COMPLETE bit to decide if 82 + * execute ASIC_Init posting via driver 83 + */ 84 + adev->bios_scratch[7] &= ~ATOM_S7_ASIC_INIT_COMPLETE_MASK; 80 85 81 86 for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++) 82 87 WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]);