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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: set UMC PA per NPS mode when PA is 0

The shift bit of PA varys according to NPS mode due to
different address format.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tao Zhou and committed by
Alex Deucher
ea8094ab d08fb663

+8 -1
+8 -1
drivers/gpu/drm/amd/amdgpu/umc_v12_0.c
··· 467 467 uint64_t err_addr, pa_addr = 0; 468 468 struct ras_ecc_err *ecc_err; 469 469 struct ta_ras_query_address_output addr_out; 470 + enum amdgpu_memory_partition nps = AMDGPU_NPS1_PARTITION_MODE; 471 + uint32_t shift_bit = UMC_V12_0_PA_C4_BIT; 470 472 int count, ret, i; 471 473 472 474 hwid = REG_GET_FIELD(ipid, MCMP1_IPIDT0, HardwareID); ··· 513 511 ecc_err->pa_pfn = pa_addr >> AMDGPU_GPU_PAGE_SHIFT; 514 512 ecc_err->channel_idx = addr_out.pa.channel_idx; 515 513 514 + if (adev->gmc.gmc_funcs->query_mem_partition_mode) 515 + nps = adev->gmc.gmc_funcs->query_mem_partition_mode(adev); 516 + if (nps == AMDGPU_NPS4_PARTITION_MODE) 517 + shift_bit = UMC_V12_0_PA_B0_BIT; 518 + 516 519 /* If converted pa_pfn is 0, use pa C4 pfn. */ 517 520 if (!ecc_err->pa_pfn) 518 - ecc_err->pa_pfn = BIT_ULL(UMC_V12_0_PA_C4_BIT) >> AMDGPU_GPU_PAGE_SHIFT; 521 + ecc_err->pa_pfn = BIT_ULL(shift_bit) >> AMDGPU_GPU_PAGE_SHIFT; 519 522 520 523 ret = amdgpu_umc_logs_ecc_err(adev, &con->umc_ecc_log.de_page_tree, ecc_err); 521 524 if (ret) {