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

drm/amdgpu/vi: add need_reset_on_init asic callback for VI (v2)

VI chips require a reset if the driver was previously loaded
because the SMU can only be loaded once between each reset.

v2: rebase

Reviewed-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+18
+18
drivers/gpu/drm/amd/amdgpu/vi.c
··· 987 987 *count1 = RREG32_PCIE(ixPCIE_PERF_COUNT1_TXCLK) | (cnt1_of << 32); 988 988 } 989 989 990 + static bool vi_need_reset_on_init(struct amdgpu_device *adev) 991 + { 992 + u32 clock_cntl, pc; 993 + 994 + if (adev->flags & AMD_IS_APU) 995 + return false; 996 + 997 + /* check if the SMC is already running */ 998 + clock_cntl = RREG32_SMC(ixSMC_SYSCON_CLOCK_CNTL_0); 999 + pc = RREG32_SMC(ixSMC_PC_C); 1000 + if ((0 == REG_GET_FIELD(clock_cntl, SMC_SYSCON_CLOCK_CNTL_0, ck_disable)) && 1001 + (0x20100 <= pc)) 1002 + return true; 1003 + 1004 + return false; 1005 + } 1006 + 990 1007 static const struct amdgpu_asic_funcs vi_asic_funcs = 991 1008 { 992 1009 .read_disabled_bios = &vi_read_disabled_bios, ··· 1020 1003 .need_full_reset = &vi_need_full_reset, 1021 1004 .init_doorbell_index = &legacy_doorbell_index_init, 1022 1005 .get_pcie_usage = &vi_get_pcie_usage, 1006 + .need_reset_on_init = &vi_need_reset_on_init, 1023 1007 }; 1024 1008 1025 1009 #define CZ_REV_BRISTOL(rev) \