Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

EDAC/mc_sysfs: Increase legacy channel support to 16

Newer AMD systems can support up to 16 channels per EDAC "mc" device.
These are detected by the EDAC module running on the device, and the
current EDAC interface is appropriately enumerated.

The legacy EDAC sysfs interface however, provides device attributes for
channels 0 through 11 only. Consequently, the last four channels, 12
through 15, will not be enumerated and will not be visible through the
legacy sysfs interface.

Add additional device attributes to ensure that all 16 channels, if
present, are enumerated by and visible through the legacy EDAC sysfs
interface.

Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250916203242.1281036-1-avadhut.naik@amd.com

authored by

Avadhut Naik and committed by
Borislav Petkov (AMD)
6e1c2c6c 6fffa38c

+24
+24
drivers/edac/edac_mc_sysfs.c
··· 305 305 channel_dimm_label_show, channel_dimm_label_store, 10); 306 306 DEVICE_CHANNEL(ch11_dimm_label, S_IRUGO | S_IWUSR, 307 307 channel_dimm_label_show, channel_dimm_label_store, 11); 308 + DEVICE_CHANNEL(ch12_dimm_label, S_IRUGO | S_IWUSR, 309 + channel_dimm_label_show, channel_dimm_label_store, 12); 310 + DEVICE_CHANNEL(ch13_dimm_label, S_IRUGO | S_IWUSR, 311 + channel_dimm_label_show, channel_dimm_label_store, 13); 312 + DEVICE_CHANNEL(ch14_dimm_label, S_IRUGO | S_IWUSR, 313 + channel_dimm_label_show, channel_dimm_label_store, 14); 314 + DEVICE_CHANNEL(ch15_dimm_label, S_IRUGO | S_IWUSR, 315 + channel_dimm_label_show, channel_dimm_label_store, 15); 308 316 309 317 /* Total possible dynamic DIMM Label attribute file table */ 310 318 static struct attribute *dynamic_csrow_dimm_attr[] = { ··· 328 320 &dev_attr_legacy_ch9_dimm_label.attr.attr, 329 321 &dev_attr_legacy_ch10_dimm_label.attr.attr, 330 322 &dev_attr_legacy_ch11_dimm_label.attr.attr, 323 + &dev_attr_legacy_ch12_dimm_label.attr.attr, 324 + &dev_attr_legacy_ch13_dimm_label.attr.attr, 325 + &dev_attr_legacy_ch14_dimm_label.attr.attr, 326 + &dev_attr_legacy_ch15_dimm_label.attr.attr, 331 327 NULL 332 328 }; 333 329 ··· 360 348 channel_ce_count_show, NULL, 10); 361 349 DEVICE_CHANNEL(ch11_ce_count, S_IRUGO, 362 350 channel_ce_count_show, NULL, 11); 351 + DEVICE_CHANNEL(ch12_ce_count, S_IRUGO, 352 + channel_ce_count_show, NULL, 12); 353 + DEVICE_CHANNEL(ch13_ce_count, S_IRUGO, 354 + channel_ce_count_show, NULL, 13); 355 + DEVICE_CHANNEL(ch14_ce_count, S_IRUGO, 356 + channel_ce_count_show, NULL, 14); 357 + DEVICE_CHANNEL(ch15_ce_count, S_IRUGO, 358 + channel_ce_count_show, NULL, 15); 363 359 364 360 /* Total possible dynamic ce_count attribute file table */ 365 361 static struct attribute *dynamic_csrow_ce_count_attr[] = { ··· 383 363 &dev_attr_legacy_ch9_ce_count.attr.attr, 384 364 &dev_attr_legacy_ch10_ce_count.attr.attr, 385 365 &dev_attr_legacy_ch11_ce_count.attr.attr, 366 + &dev_attr_legacy_ch12_ce_count.attr.attr, 367 + &dev_attr_legacy_ch13_ce_count.attr.attr, 368 + &dev_attr_legacy_ch14_ce_count.attr.attr, 369 + &dev_attr_legacy_ch15_ce_count.attr.attr, 386 370 NULL 387 371 }; 388 372