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: Save PA of bad pages for old asics

for old asics that do not support mca translating, we
just save PA for them

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

authored by

ganglxie and committed by
Alex Deucher
a4b6e990 2da3af5f

+28 -5
+21 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 2836 2836 2837 2837 save_nps = (bps[0].retired_page >> UMC_NPS_SHIFT) & UMC_NPS_MASK; 2838 2838 2839 + /*old asics just have pa in eeprom*/ 2840 + if (IP_VERSION_MAJ(amdgpu_ip_version(adev, UMC_HWIP, 0)) < 12) { 2841 + memcpy(err_data->err_addr, bps, 2842 + sizeof(struct eeprom_table_record) * adev->umc.retire_unit); 2843 + goto out; 2844 + } 2845 + 2839 2846 for (i = 0; i < adev->umc.retire_unit; i++) 2840 2847 bps[i].retired_page &= ~(UMC_NPS_MASK << UMC_NPS_SHIFT); 2841 2848 ··· 2865 2858 } 2866 2859 } 2867 2860 2861 + out: 2868 2862 return __amdgpu_ras_restore_bad_pages(adev, err_data->err_addr, adev->umc.retire_unit); 2869 2863 } 2870 2864 ··· 2989 2981 2990 2982 /* only new entries are saved */ 2991 2983 if (save_count > 0) { 2992 - for (i = 0; i < unit_num; i++) { 2984 + /*old asics only save pa to eeprom like before*/ 2985 + if (IP_VERSION_MAJ(amdgpu_ip_version(adev, UMC_HWIP, 0)) < 12) { 2993 2986 if (amdgpu_ras_eeprom_append(control, 2994 - &data->bps[bad_page_num + i * adev->umc.retire_unit], 2995 - 1)) { 2987 + &data->bps[bad_page_num], save_count)) { 2996 2988 dev_err(adev->dev, "Failed to save EEPROM table data!"); 2997 2989 return -EIO; 2998 2990 } 2991 + } else { 2992 + for (i = 0; i < unit_num; i++) { 2993 + if (amdgpu_ras_eeprom_append(control, 2994 + &data->bps[bad_page_num + 2995 + i * adev->umc.retire_unit], 1)) { 2996 + dev_err(adev->dev, "Failed to save EEPROM table data!"); 2997 + return -EIO; 2998 + } 2999 + } 2999 3000 } 3001 + 3000 3002 dev_info(adev->dev, "Saved %d pages to EEPROM table.\n", save_count); 3001 3003 } 3002 3004
+7 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
··· 727 727 - control->ras_fri) 728 728 % control->ras_max_record_count; 729 729 730 - control->ras_num_mca_recs += num; 731 - control->ras_num_bad_pages += num * adev->umc.retire_unit; 730 + /*old asics only save pa to eeprom like before*/ 731 + if (IP_VERSION_MAJ(amdgpu_ip_version(adev, UMC_HWIP, 0)) < 12) 732 + control->ras_num_pa_recs += num; 733 + else 734 + control->ras_num_mca_recs += num; 732 735 736 + control->ras_num_bad_pages = control->ras_num_pa_recs + 737 + control->ras_num_mca_recs * adev->umc.retire_unit; 733 738 Out: 734 739 kfree(buf); 735 740 return res;