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 a flag to indicate UMC channel index version

v1 (legacy way): store channel index within a UMC instance in eeprom
v2: store global channel index in eeprom

V2: only save the flag on eeprom, clear it after saving.

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
2206daa1 71a0e963

+26 -1
+10 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
··· 841 841 const u32 num) 842 842 { 843 843 struct amdgpu_device *adev = to_amdgpu_device(control); 844 - int res; 844 + int res, i; 845 845 846 846 if (!__is_ras_eeprom_supported(adev)) 847 847 return 0; ··· 855 855 return -EINVAL; 856 856 } 857 857 858 + /* set the new channel index flag */ 859 + for (i = 0; i < num; i++) 860 + record[i].retired_page |= UMC_CHANNEL_IDX_V2; 861 + 858 862 mutex_lock(&control->ras_tbl_mutex); 859 863 860 864 res = amdgpu_ras_eeprom_append_table(control, record, num); ··· 868 864 amdgpu_ras_debugfs_set_ret_size(control); 869 865 870 866 mutex_unlock(&control->ras_tbl_mutex); 867 + 868 + /* clear channel index flag, the flag is only saved on eeprom */ 869 + for (i = 0; i < num; i++) 870 + record[i].retired_page &= ~UMC_CHANNEL_IDX_V2; 871 + 871 872 return res; 872 873 } 873 874
+16
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
··· 54 54 55 55 /* Page retirement tag */ 56 56 #define UMC_ECC_NEW_DETECTED_TAG 0x1 57 + /* 58 + * a flag to indicate v2 of channel index stored in eeprom 59 + * 60 + * v1 (legacy way): store channel index within a umc instance in eeprom 61 + * range in UMC v12: 0 ~ 7 62 + * v2: store global channel index in eeprom 63 + * range in UMC v12: 0 ~ 127 64 + * 65 + * NOTE: it's better to store it in eeprom_table_record.mem_channel, 66 + * but there is only 8 bits in mem_channel, and the channel number may 67 + * increase in the future, we decide to save it in 68 + * eeprom_table_record.retired_page. retired_page is useless in v2, 69 + * we depend on eeprom_table_record.address instead of retired_page in v2. 70 + * Only 48 bits are saved on eeprom, use bit 47 here. 71 + */ 72 + #define UMC_CHANNEL_IDX_V2 BIT_ULL(47) 57 73 58 74 typedef int (*umc_func)(struct amdgpu_device *adev, uint32_t node_inst, 59 75 uint32_t umc_inst, uint32_t ch_inst, void *data);