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: Move mmhub ras block init to ras sw_init

Initialize mmhub ras block only when mmhub ip block
supports ras features. Driver queries ras capabilities
after early_init, ras block init needs to be moved to
sw_init.

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

authored by

Hawking Zhang and committed by
Alex Deucher
fec70a86 af8312a3

+54 -10
+1 -1
drivers/gpu/drm/amd/amdgpu/Makefile
··· 54 54 amdgpu_ucode.o amdgpu_bo_list.o amdgpu_ctx.o amdgpu_sync.o \ 55 55 amdgpu_gtt_mgr.o amdgpu_preempt_mgr.o amdgpu_vram_mgr.o amdgpu_virt.o \ 56 56 amdgpu_atomfirmware.o amdgpu_vf_error.o amdgpu_sched.o \ 57 - amdgpu_debugfs.o amdgpu_ids.o amdgpu_gmc.o \ 57 + amdgpu_debugfs.o amdgpu_ids.o amdgpu_gmc.o amdgpu_mmhub.o \ 58 58 amdgpu_xgmi.o amdgpu_csa.o amdgpu_ras.o amdgpu_vm_cpu.o \ 59 59 amdgpu_vm_sdma.o amdgpu_discovery.o amdgpu_ras_eeprom.o amdgpu_nbio.o \ 60 60 amdgpu_umc.o smu_v11_0_i2c.o amdgpu_fru_eeprom.o amdgpu_rap.o \
+5
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
··· 456 456 if (r) 457 457 return r; 458 458 459 + /* mmhub ras block */ 460 + r = amdgpu_mmhub_ras_sw_init(adev); 461 + if (r) 462 + return r; 463 + 459 464 if (!adev->gmc.xgmi.connected_to_cpu) { 460 465 adev->gmc.xgmi.ras = &xgmi_ras; 461 466 amdgpu_ras_register_ras_block(adev, &adev->gmc.xgmi.ras->ras_block);
+46
drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
··· 1 + /* 2 + * Copyright (C) 2023 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice shall be included 12 + * in all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 + * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 18 + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 + */ 21 + #include "amdgpu.h" 22 + #include "amdgpu_ras.h" 23 + 24 + int amdgpu_mmhub_ras_sw_init(struct amdgpu_device *adev) 25 + { 26 + int err; 27 + struct amdgpu_mmhub_ras *ras; 28 + 29 + if (!adev->mmhub.ras) 30 + return 0; 31 + 32 + ras = adev->mmhub.ras; 33 + err = amdgpu_ras_register_ras_block(adev, &ras->ras_block); 34 + if (err) { 35 + dev_err(adev->dev, "Failed to register mmhub ras block!\n"); 36 + return err; 37 + } 38 + 39 + strcpy(ras->ras_block.ras_comm.name, "mmhub"); 40 + ras->ras_block.ras_comm.block = AMDGPU_RAS_BLOCK__MMHUB; 41 + ras->ras_block.ras_comm.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE; 42 + adev->mmhub.ras_if = &ras->ras_block.ras_comm; 43 + 44 + /* mmhub ras follows amdgpu_ras_block_late_init_default for late init */ 45 + return 0; 46 + }
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h
··· 48 48 struct amdgpu_mmhub_ras *ras; 49 49 }; 50 50 51 + int amdgpu_mmhub_ras_sw_init(struct amdgpu_device *adev); 52 + 51 53 #endif 52 54
-9
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
··· 1351 1351 /* mmhub ras is not available */ 1352 1352 break; 1353 1353 } 1354 - 1355 - if (adev->mmhub.ras) { 1356 - amdgpu_ras_register_ras_block(adev, &adev->mmhub.ras->ras_block); 1357 - 1358 - strcpy(adev->mmhub.ras->ras_block.ras_comm.name, "mmhub"); 1359 - adev->mmhub.ras->ras_block.ras_comm.block = AMDGPU_RAS_BLOCK__MMHUB; 1360 - adev->mmhub.ras->ras_block.ras_comm.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE; 1361 - adev->mmhub.ras_if = &adev->mmhub.ras->ras_block.ras_comm; 1362 - } 1363 1354 } 1364 1355 1365 1356 static void gmc_v9_0_set_gfxhub_funcs(struct amdgpu_device *adev)