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

drm/amdgpu/cik: add need_reset_on_init asic callback for CIK (v2)

CIK 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/cik.c
··· 1787 1787 *count1 = RREG32_PCIE(ixPCIE_PERF_COUNT1_TXCLK) | (cnt1_of << 32); 1788 1788 } 1789 1789 1790 + static bool cik_need_reset_on_init(struct amdgpu_device *adev) 1791 + { 1792 + u32 clock_cntl, pc; 1793 + 1794 + if (adev->flags & AMD_IS_APU) 1795 + return false; 1796 + 1797 + /* check if the SMC is already running */ 1798 + clock_cntl = RREG32_SMC(ixSMC_SYSCON_CLOCK_CNTL_0); 1799 + pc = RREG32_SMC(ixSMC_PC_C); 1800 + if ((0 == REG_GET_FIELD(clock_cntl, SMC_SYSCON_CLOCK_CNTL_0, ck_disable)) && 1801 + (0x20100 <= pc)) 1802 + return true; 1803 + 1804 + return false; 1805 + } 1806 + 1790 1807 static const struct amdgpu_asic_funcs cik_asic_funcs = 1791 1808 { 1792 1809 .read_disabled_bios = &cik_read_disabled_bios, ··· 1820 1803 .need_full_reset = &cik_need_full_reset, 1821 1804 .init_doorbell_index = &legacy_doorbell_index_init, 1822 1805 .get_pcie_usage = &cik_get_pcie_usage, 1806 + .need_reset_on_init = &cik_need_reset_on_init, 1823 1807 }; 1824 1808 1825 1809 static int cik_common_early_init(void *handle)