Skip to content

Commit 47f3af1

Browse files
Avadhut Naikgregkh
authored andcommitted
EDAC/mc_sysfs: Increase legacy channel support to 16
[ Upstream commit 6e1c2c6c2c40ce99e0d2633b212f43c702c1a002 ] 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 <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 6561a5b commit 47f3af1

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

drivers/edac/edac_mc_sysfs.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,14 @@ DEVICE_CHANNEL(ch10_dimm_label, S_IRUGO | S_IWUSR,
305305
channel_dimm_label_show, channel_dimm_label_store, 10);
306306
DEVICE_CHANNEL(ch11_dimm_label, S_IRUGO | S_IWUSR,
307307
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);
308316

309317
/* Total possible dynamic DIMM Label attribute file table */
310318
static struct attribute *dynamic_csrow_dimm_attr[] = {
@@ -320,6 +328,10 @@ static struct attribute *dynamic_csrow_dimm_attr[] = {
320328
&dev_attr_legacy_ch9_dimm_label.attr.attr,
321329
&dev_attr_legacy_ch10_dimm_label.attr.attr,
322330
&dev_attr_legacy_ch11_dimm_label.attr.attr,
331+
&dev_attr_legacy_ch12_dimm_label.attr.attr,
332+
&dev_attr_legacy_ch13_dimm_label.attr.attr,
333+
&dev_attr_legacy_ch14_dimm_label.attr.attr,
334+
&dev_attr_legacy_ch15_dimm_label.attr.attr,
323335
NULL
324336
};
325337

@@ -348,6 +360,14 @@ DEVICE_CHANNEL(ch10_ce_count, S_IRUGO,
348360
channel_ce_count_show, NULL, 10);
349361
DEVICE_CHANNEL(ch11_ce_count, S_IRUGO,
350362
channel_ce_count_show, NULL, 11);
363+
DEVICE_CHANNEL(ch12_ce_count, S_IRUGO,
364+
channel_ce_count_show, NULL, 12);
365+
DEVICE_CHANNEL(ch13_ce_count, S_IRUGO,
366+
channel_ce_count_show, NULL, 13);
367+
DEVICE_CHANNEL(ch14_ce_count, S_IRUGO,
368+
channel_ce_count_show, NULL, 14);
369+
DEVICE_CHANNEL(ch15_ce_count, S_IRUGO,
370+
channel_ce_count_show, NULL, 15);
351371

352372
/* Total possible dynamic ce_count attribute file table */
353373
static struct attribute *dynamic_csrow_ce_count_attr[] = {
@@ -363,6 +383,10 @@ static struct attribute *dynamic_csrow_ce_count_attr[] = {
363383
&dev_attr_legacy_ch9_ce_count.attr.attr,
364384
&dev_attr_legacy_ch10_ce_count.attr.attr,
365385
&dev_attr_legacy_ch11_ce_count.attr.attr,
386+
&dev_attr_legacy_ch12_ce_count.attr.attr,
387+
&dev_attr_legacy_ch13_ce_count.attr.attr,
388+
&dev_attr_legacy_ch14_ce_count.attr.attr,
389+
&dev_attr_legacy_ch15_ce_count.attr.attr,
366390
NULL
367391
};
368392

0 commit comments

Comments
 (0)