Skip to content

Commit eba77c0

Browse files
committed
Merge tag 'edac_updates_for_v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras
Pull EDAC updates from Borislav Petkov: - Have skx_edac decode error addresses belonging to SGX properly - Remove a bunch of unused struct members - Other cleanups * tag 'edac_updates_for_v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/skx_common: Allow decoding of SGX addresses EDAC/mc_sysfs: Convert sprintf()/snprintf() to sysfs_emit() EDAC: Remove unused struct members EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() EDAC/device: Remove edac_dev_sysfs_block_attribute::store() EDAC/device: Remove edac_dev_sysfs_block_attribute::{block,value} EDAC/amd64: Remove unused struct member amd64_pvt::ext_nbcfg
2 parents 796aec4 + e0d3350 commit eba77c0

20 files changed

+50
-147
lines changed

drivers/edac/altera_edac.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,7 @@ static int altr_edac_device_probe(struct platform_device *pdev)
737737
}
738738

739739
dci = edac_device_alloc_ctl_info(sizeof(*drvdata), ecc_name,
740-
1, ecc_name, 1, 0, NULL, 0,
741-
dev_instance++);
740+
1, ecc_name, 1, 0, dev_instance++);
742741

743742
if (!dci) {
744743
edac_printk(KERN_ERR, EDAC_DEVICE,
@@ -1514,7 +1513,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
15141513
/* Create the PortB EDAC device */
15151514
edac_idx = edac_device_alloc_index();
15161515
dci = edac_device_alloc_ctl_info(sizeof(*altdev), ecc_name, 1,
1517-
ecc_name, 1, 0, NULL, 0, edac_idx);
1516+
ecc_name, 1, 0, edac_idx);
15181517
if (!dci) {
15191518
edac_printk(KERN_ERR, EDAC_DEVICE,
15201519
"%s: Unable to allocate PortB EDAC device\n",
@@ -1921,8 +1920,7 @@ static int altr_edac_a10_device_add(struct altr_arria10_edac *edac,
19211920

19221921
edac_idx = edac_device_alloc_index();
19231922
dci = edac_device_alloc_ctl_info(sizeof(*altdev), ecc_name,
1924-
1, ecc_name, 1, 0, NULL, 0,
1925-
edac_idx);
1923+
1, ecc_name, 1, 0, edac_idx);
19261924

19271925
if (!dci) {
19281926
edac_printk(KERN_ERR, EDAC_DEVICE,

drivers/edac/amd64_edac.h

-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ struct amd64_pvt {
345345
u32 dchr1; /* DRAM Configuration High DCT1 reg */
346346
u32 nbcap; /* North Bridge Capabilities */
347347
u32 nbcfg; /* F10 North Bridge Configuration */
348-
u32 ext_nbcfg; /* Extended F10 North Bridge Configuration */
349348
u32 dhar; /* DRAM Hoist reg */
350349
u32 dbam0; /* DRAM Base Address Mapping reg for DCT0 */
351350
u32 dbam1; /* DRAM Base Address Mapping reg for DCT1 */

drivers/edac/amd8111_edac.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ static int amd8111_dev_probe(struct pci_dev *dev,
366366
dev_info->edac_idx = edac_device_alloc_index();
367367
dev_info->edac_dev =
368368
edac_device_alloc_ctl_info(0, dev_info->ctl_name, 1,
369-
NULL, 0, 0,
370-
NULL, 0, dev_info->edac_idx);
369+
NULL, 0, 0, dev_info->edac_idx);
371370
if (!dev_info->edac_dev) {
372371
ret = -ENOMEM;
373372
goto err_dev_put;

drivers/edac/armada_xp_edac.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static int aurora_l2_probe(struct platform_device *pdev)
523523
dev_warn(&pdev->dev, "data ECC is not enabled\n");
524524

525525
dci = edac_device_alloc_ctl_info(sizeof(*drvdata),
526-
"cpu", 1, "L", 1, 2, NULL, 0, 0);
526+
"cpu", 1, "L", 1, 2, 0);
527527
if (!dci)
528528
return -ENOMEM;
529529

drivers/edac/cpc925_edac.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ static void cpc925_add_edac_devices(void __iomem *vbase)
797797
dev_info->edac_idx = edac_device_alloc_index();
798798
dev_info->edac_dev =
799799
edac_device_alloc_ctl_info(0, dev_info->ctl_name,
800-
1, NULL, 0, 0, NULL, 0, dev_info->edac_idx);
800+
1, NULL, 0, 0, dev_info->edac_idx);
801801
if (!dev_info->edac_dev) {
802802
cpc925_printk(KERN_ERR, "No memory for edac device\n");
803803
goto err1;

drivers/edac/edac_device.c

+2-51
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
5656
struct edac_device_ctl_info *
5757
edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instances,
5858
char *blk_name, unsigned nr_blocks, unsigned off_val,
59-
struct edac_dev_sysfs_block_attribute *attrib_spec,
60-
unsigned nr_attrib, int device_index)
59+
int device_index)
6160
{
62-
struct edac_dev_sysfs_block_attribute *dev_attrib, *attrib_p, *attrib;
6361
struct edac_device_block *dev_blk, *blk_p, *blk;
6462
struct edac_device_instance *dev_inst, *inst;
6563
struct edac_device_ctl_info *dev_ctl;
66-
unsigned instance, block, attr;
64+
unsigned instance, block;
6765
void *pvt;
6866
int err;
6967

@@ -85,15 +83,6 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance
8583

8684
dev_ctl->blocks = dev_blk;
8785

88-
if (nr_attrib) {
89-
dev_attrib = kcalloc(nr_attrib, sizeof(struct edac_dev_sysfs_block_attribute),
90-
GFP_KERNEL);
91-
if (!dev_attrib)
92-
goto free;
93-
94-
dev_ctl->attribs = dev_attrib;
95-
}
96-
9786
if (pvt_sz) {
9887
pvt = kzalloc(pvt_sz, GFP_KERNEL);
9988
if (!pvt)
@@ -132,44 +121,6 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance
132121

133122
edac_dbg(4, "instance=%d inst_p=%p block=#%d block_p=%p name='%s'\n",
134123
instance, inst, block, blk, blk->name);
135-
136-
/* if there are NO attributes OR no attribute pointer
137-
* then continue on to next block iteration
138-
*/
139-
if ((nr_attrib == 0) || (attrib_spec == NULL))
140-
continue;
141-
142-
/* setup the attribute array for this block */
143-
blk->nr_attribs = nr_attrib;
144-
attrib_p = &dev_attrib[block*nr_instances*nr_attrib];
145-
blk->block_attributes = attrib_p;
146-
147-
edac_dbg(4, "THIS BLOCK_ATTRIB=%p\n",
148-
blk->block_attributes);
149-
150-
/* Initialize every user specified attribute in this
151-
* block with the data the caller passed in
152-
* Each block gets its own copy of pointers,
153-
* and its unique 'value'
154-
*/
155-
for (attr = 0; attr < nr_attrib; attr++) {
156-
attrib = &attrib_p[attr];
157-
158-
/* populate the unique per attrib
159-
* with the code pointers and info
160-
*/
161-
attrib->attr = attrib_spec[attr].attr;
162-
attrib->show = attrib_spec[attr].show;
163-
attrib->store = attrib_spec[attr].store;
164-
165-
attrib->block = blk; /* up link */
166-
167-
edac_dbg(4, "alloc-attrib=%p attrib_name='%s' attrib-spec=%p spec-name=%s\n",
168-
attrib, attrib->attr.name,
169-
&attrib_spec[attr],
170-
attrib_spec[attr].attr.name
171-
);
172-
}
173124
}
174125
}
175126

drivers/edac/edac_device.h

+3-19
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#ifndef _EDAC_DEVICE_H_
2323
#define _EDAC_DEVICE_H_
2424

25-
#include <linux/completion.h>
2625
#include <linux/device.h>
2726
#include <linux/edac.h>
2827
#include <linux/kobject.h>
@@ -95,22 +94,13 @@ struct edac_dev_sysfs_attribute {
9594
*
9695
* used in leaf 'block' nodes for adding controls/attributes
9796
*
98-
* each block in each instance of the containing control structure
99-
* can have an array of the following. The show and store functions
100-
* will be filled in with the show/store function in the
101-
* low level driver.
102-
*
103-
* The 'value' field will be the actual value field used for
104-
* counting
97+
* each block in each instance of the containing control structure can
98+
* have an array of the following. The show function will be filled in
99+
* with the show function in the low level driver.
105100
*/
106101
struct edac_dev_sysfs_block_attribute {
107102
struct attribute attr;
108103
ssize_t (*show)(struct kobject *, struct attribute *, char *);
109-
ssize_t (*store)(struct kobject *, struct attribute *,
110-
const char *, size_t);
111-
struct edac_device_block *block;
112-
113-
unsigned int value;
114104
};
115105

116106
/* device block control structure */
@@ -200,8 +190,6 @@ struct edac_device_ctl_info {
200190

201191
unsigned long start_time; /* edac_device load start time (jiffies) */
202192

203-
struct completion removal_complete;
204-
205193
/* sysfs top name under 'edac' directory
206194
* and instance name:
207195
* cpu/cpu0/...
@@ -217,7 +205,6 @@ struct edac_device_ctl_info {
217205
u32 nr_instances;
218206
struct edac_device_instance *instances;
219207
struct edac_device_block *blocks;
220-
struct edac_dev_sysfs_block_attribute *attribs;
221208

222209
/* Event counters for the this whole EDAC Device */
223210
struct edac_device_counter counters;
@@ -245,8 +232,6 @@ extern struct edac_device_ctl_info *edac_device_alloc_ctl_info(
245232
char *edac_device_name, unsigned nr_instances,
246233
char *edac_block_name, unsigned nr_blocks,
247234
unsigned offset_value,
248-
struct edac_dev_sysfs_block_attribute *block_attributes,
249-
unsigned nr_attribs,
250235
int device_index);
251236

252237
/* The offset value can be:
@@ -356,7 +341,6 @@ static inline void __edac_device_free_ctl_info(struct edac_device_ctl_info *ci)
356341
{
357342
if (ci) {
358343
kfree(ci->pvt_info);
359-
kfree(ci->attribs);
360344
kfree(ci->blocks);
361345
kfree(ci->instances);
362346
kfree(ci);

drivers/edac/edac_device_sysfs.c

+3-19
Original file line numberDiff line numberDiff line change
@@ -457,35 +457,19 @@ static ssize_t edac_dev_block_show(struct kobject *kobj,
457457
return -EIO;
458458
}
459459

460-
/* Function to 'store' fields into the edac_dev 'block' structure */
461-
static ssize_t edac_dev_block_store(struct kobject *kobj,
462-
struct attribute *attr,
463-
const char *buffer, size_t count)
464-
{
465-
struct edac_dev_sysfs_block_attribute *block_attr;
466-
467-
block_attr = to_block_attr(attr);
468-
469-
if (block_attr->store)
470-
return block_attr->store(kobj, attr, buffer, count);
471-
return -EIO;
472-
}
473-
474460
/* edac_dev file operations for a 'block' */
475461
static const struct sysfs_ops device_block_ops = {
476462
.show = edac_dev_block_show,
477-
.store = edac_dev_block_store
478463
};
479464

480-
#define BLOCK_ATTR(_name,_mode,_show,_store) \
465+
#define BLOCK_ATTR(_name,_mode,_show) \
481466
static struct edac_dev_sysfs_block_attribute attr_block_##_name = { \
482467
.attr = {.name = __stringify(_name), .mode = _mode }, \
483468
.show = _show, \
484-
.store = _store, \
485469
};
486470

487-
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show, NULL);
488-
BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show, NULL);
471+
BLOCK_ATTR(ce_count, S_IRUGO, block_ce_count_show);
472+
BLOCK_ATTR(ue_count, S_IRUGO, block_ue_count_show);
489473

490474
/* list of edac_dev 'block' attributes */
491475
static struct attribute *device_block_attrs[] = {

0 commit comments

Comments
 (0)