diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 14:35:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 14:35:16 -0400 |
commit | 16a832a21f4e2c8b089935429efa646b626b9e82 (patch) | |
tree | f7955bc42bab82330d230274210884dd78315f21 | |
parent | bafb0762cb6a906eb4105cccfb3bcd90be7f40d2 (diff) | |
parent | 398443471f1698003832972637d5508a0c0809e0 (diff) |
Merge tag 'edac_for_4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Pull EDAC updates from Borislav Petkov:
- pnd2_edac: A minimal sideband driver (Tony Luck)
- small-ish cleanups and fixes all over the place
* tag 'edac_for_4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
EDAC, mce_amd: Get rid of local var in amd_filter_mce()
EDAC, mce_amd: Get rid of most struct cpuinfo_x86 uses
EDAC, mce_amd: Rename decode_smca_errors() to decode_smca_error()
EDAC: Make device_type const
EDAC, pnd2: Properly toggle hidden state for P2SB PCI device
EDAC, pnd2: Conditionally unhide/hide the P2SB PCI device to read BAR
EDAC, pnd2: Mask off the lower four bits of a BAR
EDAC, thunderx: Fix error handling path in thunderx_lmc_probe()
EDAC, altera: Fix error handling path in altr_edac_device_probe()
EDAC, pnd2: Build in a minimal sideband driver for Apollo Lake
EDAC, sb_edac: Classify memory mirroring modes
EDAC, cpc925, ppc4xx: Convert to using %pOF instead of full_name
EDAC: Get rid of mci->mod_ver
EDAC: Constify attribute_group structures
EDAC, mce_amd: Use cpu_to_node() to find the node ID
33 files changed, 161 insertions, 136 deletions
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index db75d4b614f7..346c4987b284 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include "edac_module.h" | 38 | #include "edac_module.h" |
39 | 39 | ||
40 | #define EDAC_MOD_STR "altera_edac" | 40 | #define EDAC_MOD_STR "altera_edac" |
41 | #define EDAC_VERSION "1" | ||
42 | #define EDAC_DEVICE "Altera" | 41 | #define EDAC_DEVICE "Altera" |
43 | 42 | ||
44 | static const struct altr_sdram_prv_data c5_data = { | 43 | static const struct altr_sdram_prv_data c5_data = { |
@@ -392,7 +391,6 @@ static int altr_sdram_probe(struct platform_device *pdev) | |||
392 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; | 391 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; |
393 | mci->edac_cap = EDAC_FLAG_SECDED; | 392 | mci->edac_cap = EDAC_FLAG_SECDED; |
394 | mci->mod_name = EDAC_MOD_STR; | 393 | mci->mod_name = EDAC_MOD_STR; |
395 | mci->mod_ver = EDAC_VERSION; | ||
396 | mci->ctl_name = dev_name(&pdev->dev); | 394 | mci->ctl_name = dev_name(&pdev->dev); |
397 | mci->scrub_mode = SCRUB_SW_SRC; | 395 | mci->scrub_mode = SCRUB_SW_SRC; |
398 | mci->dev_name = dev_name(&pdev->dev); | 396 | mci->dev_name = dev_name(&pdev->dev); |
@@ -749,8 +747,10 @@ static int altr_edac_device_probe(struct platform_device *pdev) | |||
749 | drvdata->edac_dev_name = ecc_name; | 747 | drvdata->edac_dev_name = ecc_name; |
750 | 748 | ||
751 | drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); | 749 | drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); |
752 | if (!drvdata->base) | 750 | if (!drvdata->base) { |
751 | res = -ENOMEM; | ||
753 | goto fail1; | 752 | goto fail1; |
753 | } | ||
754 | 754 | ||
755 | /* Get driver specific data for this EDAC device */ | 755 | /* Get driver specific data for this EDAC device */ |
756 | drvdata->data = of_match_node(altr_edac_device_of_match, np)->data; | 756 | drvdata->data = of_match_node(altr_edac_device_of_match, np)->data; |
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 3aea55698165..ac2f30295efe 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -3130,7 +3130,6 @@ static void setup_mci_misc_attrs(struct mem_ctl_info *mci, | |||
3130 | 3130 | ||
3131 | mci->edac_cap = determine_edac_cap(pvt); | 3131 | mci->edac_cap = determine_edac_cap(pvt); |
3132 | mci->mod_name = EDAC_MOD_STR; | 3132 | mci->mod_name = EDAC_MOD_STR; |
3133 | mci->mod_ver = EDAC_AMD64_VERSION; | ||
3134 | mci->ctl_name = fam->ctl_name; | 3133 | mci->ctl_name = fam->ctl_name; |
3135 | mci->dev_name = pci_name(pvt->F3); | 3134 | mci->dev_name = pci_name(pvt->F3); |
3136 | mci->ctl_page_to_phys = NULL; | 3135 | mci->ctl_page_to_phys = NULL; |
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c index a7450275ad28..9c6e326b4c14 100644 --- a/drivers/edac/amd76x_edac.c +++ b/drivers/edac/amd76x_edac.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/edac.h> | 19 | #include <linux/edac.h> |
20 | #include "edac_module.h" | 20 | #include "edac_module.h" |
21 | 21 | ||
22 | #define AMD76X_REVISION " Ver: 2.0.2" | ||
23 | #define EDAC_MOD_STR "amd76x_edac" | 22 | #define EDAC_MOD_STR "amd76x_edac" |
24 | 23 | ||
25 | #define amd76x_printk(level, fmt, arg...) \ | 24 | #define amd76x_printk(level, fmt, arg...) \ |
@@ -263,7 +262,6 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) | |||
263 | mci->edac_cap = ems_mode ? | 262 | mci->edac_cap = ems_mode ? |
264 | (EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE; | 263 | (EDAC_FLAG_EC | EDAC_FLAG_SECDED) : EDAC_FLAG_NONE; |
265 | mci->mod_name = EDAC_MOD_STR; | 264 | mci->mod_name = EDAC_MOD_STR; |
266 | mci->mod_ver = AMD76X_REVISION; | ||
267 | mci->ctl_name = amd76x_devs[dev_idx].ctl_name; | 265 | mci->ctl_name = amd76x_devs[dev_idx].ctl_name; |
268 | mci->dev_name = pci_name(pdev); | 266 | mci->dev_name = pci_name(pdev); |
269 | mci->edac_check = amd76x_check; | 267 | mci->edac_check = amd76x_check; |
diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c index 837b62c4993d..2c98e020df05 100644 --- a/drivers/edac/cpc925_edac.c +++ b/drivers/edac/cpc925_edac.c | |||
@@ -618,7 +618,7 @@ static u32 cpc925_cpu_mask_disabled(void) | |||
618 | } | 618 | } |
619 | 619 | ||
620 | if (reg == NULL || *reg > 2) { | 620 | if (reg == NULL || *reg > 2) { |
621 | cpc925_printk(KERN_ERR, "Bad reg value at %s\n", cpunode->full_name); | 621 | cpc925_printk(KERN_ERR, "Bad reg value at %pOF\n", cpunode); |
622 | continue; | 622 | continue; |
623 | } | 623 | } |
624 | 624 | ||
@@ -999,7 +999,6 @@ static int cpc925_probe(struct platform_device *pdev) | |||
999 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; | 999 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; |
1000 | mci->edac_cap = EDAC_FLAG_SECDED; | 1000 | mci->edac_cap = EDAC_FLAG_SECDED; |
1001 | mci->mod_name = CPC925_EDAC_MOD_STR; | 1001 | mci->mod_name = CPC925_EDAC_MOD_STR; |
1002 | mci->mod_ver = CPC925_EDAC_REVISION; | ||
1003 | mci->ctl_name = pdev->name; | 1002 | mci->ctl_name = pdev->name; |
1004 | 1003 | ||
1005 | if (edac_op_state == EDAC_OPSTATE_POLL) | 1004 | if (edac_op_state == EDAC_OPSTATE_POLL) |
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index 1a352cae1f52..b5de9a13ea3f 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/edac.h> | 26 | #include <linux/edac.h> |
27 | #include "edac_module.h" | 27 | #include "edac_module.h" |
28 | 28 | ||
29 | #define E752X_REVISION " Ver: 2.0.2" | ||
30 | #define EDAC_MOD_STR "e752x_edac" | 29 | #define EDAC_MOD_STR "e752x_edac" |
31 | 30 | ||
32 | static int report_non_memory_errors; | 31 | static int report_non_memory_errors; |
@@ -1303,7 +1302,6 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
1303 | (EDAC_FLAG_NONE | EDAC_FLAG_SECDED | EDAC_FLAG_S4ECD4ED); | 1302 | (EDAC_FLAG_NONE | EDAC_FLAG_SECDED | EDAC_FLAG_S4ECD4ED); |
1304 | /* FIXME - what if different memory types are in different csrows? */ | 1303 | /* FIXME - what if different memory types are in different csrows? */ |
1305 | mci->mod_name = EDAC_MOD_STR; | 1304 | mci->mod_name = EDAC_MOD_STR; |
1306 | mci->mod_ver = E752X_REVISION; | ||
1307 | mci->pdev = &pdev->dev; | 1305 | mci->pdev = &pdev->dev; |
1308 | 1306 | ||
1309 | edac_dbg(3, "init pvt\n"); | 1307 | edac_dbg(3, "init pvt\n"); |
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c index 67ef07aed923..75d7ce62b3be 100644 --- a/drivers/edac/e7xxx_edac.c +++ b/drivers/edac/e7xxx_edac.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/edac.h> | 32 | #include <linux/edac.h> |
33 | #include "edac_module.h" | 33 | #include "edac_module.h" |
34 | 34 | ||
35 | #define E7XXX_REVISION " Ver: 2.0.2" | ||
36 | #define EDAC_MOD_STR "e7xxx_edac" | 35 | #define EDAC_MOD_STR "e7xxx_edac" |
37 | 36 | ||
38 | #define e7xxx_printk(level, fmt, arg...) \ | 37 | #define e7xxx_printk(level, fmt, arg...) \ |
@@ -458,7 +457,6 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx) | |||
458 | EDAC_FLAG_S4ECD4ED; | 457 | EDAC_FLAG_S4ECD4ED; |
459 | /* FIXME - what if different memory types are in different csrows? */ | 458 | /* FIXME - what if different memory types are in different csrows? */ |
460 | mci->mod_name = EDAC_MOD_STR; | 459 | mci->mod_name = EDAC_MOD_STR; |
461 | mci->mod_ver = E7XXX_REVISION; | ||
462 | mci->pdev = &pdev->dev; | 460 | mci->pdev = &pdev->dev; |
463 | edac_dbg(3, "init pvt\n"); | 461 | edac_dbg(3, "init pvt\n"); |
464 | pvt = (struct e7xxx_pvt *)mci->pvt_info; | 462 | pvt = (struct e7xxx_pvt *)mci->pvt_info; |
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 445862dac273..e4fcfa84fbd3 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -287,7 +287,7 @@ static struct attribute *csrow_attrs[] = { | |||
287 | NULL, | 287 | NULL, |
288 | }; | 288 | }; |
289 | 289 | ||
290 | static struct attribute_group csrow_attr_grp = { | 290 | static const struct attribute_group csrow_attr_grp = { |
291 | .attrs = csrow_attrs, | 291 | .attrs = csrow_attrs, |
292 | }; | 292 | }; |
293 | 293 | ||
@@ -304,7 +304,7 @@ static void csrow_attr_release(struct device *dev) | |||
304 | kfree(csrow); | 304 | kfree(csrow); |
305 | } | 305 | } |
306 | 306 | ||
307 | static struct device_type csrow_attr_type = { | 307 | static const struct device_type csrow_attr_type = { |
308 | .groups = csrow_attr_groups, | 308 | .groups = csrow_attr_groups, |
309 | .release = csrow_attr_release, | 309 | .release = csrow_attr_release, |
310 | }; | 310 | }; |
@@ -627,7 +627,7 @@ static struct attribute *dimm_attrs[] = { | |||
627 | NULL, | 627 | NULL, |
628 | }; | 628 | }; |
629 | 629 | ||
630 | static struct attribute_group dimm_attr_grp = { | 630 | static const struct attribute_group dimm_attr_grp = { |
631 | .attrs = dimm_attrs, | 631 | .attrs = dimm_attrs, |
632 | }; | 632 | }; |
633 | 633 | ||
@@ -644,7 +644,7 @@ static void dimm_attr_release(struct device *dev) | |||
644 | kfree(dimm); | 644 | kfree(dimm); |
645 | } | 645 | } |
646 | 646 | ||
647 | static struct device_type dimm_attr_type = { | 647 | static const struct device_type dimm_attr_type = { |
648 | .groups = dimm_attr_groups, | 648 | .groups = dimm_attr_groups, |
649 | .release = dimm_attr_release, | 649 | .release = dimm_attr_release, |
650 | }; | 650 | }; |
@@ -902,7 +902,7 @@ static umode_t mci_attr_is_visible(struct kobject *kobj, | |||
902 | return mode; | 902 | return mode; |
903 | } | 903 | } |
904 | 904 | ||
905 | static struct attribute_group mci_attr_grp = { | 905 | static const struct attribute_group mci_attr_grp = { |
906 | .attrs = mci_attrs, | 906 | .attrs = mci_attrs, |
907 | .is_visible = mci_attr_is_visible, | 907 | .is_visible = mci_attr_is_visible, |
908 | }; | 908 | }; |
@@ -920,7 +920,7 @@ static void mci_attr_release(struct device *dev) | |||
920 | kfree(mci); | 920 | kfree(mci); |
921 | } | 921 | } |
922 | 922 | ||
923 | static struct device_type mci_attr_type = { | 923 | static const struct device_type mci_attr_type = { |
924 | .groups = mci_attr_groups, | 924 | .groups = mci_attr_groups, |
925 | .release = mci_attr_release, | 925 | .release = mci_attr_release, |
926 | }; | 926 | }; |
@@ -1074,7 +1074,7 @@ static void mc_attr_release(struct device *dev) | |||
1074 | kfree(dev); | 1074 | kfree(dev); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | static struct device_type mc_attr_type = { | 1077 | static const struct device_type mc_attr_type = { |
1078 | .release = mc_attr_release, | 1078 | .release = mc_attr_release, |
1079 | }; | 1079 | }; |
1080 | /* | 1080 | /* |
diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index 4e61a6229dd2..6f80eb65c26c 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c | |||
@@ -17,8 +17,6 @@ | |||
17 | #include "edac_module.h" | 17 | #include "edac_module.h" |
18 | #include <ras/ras_event.h> | 18 | #include <ras/ras_event.h> |
19 | 19 | ||
20 | #define GHES_EDAC_REVISION " Ver: 1.0.0" | ||
21 | |||
22 | struct ghes_edac_pvt { | 20 | struct ghes_edac_pvt { |
23 | struct list_head list; | 21 | struct list_head list; |
24 | struct ghes *ghes; | 22 | struct ghes *ghes; |
@@ -451,7 +449,6 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev) | |||
451 | mci->edac_ctl_cap = EDAC_FLAG_NONE; | 449 | mci->edac_ctl_cap = EDAC_FLAG_NONE; |
452 | mci->edac_cap = EDAC_FLAG_NONE; | 450 | mci->edac_cap = EDAC_FLAG_NONE; |
453 | mci->mod_name = "ghes_edac.c"; | 451 | mci->mod_name = "ghes_edac.c"; |
454 | mci->mod_ver = GHES_EDAC_REVISION; | ||
455 | mci->ctl_name = "ghes_edac"; | 452 | mci->ctl_name = "ghes_edac"; |
456 | mci->dev_name = "ghes"; | 453 | mci->dev_name = "ghes"; |
457 | 454 | ||
diff --git a/drivers/edac/highbank_mc_edac.c b/drivers/edac/highbank_mc_edac.c index 0e7e0a404d89..6092e61be605 100644 --- a/drivers/edac/highbank_mc_edac.c +++ b/drivers/edac/highbank_mc_edac.c | |||
@@ -224,7 +224,6 @@ static int highbank_mc_probe(struct platform_device *pdev) | |||
224 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; | 224 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; |
225 | mci->edac_cap = EDAC_FLAG_SECDED; | 225 | mci->edac_cap = EDAC_FLAG_SECDED; |
226 | mci->mod_name = pdev->dev.driver->name; | 226 | mci->mod_name = pdev->dev.driver->name; |
227 | mci->mod_ver = "1"; | ||
228 | mci->ctl_name = id->compatible; | 227 | mci->ctl_name = id->compatible; |
229 | mci->dev_name = dev_name(&pdev->dev); | 228 | mci->dev_name = dev_name(&pdev->dev); |
230 | mci->scrub_mode = SCRUB_SW_SRC; | 229 | mci->scrub_mode = SCRUB_SW_SRC; |
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c index 5306240570d7..8085a32ec3bd 100644 --- a/drivers/edac/i3000_edac.c +++ b/drivers/edac/i3000_edac.c | |||
@@ -16,8 +16,6 @@ | |||
16 | #include <linux/edac.h> | 16 | #include <linux/edac.h> |
17 | #include "edac_module.h" | 17 | #include "edac_module.h" |
18 | 18 | ||
19 | #define I3000_REVISION "1.1" | ||
20 | |||
21 | #define EDAC_MOD_STR "i3000_edac" | 19 | #define EDAC_MOD_STR "i3000_edac" |
22 | 20 | ||
23 | #define I3000_RANKS 8 | 21 | #define I3000_RANKS 8 |
@@ -375,7 +373,6 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx) | |||
375 | mci->edac_cap = EDAC_FLAG_SECDED; | 373 | mci->edac_cap = EDAC_FLAG_SECDED; |
376 | 374 | ||
377 | mci->mod_name = EDAC_MOD_STR; | 375 | mci->mod_name = EDAC_MOD_STR; |
378 | mci->mod_ver = I3000_REVISION; | ||
379 | mci->ctl_name = i3000_devs[dev_idx].ctl_name; | 376 | mci->ctl_name = i3000_devs[dev_idx].ctl_name; |
380 | mci->dev_name = pci_name(pdev); | 377 | mci->dev_name = pci_name(pdev); |
381 | mci->edac_check = i3000_check; | 378 | mci->edac_check = i3000_check; |
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c index 77c58d201a30..d92d56cee101 100644 --- a/drivers/edac/i3200_edac.c +++ b/drivers/edac/i3200_edac.c | |||
@@ -17,8 +17,6 @@ | |||
17 | 17 | ||
18 | #include <linux/io-64-nonatomic-lo-hi.h> | 18 | #include <linux/io-64-nonatomic-lo-hi.h> |
19 | 19 | ||
20 | #define I3200_REVISION "1.1" | ||
21 | |||
22 | #define EDAC_MOD_STR "i3200_edac" | 20 | #define EDAC_MOD_STR "i3200_edac" |
23 | 21 | ||
24 | #define PCI_DEVICE_ID_INTEL_3200_HB 0x29f0 | 22 | #define PCI_DEVICE_ID_INTEL_3200_HB 0x29f0 |
@@ -375,7 +373,6 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx) | |||
375 | mci->edac_cap = EDAC_FLAG_SECDED; | 373 | mci->edac_cap = EDAC_FLAG_SECDED; |
376 | 374 | ||
377 | mci->mod_name = EDAC_MOD_STR; | 375 | mci->mod_name = EDAC_MOD_STR; |
378 | mci->mod_ver = I3200_REVISION; | ||
379 | mci->ctl_name = i3200_devs[dev_idx].ctl_name; | 376 | mci->ctl_name = i3200_devs[dev_idx].ctl_name; |
380 | mci->dev_name = pci_name(pdev); | 377 | mci->dev_name = pci_name(pdev); |
381 | mci->edac_check = i3200_check; | 378 | mci->edac_check = i3200_check; |
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c index 8f5a56e25bd2..53f24b18cd61 100644 --- a/drivers/edac/i5000_edac.c +++ b/drivers/edac/i5000_edac.c | |||
@@ -1430,7 +1430,6 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx) | |||
1430 | mci->edac_ctl_cap = EDAC_FLAG_NONE; | 1430 | mci->edac_ctl_cap = EDAC_FLAG_NONE; |
1431 | mci->edac_cap = EDAC_FLAG_NONE; | 1431 | mci->edac_cap = EDAC_FLAG_NONE; |
1432 | mci->mod_name = "i5000_edac.c"; | 1432 | mci->mod_name = "i5000_edac.c"; |
1433 | mci->mod_ver = I5000_REVISION; | ||
1434 | mci->ctl_name = i5000_devs[dev_idx].ctl_name; | 1433 | mci->ctl_name = i5000_devs[dev_idx].ctl_name; |
1435 | mci->dev_name = pci_name(pdev); | 1434 | mci->dev_name = pci_name(pdev); |
1436 | mci->ctl_page_to_phys = NULL; | 1435 | mci->ctl_page_to_phys = NULL; |
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c index a8334c4acea7..b506eef6b146 100644 --- a/drivers/edac/i5100_edac.c +++ b/drivers/edac/i5100_edac.c | |||
@@ -1108,7 +1108,6 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1108 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; | 1108 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; |
1109 | mci->edac_cap = EDAC_FLAG_SECDED; | 1109 | mci->edac_cap = EDAC_FLAG_SECDED; |
1110 | mci->mod_name = "i5100_edac.c"; | 1110 | mci->mod_name = "i5100_edac.c"; |
1111 | mci->mod_ver = "not versioned"; | ||
1112 | mci->ctl_name = "i5100"; | 1111 | mci->ctl_name = "i5100"; |
1113 | mci->dev_name = pci_name(pdev); | 1112 | mci->dev_name = pci_name(pdev); |
1114 | mci->ctl_page_to_phys = NULL; | 1113 | mci->ctl_page_to_phys = NULL; |
diff --git a/drivers/edac/i5400_edac.c b/drivers/edac/i5400_edac.c index cd889edc8516..6f8bcdb9256a 100644 --- a/drivers/edac/i5400_edac.c +++ b/drivers/edac/i5400_edac.c | |||
@@ -1315,7 +1315,6 @@ static int i5400_probe1(struct pci_dev *pdev, int dev_idx) | |||
1315 | mci->edac_ctl_cap = EDAC_FLAG_NONE; | 1315 | mci->edac_ctl_cap = EDAC_FLAG_NONE; |
1316 | mci->edac_cap = EDAC_FLAG_NONE; | 1316 | mci->edac_cap = EDAC_FLAG_NONE; |
1317 | mci->mod_name = "i5400_edac.c"; | 1317 | mci->mod_name = "i5400_edac.c"; |
1318 | mci->mod_ver = I5400_REVISION; | ||
1319 | mci->ctl_name = i5400_devs[dev_idx].ctl_name; | 1318 | mci->ctl_name = i5400_devs[dev_idx].ctl_name; |
1320 | mci->dev_name = pci_name(pdev); | 1319 | mci->dev_name = pci_name(pdev); |
1321 | mci->ctl_page_to_phys = NULL; | 1320 | mci->ctl_page_to_phys = NULL; |
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c index e391f5a716be..6b5a554ba8e4 100644 --- a/drivers/edac/i7300_edac.c +++ b/drivers/edac/i7300_edac.c | |||
@@ -1077,7 +1077,6 @@ static int i7300_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1077 | mci->edac_ctl_cap = EDAC_FLAG_NONE; | 1077 | mci->edac_ctl_cap = EDAC_FLAG_NONE; |
1078 | mci->edac_cap = EDAC_FLAG_NONE; | 1078 | mci->edac_cap = EDAC_FLAG_NONE; |
1079 | mci->mod_name = "i7300_edac.c"; | 1079 | mci->mod_name = "i7300_edac.c"; |
1080 | mci->mod_ver = I7300_REVISION; | ||
1081 | mci->ctl_name = i7300_devs[0].ctl_name; | 1080 | mci->ctl_name = i7300_devs[0].ctl_name; |
1082 | mci->dev_name = pci_name(pdev); | 1081 | mci->dev_name = pci_name(pdev); |
1083 | mci->ctl_page_to_phys = NULL; | 1082 | mci->ctl_page_to_phys = NULL; |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 75ad847593b7..c16c3b931b3d 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1079,7 +1079,7 @@ static struct attribute *i7core_addrmatch_attrs[] = { | |||
1079 | NULL | 1079 | NULL |
1080 | }; | 1080 | }; |
1081 | 1081 | ||
1082 | static struct attribute_group addrmatch_grp = { | 1082 | static const struct attribute_group addrmatch_grp = { |
1083 | .attrs = i7core_addrmatch_attrs, | 1083 | .attrs = i7core_addrmatch_attrs, |
1084 | }; | 1084 | }; |
1085 | 1085 | ||
@@ -1094,7 +1094,7 @@ static void addrmatch_release(struct device *device) | |||
1094 | kfree(device); | 1094 | kfree(device); |
1095 | } | 1095 | } |
1096 | 1096 | ||
1097 | static struct device_type addrmatch_type = { | 1097 | static const struct device_type addrmatch_type = { |
1098 | .groups = addrmatch_groups, | 1098 | .groups = addrmatch_groups, |
1099 | .release = addrmatch_release, | 1099 | .release = addrmatch_release, |
1100 | }; | 1100 | }; |
@@ -1110,7 +1110,7 @@ static struct attribute *i7core_udimm_counters_attrs[] = { | |||
1110 | NULL | 1110 | NULL |
1111 | }; | 1111 | }; |
1112 | 1112 | ||
1113 | static struct attribute_group all_channel_counts_grp = { | 1113 | static const struct attribute_group all_channel_counts_grp = { |
1114 | .attrs = i7core_udimm_counters_attrs, | 1114 | .attrs = i7core_udimm_counters_attrs, |
1115 | }; | 1115 | }; |
1116 | 1116 | ||
@@ -1125,7 +1125,7 @@ static void all_channel_counts_release(struct device *device) | |||
1125 | kfree(device); | 1125 | kfree(device); |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | static struct device_type all_channel_counts_type = { | 1128 | static const struct device_type all_channel_counts_type = { |
1129 | .groups = all_channel_counts_groups, | 1129 | .groups = all_channel_counts_groups, |
1130 | .release = all_channel_counts_release, | 1130 | .release = all_channel_counts_release, |
1131 | }; | 1131 | }; |
@@ -2159,7 +2159,6 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev) | |||
2159 | mci->edac_ctl_cap = EDAC_FLAG_NONE; | 2159 | mci->edac_ctl_cap = EDAC_FLAG_NONE; |
2160 | mci->edac_cap = EDAC_FLAG_NONE; | 2160 | mci->edac_cap = EDAC_FLAG_NONE; |
2161 | mci->mod_name = "i7core_edac.c"; | 2161 | mci->mod_name = "i7core_edac.c"; |
2162 | mci->mod_ver = I7CORE_REVISION; | ||
2163 | mci->ctl_name = kasprintf(GFP_KERNEL, "i7 core #%d", | 2162 | mci->ctl_name = kasprintf(GFP_KERNEL, "i7 core #%d", |
2164 | i7core_dev->socket); | 2163 | i7core_dev->socket); |
2165 | mci->dev_name = pci_name(i7core_dev->pdev[0]); | 2164 | mci->dev_name = pci_name(i7core_dev->pdev[0]); |
diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c index cb61a5b7d080..a2ca929e2168 100644 --- a/drivers/edac/i82443bxgx_edac.c +++ b/drivers/edac/i82443bxgx_edac.c | |||
@@ -31,8 +31,6 @@ | |||
31 | #include <linux/edac.h> | 31 | #include <linux/edac.h> |
32 | #include "edac_module.h" | 32 | #include "edac_module.h" |
33 | 33 | ||
34 | #define I82443_REVISION "0.1" | ||
35 | |||
36 | #define EDAC_MOD_STR "i82443bxgx_edac" | 34 | #define EDAC_MOD_STR "i82443bxgx_edac" |
37 | 35 | ||
38 | /* The 82443BX supports SDRAM, or EDO (EDO for mobile only), "Memory | 36 | /* The 82443BX supports SDRAM, or EDO (EDO for mobile only), "Memory |
@@ -320,7 +318,6 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx) | |||
320 | I82443BXGX_EAP_OFFSET_MBE)); | 318 | I82443BXGX_EAP_OFFSET_MBE)); |
321 | 319 | ||
322 | mci->mod_name = EDAC_MOD_STR; | 320 | mci->mod_name = EDAC_MOD_STR; |
323 | mci->mod_ver = I82443_REVISION; | ||
324 | mci->ctl_name = "I82443BXGX"; | 321 | mci->ctl_name = "I82443BXGX"; |
325 | mci->dev_name = pci_name(pdev); | 322 | mci->dev_name = pci_name(pdev); |
326 | mci->edac_check = i82443bxgx_edacmc_check; | 323 | mci->edac_check = i82443bxgx_edacmc_check; |
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c index 236c813227fc..3e3a80ffb322 100644 --- a/drivers/edac/i82860_edac.c +++ b/drivers/edac/i82860_edac.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/edac.h> | 16 | #include <linux/edac.h> |
17 | #include "edac_module.h" | 17 | #include "edac_module.h" |
18 | 18 | ||
19 | #define I82860_REVISION " Ver: 2.0.2" | ||
20 | #define EDAC_MOD_STR "i82860_edac" | 19 | #define EDAC_MOD_STR "i82860_edac" |
21 | 20 | ||
22 | #define i82860_printk(level, fmt, arg...) \ | 21 | #define i82860_printk(level, fmt, arg...) \ |
@@ -216,7 +215,6 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx) | |||
216 | /* I"m not sure about this but I think that all RDRAM is SECDED */ | 215 | /* I"m not sure about this but I think that all RDRAM is SECDED */ |
217 | mci->edac_cap = EDAC_FLAG_SECDED; | 216 | mci->edac_cap = EDAC_FLAG_SECDED; |
218 | mci->mod_name = EDAC_MOD_STR; | 217 | mci->mod_name = EDAC_MOD_STR; |
219 | mci->mod_ver = I82860_REVISION; | ||
220 | mci->ctl_name = i82860_devs[dev_idx].ctl_name; | 218 | mci->ctl_name = i82860_devs[dev_idx].ctl_name; |
221 | mci->dev_name = pci_name(pdev); | 219 | mci->dev_name = pci_name(pdev); |
222 | mci->edac_check = i82860_check; | 220 | mci->edac_check = i82860_check; |
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c index e286b7e74c7a..ceac925af38c 100644 --- a/drivers/edac/i82875p_edac.c +++ b/drivers/edac/i82875p_edac.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/edac.h> | 20 | #include <linux/edac.h> |
21 | #include "edac_module.h" | 21 | #include "edac_module.h" |
22 | 22 | ||
23 | #define I82875P_REVISION " Ver: 2.0.2" | ||
24 | #define EDAC_MOD_STR "i82875p_edac" | 23 | #define EDAC_MOD_STR "i82875p_edac" |
25 | 24 | ||
26 | #define i82875p_printk(level, fmt, arg...) \ | 25 | #define i82875p_printk(level, fmt, arg...) \ |
@@ -423,7 +422,6 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx) | |||
423 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; | 422 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; |
424 | mci->edac_cap = EDAC_FLAG_UNKNOWN; | 423 | mci->edac_cap = EDAC_FLAG_UNKNOWN; |
425 | mci->mod_name = EDAC_MOD_STR; | 424 | mci->mod_name = EDAC_MOD_STR; |
426 | mci->mod_ver = I82875P_REVISION; | ||
427 | mci->ctl_name = i82875p_devs[dev_idx].ctl_name; | 425 | mci->ctl_name = i82875p_devs[dev_idx].ctl_name; |
428 | mci->dev_name = pci_name(pdev); | 426 | mci->dev_name = pci_name(pdev); |
429 | mci->edac_check = i82875p_check; | 427 | mci->edac_check = i82875p_check; |
diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c index 9dcdab28f665..892815eaa97b 100644 --- a/drivers/edac/i82975x_edac.c +++ b/drivers/edac/i82975x_edac.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/edac.h> | 16 | #include <linux/edac.h> |
17 | #include "edac_module.h" | 17 | #include "edac_module.h" |
18 | 18 | ||
19 | #define I82975X_REVISION " Ver: 1.0.0" | ||
20 | #define EDAC_MOD_STR "i82975x_edac" | 19 | #define EDAC_MOD_STR "i82975x_edac" |
21 | 20 | ||
22 | #define i82975x_printk(level, fmt, arg...) \ | 21 | #define i82975x_printk(level, fmt, arg...) \ |
@@ -564,7 +563,6 @@ static int i82975x_probe1(struct pci_dev *pdev, int dev_idx) | |||
564 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; | 563 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; |
565 | mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; | 564 | mci->edac_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; |
566 | mci->mod_name = EDAC_MOD_STR; | 565 | mci->mod_name = EDAC_MOD_STR; |
567 | mci->mod_ver = I82975X_REVISION; | ||
568 | mci->ctl_name = i82975x_devs[dev_idx].ctl_name; | 566 | mci->ctl_name = i82975x_devs[dev_idx].ctl_name; |
569 | mci->dev_name = pci_name(pdev); | 567 | mci->dev_name = pci_name(pdev); |
570 | mci->edac_check = i82975x_check; | 568 | mci->edac_check = i82975x_check; |
diff --git a/drivers/edac/ie31200_edac.c b/drivers/edac/ie31200_edac.c index 4260579e6901..aac9b9b360b8 100644 --- a/drivers/edac/ie31200_edac.c +++ b/drivers/edac/ie31200_edac.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <linux/io-64-nonatomic-lo-hi.h> | 45 | #include <linux/io-64-nonatomic-lo-hi.h> |
46 | #include "edac_module.h" | 46 | #include "edac_module.h" |
47 | 47 | ||
48 | #define IE31200_REVISION "1.0" | ||
49 | #define EDAC_MOD_STR "ie31200_edac" | 48 | #define EDAC_MOD_STR "ie31200_edac" |
50 | 49 | ||
51 | #define ie31200_printk(level, fmt, arg...) \ | 50 | #define ie31200_printk(level, fmt, arg...) \ |
@@ -420,7 +419,6 @@ static int ie31200_probe1(struct pci_dev *pdev, int dev_idx) | |||
420 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; | 419 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; |
421 | mci->edac_cap = EDAC_FLAG_SECDED; | 420 | mci->edac_cap = EDAC_FLAG_SECDED; |
422 | mci->mod_name = EDAC_MOD_STR; | 421 | mci->mod_name = EDAC_MOD_STR; |
423 | mci->mod_ver = IE31200_REVISION; | ||
424 | mci->ctl_name = ie31200_devs[dev_idx].ctl_name; | 422 | mci->ctl_name = ie31200_devs[dev_idx].ctl_name; |
425 | mci->dev_name = pci_name(pdev); | 423 | mci->dev_name = pci_name(pdev); |
426 | mci->edac_check = ie31200_check; | 424 | mci->edac_check = ie31200_check; |
diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index 9a2658a256a9..a11a671c7a38 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c | |||
@@ -1,6 +1,8 @@ | |||
1 | #include <linux/module.h> | 1 | #include <linux/module.h> |
2 | #include <linux/slab.h> | 2 | #include <linux/slab.h> |
3 | 3 | ||
4 | #include <asm/cpu.h> | ||
5 | |||
4 | #include "mce_amd.h" | 6 | #include "mce_amd.h" |
5 | 7 | ||
6 | static struct amd_decoder_ops *fam_ops; | 8 | static struct amd_decoder_ops *fam_ops; |
@@ -744,7 +746,7 @@ static void decode_mc3_mce(struct mce *m) | |||
744 | 746 | ||
745 | static void decode_mc4_mce(struct mce *m) | 747 | static void decode_mc4_mce(struct mce *m) |
746 | { | 748 | { |
747 | struct cpuinfo_x86 *c = &boot_cpu_data; | 749 | unsigned int fam = x86_family(m->cpuid); |
748 | int node_id = amd_get_nb_id(m->extcpu); | 750 | int node_id = amd_get_nb_id(m->extcpu); |
749 | u16 ec = EC(m->status); | 751 | u16 ec = EC(m->status); |
750 | u8 xec = XEC(m->status, 0x1f); | 752 | u8 xec = XEC(m->status, 0x1f); |
@@ -758,7 +760,7 @@ static void decode_mc4_mce(struct mce *m) | |||
758 | /* special handling for DRAM ECCs */ | 760 | /* special handling for DRAM ECCs */ |
759 | if (xec == 0x0 || xec == 0x8) { | 761 | if (xec == 0x0 || xec == 0x8) { |
760 | /* no ECCs on F11h */ | 762 | /* no ECCs on F11h */ |
761 | if (c->x86 == 0x11) | 763 | if (fam == 0x11) |
762 | goto wrong_mc4_mce; | 764 | goto wrong_mc4_mce; |
763 | 765 | ||
764 | pr_cont("%s.\n", mc4_mce_desc[xec]); | 766 | pr_cont("%s.\n", mc4_mce_desc[xec]); |
@@ -779,7 +781,7 @@ static void decode_mc4_mce(struct mce *m) | |||
779 | return; | 781 | return; |
780 | 782 | ||
781 | case 0x19: | 783 | case 0x19: |
782 | if (boot_cpu_data.x86 == 0x15 || boot_cpu_data.x86 == 0x16) | 784 | if (fam == 0x15 || fam == 0x16) |
783 | pr_cont("Compute Unit Data Error.\n"); | 785 | pr_cont("Compute Unit Data Error.\n"); |
784 | else | 786 | else |
785 | goto wrong_mc4_mce; | 787 | goto wrong_mc4_mce; |
@@ -802,11 +804,11 @@ static void decode_mc4_mce(struct mce *m) | |||
802 | 804 | ||
803 | static void decode_mc5_mce(struct mce *m) | 805 | static void decode_mc5_mce(struct mce *m) |
804 | { | 806 | { |
805 | struct cpuinfo_x86 *c = &boot_cpu_data; | 807 | unsigned int fam = x86_family(m->cpuid); |
806 | u16 ec = EC(m->status); | 808 | u16 ec = EC(m->status); |
807 | u8 xec = XEC(m->status, xec_mask); | 809 | u8 xec = XEC(m->status, xec_mask); |
808 | 810 | ||
809 | if (c->x86 == 0xf || c->x86 == 0x11) | 811 | if (fam == 0xf || fam == 0x11) |
810 | goto wrong_mc5_mce; | 812 | goto wrong_mc5_mce; |
811 | 813 | ||
812 | pr_emerg(HW_ERR "MC5 Error: "); | 814 | pr_emerg(HW_ERR "MC5 Error: "); |
@@ -849,7 +851,7 @@ static void decode_mc6_mce(struct mce *m) | |||
849 | } | 851 | } |
850 | 852 | ||
851 | /* Decode errors according to Scalable MCA specification */ | 853 | /* Decode errors according to Scalable MCA specification */ |
852 | static void decode_smca_errors(struct mce *m) | 854 | static void decode_smca_error(struct mce *m) |
853 | { | 855 | { |
854 | struct smca_hwid *hwid; | 856 | struct smca_hwid *hwid; |
855 | unsigned int bank_type; | 857 | unsigned int bank_type; |
@@ -859,7 +861,7 @@ static void decode_smca_errors(struct mce *m) | |||
859 | if (m->bank >= ARRAY_SIZE(smca_banks)) | 861 | if (m->bank >= ARRAY_SIZE(smca_banks)) |
860 | return; | 862 | return; |
861 | 863 | ||
862 | if (boot_cpu_data.x86 >= 0x17 && m->bank == 4) | 864 | if (x86_family(m->cpuid) >= 0x17 && m->bank == 4) |
863 | pr_emerg(HW_ERR "Bank 4 is reserved on Fam17h.\n"); | 865 | pr_emerg(HW_ERR "Bank 4 is reserved on Fam17h.\n"); |
864 | 866 | ||
865 | hwid = smca_banks[m->bank].hwid; | 867 | hwid = smca_banks[m->bank].hwid; |
@@ -878,12 +880,8 @@ static void decode_smca_errors(struct mce *m) | |||
878 | pr_cont("%s.\n", smca_mce_descs[bank_type].descs[xec]); | 880 | pr_cont("%s.\n", smca_mce_descs[bank_type].descs[xec]); |
879 | } | 881 | } |
880 | 882 | ||
881 | /* | ||
882 | * amd_get_nb_id() returns the last level cache id. | ||
883 | * The last level cache on Fam17h is 1 level below the node. | ||
884 | */ | ||
885 | if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc) | 883 | if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc) |
886 | decode_dram_ecc(amd_get_nb_id(m->extcpu) >> 1, m); | 884 | decode_dram_ecc(cpu_to_node(m->extcpu), m); |
887 | } | 885 | } |
888 | 886 | ||
889 | static inline void amd_decode_err_code(u16 ec) | 887 | static inline void amd_decode_err_code(u16 ec) |
@@ -915,12 +913,10 @@ static inline void amd_decode_err_code(u16 ec) | |||
915 | */ | 913 | */ |
916 | static bool amd_filter_mce(struct mce *m) | 914 | static bool amd_filter_mce(struct mce *m) |
917 | { | 915 | { |
918 | u8 xec = (m->status >> 16) & 0x1f; | ||
919 | |||
920 | /* | 916 | /* |
921 | * NB GART TLB error reporting is disabled by default. | 917 | * NB GART TLB error reporting is disabled by default. |
922 | */ | 918 | */ |
923 | if (m->bank == 4 && xec == 0x5 && !report_gart_errors) | 919 | if (m->bank == 4 && XEC(m->status, 0x1f) == 0x5 && !report_gart_errors) |
924 | return true; | 920 | return true; |
925 | 921 | ||
926 | return false; | 922 | return false; |
@@ -946,7 +942,7 @@ static int | |||
946 | amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | 942 | amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) |
947 | { | 943 | { |
948 | struct mce *m = (struct mce *)data; | 944 | struct mce *m = (struct mce *)data; |
949 | struct cpuinfo_x86 *c = &cpu_data(m->extcpu); | 945 | unsigned int fam = x86_family(m->cpuid); |
950 | int ecc; | 946 | int ecc; |
951 | 947 | ||
952 | if (amd_filter_mce(m)) | 948 | if (amd_filter_mce(m)) |
@@ -956,7 +952,7 @@ amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | |||
956 | 952 | ||
957 | pr_emerg(HW_ERR "CPU:%d (%x:%x:%x) MC%d_STATUS[%s|%s|%s|%s|%s", | 953 | pr_emerg(HW_ERR "CPU:%d (%x:%x:%x) MC%d_STATUS[%s|%s|%s|%s|%s", |
958 | m->extcpu, | 954 | m->extcpu, |
959 | c->x86, c->x86_model, c->x86_mask, | 955 | fam, x86_model(m->cpuid), x86_stepping(m->cpuid), |
960 | m->bank, | 956 | m->bank, |
961 | ((m->status & MCI_STATUS_OVER) ? "Over" : "-"), | 957 | ((m->status & MCI_STATUS_OVER) ? "Over" : "-"), |
962 | ((m->status & MCI_STATUS_UC) ? "UE" : | 958 | ((m->status & MCI_STATUS_UC) ? "UE" : |
@@ -965,11 +961,11 @@ amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | |||
965 | ((m->status & MCI_STATUS_PCC) ? "PCC" : "-"), | 961 | ((m->status & MCI_STATUS_PCC) ? "PCC" : "-"), |
966 | ((m->status & MCI_STATUS_ADDRV) ? "AddrV" : "-")); | 962 | ((m->status & MCI_STATUS_ADDRV) ? "AddrV" : "-")); |
967 | 963 | ||
968 | if (c->x86 >= 0x15) { | 964 | if (fam >= 0x15) { |
969 | pr_cont("|%s", (m->status & MCI_STATUS_DEFERRED ? "Deferred" : "-")); | 965 | pr_cont("|%s", (m->status & MCI_STATUS_DEFERRED ? "Deferred" : "-")); |
970 | 966 | ||
971 | /* F15h, bank4, bit 43 is part of McaStatSubCache. */ | 967 | /* F15h, bank4, bit 43 is part of McaStatSubCache. */ |
972 | if (c->x86 != 0x15 || m->bank != 4) | 968 | if (fam != 0x15 || m->bank != 4) |
973 | pr_cont("|%s", (m->status & MCI_STATUS_POISON ? "Poison" : "-")); | 969 | pr_cont("|%s", (m->status & MCI_STATUS_POISON ? "Poison" : "-")); |
974 | } | 970 | } |
975 | 971 | ||
@@ -1002,7 +998,7 @@ amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | |||
1002 | 998 | ||
1003 | pr_cont("\n"); | 999 | pr_cont("\n"); |
1004 | 1000 | ||
1005 | decode_smca_errors(m); | 1001 | decode_smca_error(m); |
1006 | goto err_code; | 1002 | goto err_code; |
1007 | } | 1003 | } |
1008 | 1004 | ||
diff --git a/drivers/edac/mv64x60_edac.c b/drivers/edac/mv64x60_edac.c index d3650df94fe8..ec5d695bbb72 100644 --- a/drivers/edac/mv64x60_edac.c +++ b/drivers/edac/mv64x60_edac.c | |||
@@ -766,7 +766,6 @@ static int mv64x60_mc_err_probe(struct platform_device *pdev) | |||
766 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; | 766 | mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; |
767 | mci->edac_cap = EDAC_FLAG_SECDED; | 767 | mci->edac_cap = EDAC_FLAG_SECDED; |
768 | mci->mod_name = EDAC_MOD_STR; | 768 | mci->mod_name = EDAC_MOD_STR; |
769 | mci->mod_ver = MV64x60_REVISION; | ||
770 | mci->ctl_name = mv64x60_ctl_name; | 769 | mci->ctl_name = mv64x60_ctl_name; |
771 | 770 | ||
772 | if (edac_op_state == EDAC_OPSTATE_POLL) | 771 | if (edac_op_state == EDAC_OPSTATE_POLL) |
diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c index 8e599490f6de..4395c84cdcbf 100644 --- a/drivers/edac/pnd2_edac.c +++ b/drivers/edac/pnd2_edac.c | |||
@@ -129,42 +129,72 @@ static struct mem_ctl_info *pnd2_mci; | |||
129 | #define GET_BITFIELD(v, lo, hi) (((v) & GENMASK_ULL(hi, lo)) >> (lo)) | 129 | #define GET_BITFIELD(v, lo, hi) (((v) & GENMASK_ULL(hi, lo)) >> (lo)) |
130 | #define U64_LSHIFT(val, s) ((u64)(val) << (s)) | 130 | #define U64_LSHIFT(val, s) ((u64)(val) << (s)) |
131 | 131 | ||
132 | #ifdef CONFIG_X86_INTEL_SBI_APL | 132 | /* |
133 | #include "linux/platform_data/sbi_apl.h" | 133 | * On Apollo Lake we access memory controller registers via a |
134 | static int sbi_send(int port, int off, int op, u32 *data) | 134 | * side-band mailbox style interface in a hidden PCI device |
135 | * configuration space. | ||
136 | */ | ||
137 | static struct pci_bus *p2sb_bus; | ||
138 | #define P2SB_DEVFN PCI_DEVFN(0xd, 0) | ||
139 | #define P2SB_ADDR_OFF 0xd0 | ||
140 | #define P2SB_DATA_OFF 0xd4 | ||
141 | #define P2SB_STAT_OFF 0xd8 | ||
142 | #define P2SB_ROUT_OFF 0xda | ||
143 | #define P2SB_EADD_OFF 0xdc | ||
144 | #define P2SB_HIDE_OFF 0xe1 | ||
145 | |||
146 | #define P2SB_BUSY 1 | ||
147 | |||
148 | #define P2SB_READ(size, off, ptr) \ | ||
149 | pci_bus_read_config_##size(p2sb_bus, P2SB_DEVFN, off, ptr) | ||
150 | #define P2SB_WRITE(size, off, val) \ | ||
151 | pci_bus_write_config_##size(p2sb_bus, P2SB_DEVFN, off, val) | ||
152 | |||
153 | static bool p2sb_is_busy(u16 *status) | ||
135 | { | 154 | { |
136 | struct sbi_apl_message sbi_arg; | 155 | P2SB_READ(word, P2SB_STAT_OFF, status); |
137 | int ret, read = 0; | ||
138 | 156 | ||
139 | memset(&sbi_arg, 0, sizeof(sbi_arg)); | 157 | return !!(*status & P2SB_BUSY); |
158 | } | ||
140 | 159 | ||
141 | if (op == 0 || op == 4 || op == 6) | 160 | static int _apl_rd_reg(int port, int off, int op, u32 *data) |
142 | read = 1; | 161 | { |
143 | else | 162 | int retries = 0xff, ret; |
144 | sbi_arg.data = *data; | 163 | u16 status; |
164 | u8 hidden; | ||
165 | |||
166 | /* Unhide the P2SB device, if it's hidden */ | ||
167 | P2SB_READ(byte, P2SB_HIDE_OFF, &hidden); | ||
168 | if (hidden) | ||
169 | P2SB_WRITE(byte, P2SB_HIDE_OFF, 0); | ||
170 | |||
171 | if (p2sb_is_busy(&status)) { | ||
172 | ret = -EAGAIN; | ||
173 | goto out; | ||
174 | } | ||
145 | 175 | ||
146 | sbi_arg.opcode = op; | 176 | P2SB_WRITE(dword, P2SB_ADDR_OFF, (port << 24) | off); |
147 | sbi_arg.port_address = port; | 177 | P2SB_WRITE(dword, P2SB_DATA_OFF, 0); |
148 | sbi_arg.register_offset = off; | 178 | P2SB_WRITE(dword, P2SB_EADD_OFF, 0); |
149 | ret = sbi_apl_commit(&sbi_arg); | 179 | P2SB_WRITE(word, P2SB_ROUT_OFF, 0); |
150 | if (ret || sbi_arg.status) | 180 | P2SB_WRITE(word, P2SB_STAT_OFF, (op << 8) | P2SB_BUSY); |
151 | edac_dbg(2, "sbi_send status=%d ret=%d data=%x\n", | ||
152 | sbi_arg.status, ret, sbi_arg.data); | ||
153 | 181 | ||
154 | if (ret == 0) | 182 | while (p2sb_is_busy(&status)) { |
155 | ret = sbi_arg.status; | 183 | if (retries-- == 0) { |
184 | ret = -EBUSY; | ||
185 | goto out; | ||
186 | } | ||
187 | } | ||
156 | 188 | ||
157 | if (ret == 0 && read) | 189 | P2SB_READ(dword, P2SB_DATA_OFF, data); |
158 | *data = sbi_arg.data; | 190 | ret = (status >> 1) & 0x3; |
191 | out: | ||
192 | /* Hide the P2SB device, if it was hidden before */ | ||
193 | if (hidden) | ||
194 | P2SB_WRITE(byte, P2SB_HIDE_OFF, hidden); | ||
159 | 195 | ||
160 | return ret; | 196 | return ret; |
161 | } | 197 | } |
162 | #else | ||
163 | static int sbi_send(int port, int off, int op, u32 *data) | ||
164 | { | ||
165 | return -EUNATCH; | ||
166 | } | ||
167 | #endif | ||
168 | 198 | ||
169 | static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char *name) | 199 | static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char *name) |
170 | { | 200 | { |
@@ -173,10 +203,10 @@ static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char *na | |||
173 | edac_dbg(2, "Read %s port=%x off=%x op=%x\n", name, port, off, op); | 203 | edac_dbg(2, "Read %s port=%x off=%x op=%x\n", name, port, off, op); |
174 | switch (sz) { | 204 | switch (sz) { |
175 | case 8: | 205 | case 8: |
176 | ret = sbi_send(port, off + 4, op, (u32 *)(data + 4)); | 206 | ret = _apl_rd_reg(port, off + 4, op, (u32 *)(data + 4)); |
177 | /* fall through */ | 207 | /* fall through */ |
178 | case 4: | 208 | case 4: |
179 | ret |= sbi_send(port, off, op, (u32 *)data); | 209 | ret |= _apl_rd_reg(port, off, op, (u32 *)data); |
180 | pnd2_printk(KERN_DEBUG, "%s=%x%08x ret=%d\n", name, | 210 | pnd2_printk(KERN_DEBUG, "%s=%x%08x ret=%d\n", name, |
181 | sz == 8 ? *((u32 *)(data + 4)) : 0, *((u32 *)data), ret); | 211 | sz == 8 ? *((u32 *)(data + 4)) : 0, *((u32 *)data), ret); |
182 | break; | 212 | break; |
@@ -212,11 +242,23 @@ static u64 get_sideband_reg_base_addr(void) | |||
212 | { | 242 | { |
213 | struct pci_dev *pdev; | 243 | struct pci_dev *pdev; |
214 | u32 hi, lo; | 244 | u32 hi, lo; |
245 | u8 hidden; | ||
215 | 246 | ||
216 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x19dd, NULL); | 247 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x19dd, NULL); |
217 | if (pdev) { | 248 | if (pdev) { |
249 | /* Unhide the P2SB device, if it's hidden */ | ||
250 | pci_read_config_byte(pdev, 0xe1, &hidden); | ||
251 | if (hidden) | ||
252 | pci_write_config_byte(pdev, 0xe1, 0); | ||
253 | |||
218 | pci_read_config_dword(pdev, 0x10, &lo); | 254 | pci_read_config_dword(pdev, 0x10, &lo); |
219 | pci_read_config_dword(pdev, 0x14, &hi); | 255 | pci_read_config_dword(pdev, 0x14, &hi); |
256 | lo &= 0xfffffff0; | ||
257 | |||
258 | /* Hide the P2SB device, if it was hidden before */ | ||
259 | if (hidden) | ||
260 | pci_write_config_byte(pdev, 0xe1, hidden); | ||
261 | |||
220 | pci_dev_put(pdev); | 262 | pci_dev_put(pdev); |
221 | return (U64_LSHIFT(hi, 32) | U64_LSHIFT(lo, 0)); | 263 | return (U64_LSHIFT(hi, 32) | U64_LSHIFT(lo, 0)); |
222 | } else { | 264 | } else { |
@@ -1515,6 +1557,12 @@ static int __init pnd2_init(void) | |||
1515 | 1557 | ||
1516 | ops = (struct dunit_ops *)id->driver_data; | 1558 | ops = (struct dunit_ops *)id->driver_data; |
1517 | 1559 | ||
1560 | if (ops->type == APL) { | ||
1561 | p2sb_bus = pci_find_bus(0, 0); | ||
1562 | if (!p2sb_bus) | ||
1563 | return -ENODEV; | ||
1564 | } | ||
1565 | |||
1518 | /* Ensure that the OPSTATE is set correctly for POLL or NMI */ | 1566 | /* Ensure that the OPSTATE is set correctly for POLL or NMI */ |
1519 | opstate_init(); | 1567 | opstate_init(); |
1520 | 1568 | ||
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index e55e92590106..fd3202c30f69 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c | |||
@@ -1063,7 +1063,6 @@ static int ppc4xx_edac_mc_init(struct mem_ctl_info *mci, | |||
1063 | /* Initialize strings */ | 1063 | /* Initialize strings */ |
1064 | 1064 | ||
1065 | mci->mod_name = PPC4XX_EDAC_MODULE_NAME; | 1065 | mci->mod_name = PPC4XX_EDAC_MODULE_NAME; |
1066 | mci->mod_ver = PPC4XX_EDAC_MODULE_REVISION; | ||
1067 | mci->ctl_name = ppc4xx_edac_match->compatible, | 1066 | mci->ctl_name = ppc4xx_edac_match->compatible, |
1068 | mci->dev_name = np->full_name; | 1067 | mci->dev_name = np->full_name; |
1069 | 1068 | ||
@@ -1267,8 +1266,8 @@ static int ppc4xx_edac_probe(struct platform_device *op) | |||
1267 | memcheck = (mcopt1 & SDRAM_MCOPT1_MCHK_MASK); | 1266 | memcheck = (mcopt1 & SDRAM_MCOPT1_MCHK_MASK); |
1268 | 1267 | ||
1269 | if (memcheck == SDRAM_MCOPT1_MCHK_NON) { | 1268 | if (memcheck == SDRAM_MCOPT1_MCHK_NON) { |
1270 | ppc4xx_edac_printk(KERN_INFO, "%s: No ECC memory detected or " | 1269 | ppc4xx_edac_printk(KERN_INFO, "%pOF: No ECC memory detected or " |
1271 | "ECC is disabled.\n", np->full_name); | 1270 | "ECC is disabled.\n", np); |
1272 | status = -ENODEV; | 1271 | status = -ENODEV; |
1273 | goto done; | 1272 | goto done; |
1274 | } | 1273 | } |
@@ -1287,9 +1286,9 @@ static int ppc4xx_edac_probe(struct platform_device *op) | |||
1287 | mci = edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers, | 1286 | mci = edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers, |
1288 | sizeof(struct ppc4xx_edac_pdata)); | 1287 | sizeof(struct ppc4xx_edac_pdata)); |
1289 | if (mci == NULL) { | 1288 | if (mci == NULL) { |
1290 | ppc4xx_edac_printk(KERN_ERR, "%s: " | 1289 | ppc4xx_edac_printk(KERN_ERR, "%pOF: " |
1291 | "Failed to allocate EDAC MC instance!\n", | 1290 | "Failed to allocate EDAC MC instance!\n", |
1292 | np->full_name); | 1291 | np); |
1293 | status = -ENOMEM; | 1292 | status = -ENOMEM; |
1294 | goto done; | 1293 | goto done; |
1295 | } | 1294 | } |
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c index 978916625ced..851e53e122aa 100644 --- a/drivers/edac/r82600_edac.c +++ b/drivers/edac/r82600_edac.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/edac.h> | 22 | #include <linux/edac.h> |
23 | #include "edac_module.h" | 23 | #include "edac_module.h" |
24 | 24 | ||
25 | #define R82600_REVISION " Ver: 2.0.2" | ||
26 | #define EDAC_MOD_STR "r82600_edac" | 25 | #define EDAC_MOD_STR "r82600_edac" |
27 | 26 | ||
28 | #define r82600_printk(level, fmt, arg...) \ | 27 | #define r82600_printk(level, fmt, arg...) \ |
@@ -316,7 +315,6 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx) | |||
316 | mci->edac_cap = EDAC_FLAG_NONE; | 315 | mci->edac_cap = EDAC_FLAG_NONE; |
317 | 316 | ||
318 | mci->mod_name = EDAC_MOD_STR; | 317 | mci->mod_name = EDAC_MOD_STR; |
319 | mci->mod_ver = R82600_REVISION; | ||
320 | mci->ctl_name = "R82600"; | 318 | mci->ctl_name = "R82600"; |
321 | mci->dev_name = pci_name(pdev); | 319 | mci->dev_name = pci_name(pdev); |
322 | mci->edac_check = r82600_check; | 320 | mci->edac_check = r82600_check; |
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 80d860cb0746..dc0591654011 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -300,6 +300,12 @@ enum domain { | |||
300 | SOCK, | 300 | SOCK, |
301 | }; | 301 | }; |
302 | 302 | ||
303 | enum mirroring_mode { | ||
304 | NON_MIRRORING, | ||
305 | ADDR_RANGE_MIRRORING, | ||
306 | FULL_MIRRORING, | ||
307 | }; | ||
308 | |||
303 | struct sbridge_pvt; | 309 | struct sbridge_pvt; |
304 | struct sbridge_info { | 310 | struct sbridge_info { |
305 | enum type type; | 311 | enum type type; |
@@ -377,8 +383,9 @@ struct sbridge_pvt { | |||
377 | struct sbridge_channel channel[NUM_CHANNELS]; | 383 | struct sbridge_channel channel[NUM_CHANNELS]; |
378 | 384 | ||
379 | /* Memory type detection */ | 385 | /* Memory type detection */ |
380 | bool is_mirrored, is_lockstep, is_close_pg; | 386 | bool is_cur_addr_mirrored, is_lockstep, is_close_pg; |
381 | bool is_chan_hash; | 387 | bool is_chan_hash; |
388 | enum mirroring_mode mirror_mode; | ||
382 | 389 | ||
383 | /* Memory description */ | 390 | /* Memory description */ |
384 | u64 tolm, tohm; | 391 | u64 tolm, tohm; |
@@ -1648,10 +1655,6 @@ static int get_dimm_config(struct mem_ctl_info *mci) | |||
1648 | enum edac_type mode; | 1655 | enum edac_type mode; |
1649 | u32 reg; | 1656 | u32 reg; |
1650 | 1657 | ||
1651 | if (pvt->info.type == HASWELL || pvt->info.type == BROADWELL) { | ||
1652 | pci_read_config_dword(pvt->pci_ha, HASWELL_HASYSDEFEATURE2, ®); | ||
1653 | pvt->is_chan_hash = GET_BITFIELD(reg, 21, 21); | ||
1654 | } | ||
1655 | pvt->sbridge_dev->node_id = pvt->info.get_node_id(pvt); | 1658 | pvt->sbridge_dev->node_id = pvt->info.get_node_id(pvt); |
1656 | edac_dbg(0, "mc#%d: Node ID: %d, source ID: %d\n", | 1659 | edac_dbg(0, "mc#%d: Node ID: %d, source ID: %d\n", |
1657 | pvt->sbridge_dev->mc, | 1660 | pvt->sbridge_dev->mc, |
@@ -1663,22 +1666,45 @@ static int get_dimm_config(struct mem_ctl_info *mci) | |||
1663 | */ | 1666 | */ |
1664 | if (pvt->info.type == KNIGHTS_LANDING) { | 1667 | if (pvt->info.type == KNIGHTS_LANDING) { |
1665 | mode = EDAC_S4ECD4ED; | 1668 | mode = EDAC_S4ECD4ED; |
1666 | pvt->is_mirrored = false; | 1669 | pvt->mirror_mode = NON_MIRRORING; |
1670 | pvt->is_cur_addr_mirrored = false; | ||
1667 | 1671 | ||
1668 | if (knl_get_dimm_capacity(pvt, knl_mc_sizes) != 0) | 1672 | if (knl_get_dimm_capacity(pvt, knl_mc_sizes) != 0) |
1669 | return -1; | 1673 | return -1; |
1670 | pci_read_config_dword(pvt->pci_ta, KNL_MCMTR, &pvt->info.mcmtr); | 1674 | if (pci_read_config_dword(pvt->pci_ta, KNL_MCMTR, &pvt->info.mcmtr)) { |
1675 | edac_dbg(0, "Failed to read KNL_MCMTR register\n"); | ||
1676 | return -ENODEV; | ||
1677 | } | ||
1671 | } else { | 1678 | } else { |
1672 | pci_read_config_dword(pvt->pci_ras, RASENABLES, ®); | 1679 | if (pvt->info.type == HASWELL || pvt->info.type == BROADWELL) { |
1680 | if (pci_read_config_dword(pvt->pci_ha, HASWELL_HASYSDEFEATURE2, ®)) { | ||
1681 | edac_dbg(0, "Failed to read HASWELL_HASYSDEFEATURE2 register\n"); | ||
1682 | return -ENODEV; | ||
1683 | } | ||
1684 | pvt->is_chan_hash = GET_BITFIELD(reg, 21, 21); | ||
1685 | if (GET_BITFIELD(reg, 28, 28)) { | ||
1686 | pvt->mirror_mode = ADDR_RANGE_MIRRORING; | ||
1687 | edac_dbg(0, "Address range partial memory mirroring is enabled\n"); | ||
1688 | goto next; | ||
1689 | } | ||
1690 | } | ||
1691 | if (pci_read_config_dword(pvt->pci_ras, RASENABLES, ®)) { | ||
1692 | edac_dbg(0, "Failed to read RASENABLES register\n"); | ||
1693 | return -ENODEV; | ||
1694 | } | ||
1673 | if (IS_MIRROR_ENABLED(reg)) { | 1695 | if (IS_MIRROR_ENABLED(reg)) { |
1674 | edac_dbg(0, "Memory mirror is enabled\n"); | 1696 | pvt->mirror_mode = FULL_MIRRORING; |
1675 | pvt->is_mirrored = true; | 1697 | edac_dbg(0, "Full memory mirroring is enabled\n"); |
1676 | } else { | 1698 | } else { |
1677 | edac_dbg(0, "Memory mirror is disabled\n"); | 1699 | pvt->mirror_mode = NON_MIRRORING; |
1678 | pvt->is_mirrored = false; | 1700 | edac_dbg(0, "Memory mirroring is disabled\n"); |
1679 | } | 1701 | } |
1680 | 1702 | ||
1681 | pci_read_config_dword(pvt->pci_ta, MCMTR, &pvt->info.mcmtr); | 1703 | next: |
1704 | if (pci_read_config_dword(pvt->pci_ta, MCMTR, &pvt->info.mcmtr)) { | ||
1705 | edac_dbg(0, "Failed to read MCMTR register\n"); | ||
1706 | return -ENODEV; | ||
1707 | } | ||
1682 | if (IS_LOCKSTEP_ENABLED(pvt->info.mcmtr)) { | 1708 | if (IS_LOCKSTEP_ENABLED(pvt->info.mcmtr)) { |
1683 | edac_dbg(0, "Lockstep is enabled\n"); | 1709 | edac_dbg(0, "Lockstep is enabled\n"); |
1684 | mode = EDAC_S8ECD8ED; | 1710 | mode = EDAC_S8ECD8ED; |
@@ -2092,7 +2118,8 @@ static int get_memory_error_data(struct mem_ctl_info *mci, | |||
2092 | 2118 | ||
2093 | pci_read_config_dword(pvt->pci_tad[base_ch], tad_ch_nilv_offset[n_tads], &tad_offset); | 2119 | pci_read_config_dword(pvt->pci_tad[base_ch], tad_ch_nilv_offset[n_tads], &tad_offset); |
2094 | 2120 | ||
2095 | if (pvt->is_mirrored) { | 2121 | if (pvt->mirror_mode == FULL_MIRRORING || |
2122 | (pvt->mirror_mode == ADDR_RANGE_MIRRORING && n_tads == 0)) { | ||
2096 | *channel_mask |= 1 << ((base_ch + 2) % 4); | 2123 | *channel_mask |= 1 << ((base_ch + 2) % 4); |
2097 | switch(ch_way) { | 2124 | switch(ch_way) { |
2098 | case 2: | 2125 | case 2: |
@@ -2103,8 +2130,12 @@ static int get_memory_error_data(struct mem_ctl_info *mci, | |||
2103 | sprintf(msg, "Invalid mirror set. Can't decode addr"); | 2130 | sprintf(msg, "Invalid mirror set. Can't decode addr"); |
2104 | return -EINVAL; | 2131 | return -EINVAL; |
2105 | } | 2132 | } |
2106 | } else | 2133 | |
2134 | pvt->is_cur_addr_mirrored = true; | ||
2135 | } else { | ||
2107 | sck_xch = (1 << sck_way) * ch_way; | 2136 | sck_xch = (1 << sck_way) * ch_way; |
2137 | pvt->is_cur_addr_mirrored = false; | ||
2138 | } | ||
2108 | 2139 | ||
2109 | if (pvt->is_lockstep) | 2140 | if (pvt->is_lockstep) |
2110 | *channel_mask |= 1 << ((base_ch + 1) % 4); | 2141 | *channel_mask |= 1 << ((base_ch + 1) % 4); |
@@ -2967,7 +2998,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci, | |||
2967 | * EDAC core should be handling the channel mask, in order to point | 2998 | * EDAC core should be handling the channel mask, in order to point |
2968 | * to the group of dimm's where the error may be happening. | 2999 | * to the group of dimm's where the error may be happening. |
2969 | */ | 3000 | */ |
2970 | if (!pvt->is_lockstep && !pvt->is_mirrored && !pvt->is_close_pg) | 3001 | if (!pvt->is_lockstep && !pvt->is_cur_addr_mirrored && !pvt->is_close_pg) |
2971 | channel = first_channel; | 3002 | channel = first_channel; |
2972 | 3003 | ||
2973 | snprintf(msg, sizeof(msg), | 3004 | snprintf(msg, sizeof(msg), |
@@ -3125,7 +3156,6 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev, enum type type) | |||
3125 | mci->edac_ctl_cap = EDAC_FLAG_NONE; | 3156 | mci->edac_ctl_cap = EDAC_FLAG_NONE; |
3126 | mci->edac_cap = EDAC_FLAG_NONE; | 3157 | mci->edac_cap = EDAC_FLAG_NONE; |
3127 | mci->mod_name = "sb_edac.c"; | 3158 | mci->mod_name = "sb_edac.c"; |
3128 | mci->mod_ver = SBRIDGE_REVISION; | ||
3129 | mci->dev_name = pci_name(pdev); | 3159 | mci->dev_name = pci_name(pdev); |
3130 | mci->ctl_page_to_phys = NULL; | 3160 | mci->ctl_page_to_phys = NULL; |
3131 | 3161 | ||
diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c index 64bef6c9cfb4..16dea97568a1 100644 --- a/drivers/edac/skx_edac.c +++ b/drivers/edac/skx_edac.c | |||
@@ -31,8 +31,6 @@ | |||
31 | 31 | ||
32 | #include "edac_module.h" | 32 | #include "edac_module.h" |
33 | 33 | ||
34 | #define SKX_REVISION " Ver: 1.0 " | ||
35 | |||
36 | /* | 34 | /* |
37 | * Debug macros | 35 | * Debug macros |
38 | */ | 36 | */ |
@@ -473,7 +471,6 @@ static int skx_register_mci(struct skx_imc *imc) | |||
473 | mci->edac_cap = EDAC_FLAG_NONE; | 471 | mci->edac_cap = EDAC_FLAG_NONE; |
474 | mci->mod_name = "skx_edac.c"; | 472 | mci->mod_name = "skx_edac.c"; |
475 | mci->dev_name = pci_name(imc->chan[0].cdev); | 473 | mci->dev_name = pci_name(imc->chan[0].cdev); |
476 | mci->mod_ver = SKX_REVISION; | ||
477 | mci->ctl_page_to_phys = NULL; | 474 | mci->ctl_page_to_phys = NULL; |
478 | 475 | ||
479 | rc = skx_get_dimm_config(mci); | 476 | rc = skx_get_dimm_config(mci); |
diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 1c01dec78ec3..0c9c59e2b5a3 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c | |||
@@ -413,7 +413,6 @@ static int synps_edac_mc_init(struct mem_ctl_info *mci, | |||
413 | mci->ctl_name = "synps_ddr_controller"; | 413 | mci->ctl_name = "synps_ddr_controller"; |
414 | mci->dev_name = SYNPS_EDAC_MOD_STRING; | 414 | mci->dev_name = SYNPS_EDAC_MOD_STRING; |
415 | mci->mod_name = SYNPS_EDAC_MOD_VER; | 415 | mci->mod_name = SYNPS_EDAC_MOD_VER; |
416 | mci->mod_ver = "1"; | ||
417 | 416 | ||
418 | edac_op_state = EDAC_OPSTATE_POLL; | 417 | edac_op_state = EDAC_OPSTATE_POLL; |
419 | mci->edac_check = synps_edac_check; | 418 | mci->edac_check = synps_edac_check; |
diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c index 2d352b40ae1c..f35d87519a3e 100644 --- a/drivers/edac/thunderx_edac.c +++ b/drivers/edac/thunderx_edac.c | |||
@@ -732,7 +732,6 @@ static int thunderx_lmc_probe(struct pci_dev *pdev, | |||
732 | mci->edac_cap = EDAC_FLAG_SECDED; | 732 | mci->edac_cap = EDAC_FLAG_SECDED; |
733 | 733 | ||
734 | mci->mod_name = "thunderx-lmc"; | 734 | mci->mod_name = "thunderx-lmc"; |
735 | mci->mod_ver = "1"; | ||
736 | mci->ctl_name = "thunderx-lmc"; | 735 | mci->ctl_name = "thunderx-lmc"; |
737 | mci->dev_name = dev_name(&pdev->dev); | 736 | mci->dev_name = dev_name(&pdev->dev); |
738 | mci->scrub_mode = SCRUB_NONE; | 737 | mci->scrub_mode = SCRUB_NONE; |
@@ -775,11 +774,10 @@ static int thunderx_lmc_probe(struct pci_dev *pdev, | |||
775 | 774 | ||
776 | lmc->xor_bank = lmc_control & LMC_CONTROL_XOR_BANK; | 775 | lmc->xor_bank = lmc_control & LMC_CONTROL_XOR_BANK; |
777 | 776 | ||
778 | l2c_ioaddr = ioremap(L2C_CTL | FIELD_PREP(THUNDERX_NODE, lmc->node), | 777 | l2c_ioaddr = ioremap(L2C_CTL | FIELD_PREP(THUNDERX_NODE, lmc->node), PAGE_SIZE); |
779 | PAGE_SIZE); | ||
780 | |||
781 | if (!l2c_ioaddr) { | 778 | if (!l2c_ioaddr) { |
782 | dev_err(&pdev->dev, "Cannot map L2C_CTL\n"); | 779 | dev_err(&pdev->dev, "Cannot map L2C_CTL\n"); |
780 | ret = -ENOMEM; | ||
783 | goto err_free; | 781 | goto err_free; |
784 | } | 782 | } |
785 | 783 | ||
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c index 03c97a4bf590..cc779f3f9e2d 100644 --- a/drivers/edac/x38_edac.c +++ b/drivers/edac/x38_edac.c | |||
@@ -18,8 +18,6 @@ | |||
18 | #include <linux/io-64-nonatomic-lo-hi.h> | 18 | #include <linux/io-64-nonatomic-lo-hi.h> |
19 | #include "edac_module.h" | 19 | #include "edac_module.h" |
20 | 20 | ||
21 | #define X38_REVISION "1.1" | ||
22 | |||
23 | #define EDAC_MOD_STR "x38_edac" | 21 | #define EDAC_MOD_STR "x38_edac" |
24 | 22 | ||
25 | #define PCI_DEVICE_ID_INTEL_X38_HB 0x29e0 | 23 | #define PCI_DEVICE_ID_INTEL_X38_HB 0x29e0 |
@@ -357,7 +355,6 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |||
357 | mci->edac_cap = EDAC_FLAG_SECDED; | 355 | mci->edac_cap = EDAC_FLAG_SECDED; |
358 | 356 | ||
359 | mci->mod_name = EDAC_MOD_STR; | 357 | mci->mod_name = EDAC_MOD_STR; |
360 | mci->mod_ver = X38_REVISION; | ||
361 | mci->ctl_name = x38_devs[dev_idx].ctl_name; | 358 | mci->ctl_name = x38_devs[dev_idx].ctl_name; |
362 | mci->dev_name = pci_name(pdev); | 359 | mci->dev_name = pci_name(pdev); |
363 | mci->edac_check = x38_check; | 360 | mci->edac_check = x38_check; |
diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c index 669246056812..e8b81d7ef61f 100644 --- a/drivers/edac/xgene_edac.c +++ b/drivers/edac/xgene_edac.c | |||
@@ -415,7 +415,6 @@ static int xgene_edac_mc_add(struct xgene_edac *edac, struct device_node *np) | |||
415 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; | 415 | mci->edac_ctl_cap = EDAC_FLAG_SECDED; |
416 | mci->edac_cap = EDAC_FLAG_SECDED; | 416 | mci->edac_cap = EDAC_FLAG_SECDED; |
417 | mci->mod_name = EDAC_MOD_STR; | 417 | mci->mod_name = EDAC_MOD_STR; |
418 | mci->mod_ver = "0.1"; | ||
419 | mci->ctl_page_to_phys = NULL; | 418 | mci->ctl_page_to_phys = NULL; |
420 | mci->scrub_cap = SCRUB_FLAG_HW_SRC; | 419 | mci->scrub_cap = SCRUB_FLAG_HW_SRC; |
421 | mci->scrub_mode = SCRUB_HW_SRC; | 420 | mci->scrub_mode = SCRUB_HW_SRC; |
diff --git a/include/linux/edac.h b/include/linux/edac.h index 8ae0f45fafd6..cd75c173fd00 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -619,7 +619,6 @@ struct mem_ctl_info { | |||
619 | */ | 619 | */ |
620 | struct device *pdev; | 620 | struct device *pdev; |
621 | const char *mod_name; | 621 | const char *mod_name; |
622 | const char *mod_ver; | ||
623 | const char *ctl_name; | 622 | const char *ctl_name; |
624 | const char *dev_name; | 623 | const char *dev_name; |
625 | void *pvt_info; | 624 | void *pvt_info; |