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: use page retirement API in MCA notifier

Make the code more readable.

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
24b82292 cbe4d43e

+3 -33
+3 -33
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 36 36 #include "ivsrcid/nbio/irqsrcs_nbif_7_4.h" 37 37 #include "atom.h" 38 38 #include "amdgpu_reset.h" 39 - #include "umc_v6_7.h" 40 39 41 40 #ifdef CONFIG_X86_MCE_AMD 42 41 #include <asm/mce.h> ··· 2848 2849 struct amdgpu_device *adev = NULL; 2849 2850 uint32_t gpu_id = 0; 2850 2851 uint32_t umc_inst = 0, ch_inst = 0; 2851 - struct ras_err_data err_data = {0, 0, 0, NULL}; 2852 2852 2853 2853 /* 2854 2854 * If the error was generated in UMC_V2, which belongs to GPU UMCs, ··· 2886 2888 dev_info(adev->dev, "Uncorrectable error detected in UMC inst: %d, chan_idx: %d", 2887 2889 umc_inst, ch_inst); 2888 2890 2889 - err_data.err_addr = 2890 - kcalloc(adev->umc.max_ras_err_cnt_per_query, 2891 - sizeof(struct eeprom_table_record), GFP_KERNEL); 2892 - if (!err_data.err_addr) { 2893 - dev_warn(adev->dev, 2894 - "Failed to alloc memory for umc error record in mca notifier!\n"); 2891 + if (!amdgpu_umc_page_retirement_mca(adev, m->addr, ch_inst, umc_inst)) 2892 + return NOTIFY_OK; 2893 + else 2895 2894 return NOTIFY_DONE; 2896 - } 2897 - 2898 - /* 2899 - * Translate UMC channel address to Physical address 2900 - */ 2901 - switch (adev->ip_versions[UMC_HWIP][0]) { 2902 - case IP_VERSION(6, 7, 0): 2903 - umc_v6_7_convert_error_address(adev, 2904 - &err_data, m->addr, ch_inst, umc_inst); 2905 - break; 2906 - default: 2907 - dev_warn(adev->dev, 2908 - "UMC address to Physical address translation is not supported\n"); 2909 - kfree(err_data.err_addr); 2910 - return NOTIFY_DONE; 2911 - } 2912 - 2913 - if (amdgpu_bad_page_threshold != 0) { 2914 - amdgpu_ras_add_bad_pages(adev, err_data.err_addr, 2915 - err_data.err_addr_cnt); 2916 - amdgpu_ras_save_bad_pages(adev); 2917 - } 2918 - 2919 - kfree(err_data.err_addr); 2920 - return NOTIFY_OK; 2921 2895 } 2922 2896 2923 2897 static struct notifier_block amdgpu_bad_page_nb = {