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: Add poison mode query for df v4_3

Add poison mode query support on df v4_3.

Signed-off-by: Candice Li <candice.li@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Candice Li and committed by
Alex Deucher
e4f665de 6c03a3fc

+98 -1
+2 -1
drivers/gpu/drm/amd/amdgpu/Makefile
··· 81 81 # add DF block 82 82 amdgpu-y += \ 83 83 df_v1_7.o \ 84 - df_v3_6.o 84 + df_v3_6.o \ 85 + df_v4_3.o 85 86 86 87 # add GMC block 87 88 amdgpu-y += \
+4
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
··· 33 33 #include "gmc_v9_0.h" 34 34 #include "df_v1_7.h" 35 35 #include "df_v3_6.h" 36 + #include "df_v4_3.h" 36 37 #include "nbio_v6_1.h" 37 38 #include "nbio_v7_0.h" 38 39 #include "nbio_v7_4.h" ··· 2329 2328 case IP_VERSION(3, 5, 1): 2330 2329 case IP_VERSION(3, 5, 2): 2331 2330 adev->df.funcs = &df_v1_7_funcs; 2331 + break; 2332 + case IP_VERSION(4, 3, 0): 2333 + adev->df.funcs = &df_v4_3_funcs; 2332 2334 break; 2333 2335 default: 2334 2336 break;
+61
drivers/gpu/drm/amd/amdgpu/df_v4_3.c
··· 1 + /* 2 + * Copyright 2022 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 in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * 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) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + */ 23 + #include "amdgpu.h" 24 + #include "df_v4_3.h" 25 + 26 + #include "df/df_4_3_offset.h" 27 + #include "df/df_4_3_sh_mask.h" 28 + 29 + static bool df_v4_3_query_ras_poison_mode(struct amdgpu_device *adev) 30 + { 31 + uint32_t hw_assert_msklo, hw_assert_mskhi; 32 + uint32_t v0, v1, v28, v31; 33 + 34 + hw_assert_msklo = RREG32_SOC15(DF, 0, 35 + regDF_CS_UMC_AON0_HardwareAssertMaskLow); 36 + hw_assert_mskhi = RREG32_SOC15(DF, 0, 37 + regDF_NCS_PG0_HardwareAssertMaskHigh); 38 + 39 + v0 = REG_GET_FIELD(hw_assert_msklo, 40 + DF_CS_UMC_AON0_HardwareAssertMaskLow, HWAssertMsk0); 41 + v1 = REG_GET_FIELD(hw_assert_msklo, 42 + DF_CS_UMC_AON0_HardwareAssertMaskLow, HWAssertMsk1); 43 + v28 = REG_GET_FIELD(hw_assert_mskhi, 44 + DF_NCS_PG0_HardwareAssertMaskHigh, HWAssertMsk28); 45 + v31 = REG_GET_FIELD(hw_assert_mskhi, 46 + DF_NCS_PG0_HardwareAssertMaskHigh, HWAssertMsk31); 47 + 48 + if (v0 && v1 && v28 && v31) 49 + return true; 50 + else if (!v0 && !v1 && !v28 && !v31) 51 + return false; 52 + else { 53 + dev_warn(adev->dev, "DF poison setting is inconsistent(%d:%d:%d:%d)!\n", 54 + v0, v1, v28, v31); 55 + return false; 56 + } 57 + } 58 + 59 + const struct amdgpu_df_funcs df_v4_3_funcs = { 60 + .query_ras_poison_mode = df_v4_3_query_ras_poison_mode, 61 + };
+31
drivers/gpu/drm/amd/amdgpu/df_v4_3.h
··· 1 + /* 2 + * Copyright 2022 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 in 12 + * all copies or substantial portions of the Software. 13 + * 14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 + * 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) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 + * OTHER DEALINGS IN THE SOFTWARE. 21 + * 22 + */ 23 + 24 + #ifndef __DF_V4_3_H__ 25 + #define __DF_V4_3_H__ 26 + 27 + #include "soc15_common.h" 28 + 29 + extern const struct amdgpu_df_funcs df_v4_3_funcs; 30 + 31 + #endif