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.

EDAC/skx_common: Move mc_mapping to be a field inside struct skx_imc

The mc_mapping and imc fields of struct skx_dev have the same size,
NUM_IMC. Move mc_mapping to be a field inside struct skx_imc to prepare
for making the imc array of memory controller instances a flexible array.

No functional changes intended.

Suggested-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20250731145534.2759334-3-qiuxu.zhuo@intel.com

authored by

Qiuxu Zhuo and committed by
Tony Luck
59cfc06a 219af5df

+14 -14
+4 -4
drivers/edac/skx_common.c
··· 131 131 * EDAC driver. 132 132 */ 133 133 for (int i = 0; i < NUM_IMC; i++) 134 - d->mc_mapping[i] = i; 134 + d->imc[i].mc_mapping = i; 135 135 } 136 136 137 137 void skx_set_mc_mapping(struct skx_dev *d, u8 pmc, u8 lmc) ··· 139 139 edac_dbg(0, "Set the mapping of mc phy idx to logical idx: %02d -> %02d\n", 140 140 pmc, lmc); 141 141 142 - d->mc_mapping[pmc] = lmc; 142 + d->imc[pmc].mc_mapping = lmc; 143 143 } 144 144 EXPORT_SYMBOL_GPL(skx_set_mc_mapping); 145 145 146 146 static u8 skx_get_mc_mapping(struct skx_dev *d, u8 pmc) 147 147 { 148 148 edac_dbg(0, "Get the mapping of mc phy idx to logical idx: %02d -> %02d\n", 149 - pmc, d->mc_mapping[pmc]); 149 + pmc, d->imc[pmc].mc_mapping); 150 150 151 - return d->mc_mapping[pmc]; 151 + return d->imc[pmc].mc_mapping; 152 152 } 153 153 154 154 static bool skx_adxl_decode(struct decoded_addr *res, enum error_source err_src)
+10 -10
drivers/edac/skx_common.h
··· 135 135 struct pci_dev *pcu_cr3; /* for HBM memory detection */ 136 136 u32 mcroute; 137 137 int num_imc; 138 - /* 139 - * Some server BIOS may hide certain memory controllers, and the 140 - * EDAC driver skips those hidden memory controllers. However, the 141 - * ADXL still decodes memory error address using physical memory 142 - * controller indices. The mapping table is used to convert the 143 - * physical indices (reported by ADXL) to the logical indices 144 - * (used the EDAC driver) of present memory controllers during the 145 - * error handling process. 146 - */ 147 - u8 mc_mapping[NUM_IMC]; 148 138 struct skx_imc { 149 139 struct mem_ctl_info *mci; 150 140 struct pci_dev *mdev; /* for i10nm CPU */ ··· 146 156 u8 mc; /* system wide mc# */ 147 157 u8 lmc; /* socket relative mc# */ 148 158 u8 src_id; 159 + /* 160 + * Some server BIOS may hide certain memory controllers, and the 161 + * EDAC driver skips those hidden memory controllers. However, the 162 + * ADXL still decodes memory error address using physical memory 163 + * controller indices. The mapping table is used to convert the 164 + * physical indices (reported by ADXL) to the logical indices 165 + * (used the EDAC driver) of present memory controllers during the 166 + * error handling process. 167 + */ 168 + u8 mc_mapping; 149 169 struct skx_channel { 150 170 struct pci_dev *cdev; 151 171 struct pci_dev *edev;