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: remove is_mca_add for ras_add_bad_pages

Remove unnecessary variable and simplify the logic.

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
d08fb663 a8d133e6

+5 -11
+5 -11
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 2802 2802 struct ras_err_handler_data *data; 2803 2803 struct ras_err_data err_data; 2804 2804 struct eeprom_table_record *err_rec; 2805 + struct amdgpu_ras_eeprom_control *control = 2806 + &adev->psp.ras_context.ras->eeprom_control; 2805 2807 enum amdgpu_memory_partition nps = AMDGPU_NPS1_PARTITION_MODE; 2806 2808 int ret = 0; 2807 2809 uint32_t i, j, loop_cnt = 1; 2808 - bool is_mca_add = true, find_pages_per_pa = false; 2810 + bool find_pages_per_pa = false; 2809 2811 2810 2812 if (!con || !con->eh_data || !bps || pages <= 0) 2811 2813 return 0; 2812 - 2813 - if (!adev->umc.ras || !adev->umc.ras->convert_ras_err_addr) { 2814 - is_mca_add = false; 2815 - } else { 2816 - if ((pages > 1) && 2817 - (bps[0].address == bps[1].address) && 2818 - (bps[0].mem_channel == bps[1].mem_channel)) 2819 - is_mca_add = false; 2820 - } 2821 2814 2822 2815 if (from_rom) { 2823 2816 err_data.err_addr = ··· 2834 2841 goto free; 2835 2842 2836 2843 for (i = 0; i < pages; i++) { 2837 - if (is_mca_add) { 2844 + if (from_rom && 2845 + control->rec_type == AMDGPU_RAS_EEPROM_REC_MCA) { 2838 2846 if (!find_pages_per_pa) { 2839 2847 if (amdgpu_ras_mca2pa_by_idx(adev, &bps[i], &err_data)) { 2840 2848 if (!i && nps == AMDGPU_NPS1_PARTITION_MODE) {