aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/Kconfig2
-rw-r--r--drivers/edac/amd64_edac.c88
-rw-r--r--drivers/edac/amd64_edac.h3
-rw-r--r--drivers/edac/cpc925_edac.c2
-rw-r--r--drivers/edac/edac_core.h8
-rw-r--r--drivers/edac/edac_device.c4
-rw-r--r--drivers/edac/edac_device_sysfs.c4
-rw-r--r--drivers/edac/edac_mc.c2
-rw-r--r--drivers/edac/edac_mc_sysfs.c13
-rw-r--r--drivers/edac/edac_pci_sysfs.c4
-rw-r--r--drivers/edac/i3200_edac.c13
-rw-r--r--drivers/edac/i5000_edac.c2
-rw-r--r--drivers/edac/i5100_edac.c2
-rw-r--r--drivers/edac/i5400_edac.c4
-rw-r--r--drivers/edac/i7300_edac.c2
-rw-r--r--drivers/edac/i7core_edac.c2
-rw-r--r--drivers/edac/i82443bxgx_edac.c4
-rw-r--r--drivers/edac/mce_amd_inj.c2
-rw-r--r--drivers/edac/mpc85xx_edac.c27
-rw-r--r--drivers/edac/ppc4xx_edac.c2
-rw-r--r--drivers/edac/r82600_edac.c6
21 files changed, 145 insertions, 51 deletions
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index fac1a2002e67..af1a17d42bd7 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -45,7 +45,7 @@ config EDAC_DECODE_MCE
45 default y 45 default y
46 ---help--- 46 ---help---
47 Enable this option if you want to decode Machine Check Exceptions 47 Enable this option if you want to decode Machine Check Exceptions
48 occuring on your machine in human-readable form. 48 occurring on your machine in human-readable form.
49 49
50 You should definitely say Y here in case you want to decode MCEs 50 You should definitely say Y here in case you want to decode MCEs
51 which occur really early upon boot, before the module infrastructure 51 which occur really early upon boot, before the module infrastructure
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 31e71c4fc831..9a8bebcf6b17 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -211,8 +211,6 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci)
211 211
212 scrubval = scrubval & 0x001F; 212 scrubval = scrubval & 0x001F;
213 213
214 amd64_debug("pci-read, sdram scrub control value: %d\n", scrubval);
215
216 for (i = 0; i < ARRAY_SIZE(scrubrates); i++) { 214 for (i = 0; i < ARRAY_SIZE(scrubrates); i++) {
217 if (scrubrates[i].scrubval == scrubval) { 215 if (scrubrates[i].scrubval == scrubval) {
218 retval = scrubrates[i].bandwidth; 216 retval = scrubrates[i].bandwidth;
@@ -933,25 +931,74 @@ static int k8_early_channel_count(struct amd64_pvt *pvt)
933/* On F10h and later ErrAddr is MC4_ADDR[47:1] */ 931/* On F10h and later ErrAddr is MC4_ADDR[47:1] */
934static u64 get_error_address(struct mce *m) 932static u64 get_error_address(struct mce *m)
935{ 933{
934 struct cpuinfo_x86 *c = &boot_cpu_data;
935 u64 addr;
936 u8 start_bit = 1; 936 u8 start_bit = 1;
937 u8 end_bit = 47; 937 u8 end_bit = 47;
938 938
939 if (boot_cpu_data.x86 == 0xf) { 939 if (c->x86 == 0xf) {
940 start_bit = 3; 940 start_bit = 3;
941 end_bit = 39; 941 end_bit = 39;
942 } 942 }
943 943
944 return m->addr & GENMASK(start_bit, end_bit); 944 addr = m->addr & GENMASK(start_bit, end_bit);
945
946 /*
947 * Erratum 637 workaround
948 */
949 if (c->x86 == 0x15) {
950 struct amd64_pvt *pvt;
951 u64 cc6_base, tmp_addr;
952 u32 tmp;
953 u8 mce_nid, intlv_en;
954
955 if ((addr & GENMASK(24, 47)) >> 24 != 0x00fdf7)
956 return addr;
957
958 mce_nid = amd_get_nb_id(m->extcpu);
959 pvt = mcis[mce_nid]->pvt_info;
960
961 amd64_read_pci_cfg(pvt->F1, DRAM_LOCAL_NODE_LIM, &tmp);
962 intlv_en = tmp >> 21 & 0x7;
963
964 /* add [47:27] + 3 trailing bits */
965 cc6_base = (tmp & GENMASK(0, 20)) << 3;
966
967 /* reverse and add DramIntlvEn */
968 cc6_base |= intlv_en ^ 0x7;
969
970 /* pin at [47:24] */
971 cc6_base <<= 24;
972
973 if (!intlv_en)
974 return cc6_base | (addr & GENMASK(0, 23));
975
976 amd64_read_pci_cfg(pvt->F1, DRAM_LOCAL_NODE_BASE, &tmp);
977
978 /* faster log2 */
979 tmp_addr = (addr & GENMASK(12, 23)) << __fls(intlv_en + 1);
980
981 /* OR DramIntlvSel into bits [14:12] */
982 tmp_addr |= (tmp & GENMASK(21, 23)) >> 9;
983
984 /* add remaining [11:0] bits from original MC4_ADDR */
985 tmp_addr |= addr & GENMASK(0, 11);
986
987 return cc6_base | tmp_addr;
988 }
989
990 return addr;
945} 991}
946 992
947static void read_dram_base_limit_regs(struct amd64_pvt *pvt, unsigned range) 993static void read_dram_base_limit_regs(struct amd64_pvt *pvt, unsigned range)
948{ 994{
995 struct cpuinfo_x86 *c = &boot_cpu_data;
949 int off = range << 3; 996 int off = range << 3;
950 997
951 amd64_read_pci_cfg(pvt->F1, DRAM_BASE_LO + off, &pvt->ranges[range].base.lo); 998 amd64_read_pci_cfg(pvt->F1, DRAM_BASE_LO + off, &pvt->ranges[range].base.lo);
952 amd64_read_pci_cfg(pvt->F1, DRAM_LIMIT_LO + off, &pvt->ranges[range].lim.lo); 999 amd64_read_pci_cfg(pvt->F1, DRAM_LIMIT_LO + off, &pvt->ranges[range].lim.lo);
953 1000
954 if (boot_cpu_data.x86 == 0xf) 1001 if (c->x86 == 0xf)
955 return; 1002 return;
956 1003
957 if (!dram_rw(pvt, range)) 1004 if (!dram_rw(pvt, range))
@@ -959,6 +1006,31 @@ static void read_dram_base_limit_regs(struct amd64_pvt *pvt, unsigned range)
959 1006
960 amd64_read_pci_cfg(pvt->F1, DRAM_BASE_HI + off, &pvt->ranges[range].base.hi); 1007 amd64_read_pci_cfg(pvt->F1, DRAM_BASE_HI + off, &pvt->ranges[range].base.hi);
961 amd64_read_pci_cfg(pvt->F1, DRAM_LIMIT_HI + off, &pvt->ranges[range].lim.hi); 1008 amd64_read_pci_cfg(pvt->F1, DRAM_LIMIT_HI + off, &pvt->ranges[range].lim.hi);
1009
1010 /* Factor in CC6 save area by reading dst node's limit reg */
1011 if (c->x86 == 0x15) {
1012 struct pci_dev *f1 = NULL;
1013 u8 nid = dram_dst_node(pvt, range);
1014 u32 llim;
1015
1016 f1 = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x18 + nid, 1));
1017 if (WARN_ON(!f1))
1018 return;
1019
1020 amd64_read_pci_cfg(f1, DRAM_LOCAL_NODE_LIM, &llim);
1021
1022 pvt->ranges[range].lim.lo &= GENMASK(0, 15);
1023
1024 /* {[39:27],111b} */
1025 pvt->ranges[range].lim.lo |= ((llim & 0x1fff) << 3 | 0x7) << 16;
1026
1027 pvt->ranges[range].lim.hi &= GENMASK(0, 7);
1028
1029 /* [47:40] */
1030 pvt->ranges[range].lim.hi |= llim >> 13;
1031
1032 pci_dev_put(f1);
1033 }
962} 1034}
963 1035
964static void k8_map_sysaddr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr, 1036static void k8_map_sysaddr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr,
@@ -1403,12 +1475,8 @@ static int f1x_match_to_this_node(struct amd64_pvt *pvt, unsigned range,
1403 return -EINVAL; 1475 return -EINVAL;
1404 } 1476 }
1405 1477
1406 if (intlv_en && 1478 if (intlv_en && (intlv_sel != ((sys_addr >> 12) & intlv_en)))
1407 (intlv_sel != ((sys_addr >> 12) & intlv_en))) {
1408 amd64_warn("Botched intlv bits, en: 0x%x, sel: 0x%x\n",
1409 intlv_en, intlv_sel);
1410 return -EINVAL; 1479 return -EINVAL;
1411 }
1412 1480
1413 sys_addr = f1x_swap_interleaved_region(pvt, sys_addr); 1481 sys_addr = f1x_swap_interleaved_region(pvt, sys_addr);
1414 1482
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index 11be36a311eb..9a666cb985b2 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -196,6 +196,9 @@
196 196
197#define DCT_CFG_SEL 0x10C 197#define DCT_CFG_SEL 0x10C
198 198
199#define DRAM_LOCAL_NODE_BASE 0x120
200#define DRAM_LOCAL_NODE_LIM 0x124
201
199#define DRAM_BASE_HI 0x140 202#define DRAM_BASE_HI 0x140
200#define DRAM_LIMIT_HI 0x144 203#define DRAM_LIMIT_HI 0x144
201 204
diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
index 3400ae34795a..a687a0d16962 100644
--- a/drivers/edac/cpc925_edac.c
+++ b/drivers/edac/cpc925_edac.c
@@ -817,7 +817,7 @@ static void cpc925_del_edac_devices(void)
817 } 817 }
818} 818}
819 819
820/* Convert current back-ground scrub rate into byte/sec bandwith */ 820/* Convert current back-ground scrub rate into byte/sec bandwidth */
821static int cpc925_get_sdram_scrub_rate(struct mem_ctl_info *mci) 821static int cpc925_get_sdram_scrub_rate(struct mem_ctl_info *mci)
822{ 822{
823 struct cpc925_mc_pdata *pdata = mci->pvt_info; 823 struct cpc925_mc_pdata *pdata = mci->pvt_info;
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index 3d965347a673..eefa3501916b 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -164,7 +164,7 @@ enum mem_type {
164/* chipset Error Detection and Correction capabilities and mode */ 164/* chipset Error Detection and Correction capabilities and mode */
165enum edac_type { 165enum edac_type {
166 EDAC_UNKNOWN = 0, /* Unknown if ECC is available */ 166 EDAC_UNKNOWN = 0, /* Unknown if ECC is available */
167 EDAC_NONE, /* Doesnt support ECC */ 167 EDAC_NONE, /* Doesn't support ECC */
168 EDAC_RESERVED, /* Reserved ECC type */ 168 EDAC_RESERVED, /* Reserved ECC type */
169 EDAC_PARITY, /* Detects parity errors */ 169 EDAC_PARITY, /* Detects parity errors */
170 EDAC_EC, /* Error Checking - no correction */ 170 EDAC_EC, /* Error Checking - no correction */
@@ -233,7 +233,7 @@ enum scrub_type {
233 * of these in parallel provides 64 bits which is common 233 * of these in parallel provides 64 bits which is common
234 * for a memory stick. 234 * for a memory stick.
235 * 235 *
236 * Memory Stick: A printed circuit board that agregates multiple 236 * Memory Stick: A printed circuit board that aggregates multiple
237 * memory devices in parallel. This is the atomic 237 * memory devices in parallel. This is the atomic
238 * memory component that is purchaseable by Joe consumer 238 * memory component that is purchaseable by Joe consumer
239 * and loaded into a memory socket. 239 * and loaded into a memory socket.
@@ -385,7 +385,7 @@ struct mem_ctl_info {
385 385
386 /* Get the current sdram memory scrub rate from the internal 386 /* Get the current sdram memory scrub rate from the internal
387 representation and converts it to the closest matching 387 representation and converts it to the closest matching
388 bandwith in bytes/sec. 388 bandwidth in bytes/sec.
389 */ 389 */
390 int (*get_sdram_scrub_rate) (struct mem_ctl_info * mci); 390 int (*get_sdram_scrub_rate) (struct mem_ctl_info * mci);
391 391
@@ -823,7 +823,7 @@ extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
823 * There are a limited number of error logging registers that can 823 * There are a limited number of error logging registers that can
824 * be exausted. When all registers are exhausted and an additional 824 * be exausted. When all registers are exhausted and an additional
825 * error occurs then an error overflow register records that an 825 * error occurs then an error overflow register records that an
826 * error occured and the type of error, but doesn't have any 826 * error occurred and the type of error, but doesn't have any
827 * further information. The ce/ue versions make for cleaner 827 * further information. The ce/ue versions make for cleaner
828 * reporting logic and function interface - reduces conditional 828 * reporting logic and function interface - reduces conditional
829 * statement clutter and extra function arguments. 829 * statement clutter and extra function arguments.
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index d5e13c94714f..a7408cf86f37 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -672,7 +672,7 @@ void edac_device_handle_ce(struct edac_device_ctl_info *edac_dev,
672 block->counters.ce_count++; 672 block->counters.ce_count++;
673 } 673 }
674 674
675 /* Propogate the count up the 'totals' tree */ 675 /* Propagate the count up the 'totals' tree */
676 instance->counters.ce_count++; 676 instance->counters.ce_count++;
677 edac_dev->counters.ce_count++; 677 edac_dev->counters.ce_count++;
678 678
@@ -718,7 +718,7 @@ void edac_device_handle_ue(struct edac_device_ctl_info *edac_dev,
718 block->counters.ue_count++; 718 block->counters.ue_count++;
719 } 719 }
720 720
721 /* Propogate the count up the 'totals' tree */ 721 /* Propagate the count up the 'totals' tree */
722 instance->counters.ue_count++; 722 instance->counters.ue_count++;
723 edac_dev->counters.ue_count++; 723 edac_dev->counters.ue_count++;
724 724
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 400de071cabc..86649df00285 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -533,7 +533,7 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
533 memset(&block->kobj, 0, sizeof(struct kobject)); 533 memset(&block->kobj, 0, sizeof(struct kobject));
534 534
535 /* bump the main kobject's reference count for this controller 535 /* bump the main kobject's reference count for this controller
536 * and this instance is dependant on the main 536 * and this instance is dependent on the main
537 */ 537 */
538 main_kobj = kobject_get(&edac_dev->kobj); 538 main_kobj = kobject_get(&edac_dev->kobj);
539 if (!main_kobj) { 539 if (!main_kobj) {
@@ -635,7 +635,7 @@ static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
635 instance->ctl = edac_dev; 635 instance->ctl = edac_dev;
636 636
637 /* bump the main kobject's reference count for this controller 637 /* bump the main kobject's reference count for this controller
638 * and this instance is dependant on the main 638 * and this instance is dependent on the main
639 */ 639 */
640 main_kobj = kobject_get(&edac_dev->kobj); 640 main_kobj = kobject_get(&edac_dev->kobj);
641 if (!main_kobj) { 641 if (!main_kobj) {
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index a4e9db2d6524..1d8056049072 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -724,7 +724,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci,
724 * Some MC's can remap memory so that it is still available 724 * Some MC's can remap memory so that it is still available
725 * at a different address when PCI devices map into memory. 725 * at a different address when PCI devices map into memory.
726 * MC's that can't do this lose the memory where PCI devices 726 * MC's that can't do this lose the memory where PCI devices
727 * are mapped. This mapping is MC dependant and so we call 727 * are mapped. This mapping is MC dependent and so we call
728 * back into the MC driver for it to map the MC page to 728 * back into the MC driver for it to map the MC page to
729 * a physical (CPU) page which can then be mapped to a virtual 729 * a physical (CPU) page which can then be mapped to a virtual
730 * page - which can then be scrubbed. 730 * page - which can then be scrubbed.
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 73196f7b7229..29ffa350bfbe 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -458,13 +458,13 @@ static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci,
458 return -EINVAL; 458 return -EINVAL;
459 459
460 new_bw = mci->set_sdram_scrub_rate(mci, bandwidth); 460 new_bw = mci->set_sdram_scrub_rate(mci, bandwidth);
461 if (new_bw >= 0) { 461 if (new_bw < 0) {
462 edac_printk(KERN_DEBUG, EDAC_MC, "Scrub rate set to %d\n", new_bw); 462 edac_printk(KERN_WARNING, EDAC_MC,
463 return count; 463 "Error setting scrub rate to: %lu\n", bandwidth);
464 return -EINVAL;
464 } 465 }
465 466
466 edac_printk(KERN_DEBUG, EDAC_MC, "Error setting scrub rate to: %lu\n", bandwidth); 467 return count;
467 return -EINVAL;
468} 468}
469 469
470/* 470/*
@@ -483,7 +483,6 @@ static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data)
483 return bandwidth; 483 return bandwidth;
484 } 484 }
485 485
486 edac_printk(KERN_DEBUG, EDAC_MC, "Read scrub rate: %d\n", bandwidth);
487 return sprintf(data, "%d\n", bandwidth); 486 return sprintf(data, "%d\n", bandwidth);
488} 487}
489 488
@@ -850,7 +849,7 @@ static void edac_remove_mci_instance_attributes(struct mem_ctl_info *mci,
850 849
851 /* 850 /*
852 * loop if there are attributes and until we hit a NULL entry 851 * loop if there are attributes and until we hit a NULL entry
853 * Remove first all the atributes 852 * Remove first all the attributes
854 */ 853 */
855 while (sysfs_attrib) { 854 while (sysfs_attrib) {
856 debugf4("%s() sysfs_attrib = %p\n",__func__, sysfs_attrib); 855 debugf4("%s() sysfs_attrib = %p\n",__func__, sysfs_attrib);
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 023b01cb5175..495198ad059c 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -352,7 +352,7 @@ static int edac_pci_main_kobj_setup(void)
352 return 0; 352 return 0;
353 353
354 /* First time, so create the main kobject and its 354 /* First time, so create the main kobject and its
355 * controls and atributes 355 * controls and attributes
356 */ 356 */
357 edac_class = edac_get_sysfs_class(); 357 edac_class = edac_get_sysfs_class();
358 if (edac_class == NULL) { 358 if (edac_class == NULL) {
@@ -551,7 +551,7 @@ static void edac_pci_dev_parity_clear(struct pci_dev *dev)
551/* 551/*
552 * PCI Parity polling 552 * PCI Parity polling
553 * 553 *
554 * Fucntion to retrieve the current parity status 554 * Function to retrieve the current parity status
555 * and decode it 555 * and decode it
556 * 556 *
557 */ 557 */
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c
index d41f9002da45..aa08497a075a 100644
--- a/drivers/edac/i3200_edac.c
+++ b/drivers/edac/i3200_edac.c
@@ -101,6 +101,19 @@ struct i3200_priv {
101 101
102static int nr_channels; 102static int nr_channels;
103 103
104#ifndef readq
105static inline __u64 readq(const volatile void __iomem *addr)
106{
107 const volatile u32 __iomem *p = addr;
108 u32 low, high;
109
110 low = readl(p);
111 high = readl(p + 1);
112
113 return low + ((u64)high << 32);
114}
115#endif
116
104static int how_many_channels(struct pci_dev *pdev) 117static int how_many_channels(struct pci_dev *pdev)
105{ 118{
106 unsigned char capid0_8b; /* 8th byte of CAPID0 */ 119 unsigned char capid0_8b; /* 8th byte of CAPID0 */
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c
index 3d0b726304fe..4dc3ac25a422 100644
--- a/drivers/edac/i5000_edac.c
+++ b/drivers/edac/i5000_edac.c
@@ -1372,7 +1372,7 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx)
1372 * actual number of slots/dimms per channel, we thus utilize the 1372 * actual number of slots/dimms per channel, we thus utilize the
1373 * resource as specified by the chipset. Thus, we might have 1373 * resource as specified by the chipset. Thus, we might have
1374 * have more DIMMs per channel than actually on the mobo, but this 1374 * have more DIMMs per channel than actually on the mobo, but this
1375 * allows the driver to support upto the chipset max, without 1375 * allows the driver to support up to the chipset max, without
1376 * some fancy mobo determination. 1376 * some fancy mobo determination.
1377 */ 1377 */
1378 i5000_get_dimm_and_channel_counts(pdev, &num_dimms_per_channel, 1378 i5000_get_dimm_and_channel_counts(pdev, &num_dimms_per_channel,
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
index 0448da0af75d..bcbdeeca48b8 100644
--- a/drivers/edac/i5100_edac.c
+++ b/drivers/edac/i5100_edac.c
@@ -11,7 +11,7 @@
11 * 11 *
12 * The intel 5100 has two independent channels. EDAC core currently 12 * The intel 5100 has two independent channels. EDAC core currently
13 * can not reflect this configuration so instead the chip-select 13 * can not reflect this configuration so instead the chip-select
14 * rows for each respective channel are layed out one after another, 14 * rows for each respective channel are laid out one after another,
15 * the first half belonging to channel 0, the second half belonging 15 * the first half belonging to channel 0, the second half belonging
16 * to channel 1. 16 * to channel 1.
17 */ 17 */
diff --git a/drivers/edac/i5400_edac.c b/drivers/edac/i5400_edac.c
index fd362b4c2a8e..74d6ec342afb 100644
--- a/drivers/edac/i5400_edac.c
+++ b/drivers/edac/i5400_edac.c
@@ -648,7 +648,7 @@ static void i5400_process_nonfatal_error_info(struct mem_ctl_info *mci,
648 return; 648 return;
649 } 649 }
650 650
651 /* Miscelaneous errors */ 651 /* Miscellaneous errors */
652 errnum = find_first_bit(&allErrors, ARRAY_SIZE(error_name)); 652 errnum = find_first_bit(&allErrors, ARRAY_SIZE(error_name));
653 653
654 branch = extract_fbdchan_indx(info->ferr_nf_fbd); 654 branch = extract_fbdchan_indx(info->ferr_nf_fbd);
@@ -1240,7 +1240,7 @@ static int i5400_probe1(struct pci_dev *pdev, int dev_idx)
1240 * actual number of slots/dimms per channel, we thus utilize the 1240 * actual number of slots/dimms per channel, we thus utilize the
1241 * resource as specified by the chipset. Thus, we might have 1241 * resource as specified by the chipset. Thus, we might have
1242 * have more DIMMs per channel than actually on the mobo, but this 1242 * have more DIMMs per channel than actually on the mobo, but this
1243 * allows the driver to support upto the chipset max, without 1243 * allows the driver to support up to the chipset max, without
1244 * some fancy mobo determination. 1244 * some fancy mobo determination.
1245 */ 1245 */
1246 num_dimms_per_channel = MAX_DIMMS_PER_CHANNEL; 1246 num_dimms_per_channel = MAX_DIMMS_PER_CHANNEL;
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
index ff320c0b9cac..a76fe8366b68 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
@@ -1065,7 +1065,7 @@ static int __devinit i7300_init_one(struct pci_dev *pdev,
1065 * actual number of slots/dimms per channel, we thus utilize the 1065 * actual number of slots/dimms per channel, we thus utilize the
1066 * resource as specified by the chipset. Thus, we might have 1066 * resource as specified by the chipset. Thus, we might have
1067 * have more DIMMs per channel than actually on the mobo, but this 1067 * have more DIMMs per channel than actually on the mobo, but this
1068 * allows the driver to support upto the chipset max, without 1068 * allows the driver to support up to the chipset max, without
1069 * some fancy mobo determination. 1069 * some fancy mobo determination.
1070 */ 1070 */
1071 num_dimms_per_channel = MAX_SLOTS; 1071 num_dimms_per_channel = MAX_SLOTS;
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 3f320ba5445f..04f1e7ce02b1 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1772,7 +1772,7 @@ static void i7core_check_error(struct mem_ctl_info *mci)
1772 /* 1772 /*
1773 * MCE first step: Copy all mce errors into a temporary buffer 1773 * MCE first step: Copy all mce errors into a temporary buffer
1774 * We use a double buffering here, to reduce the risk of 1774 * We use a double buffering here, to reduce the risk of
1775 * loosing an error. 1775 * losing an error.
1776 */ 1776 */
1777 smp_rmb(); 1777 smp_rmb();
1778 count = (pvt->mce_out + MCE_LOG_LEN - pvt->mce_in) 1778 count = (pvt->mce_out + MCE_LOG_LEN - pvt->mce_in)
diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c
index 678405ab04e4..4329d39f902c 100644
--- a/drivers/edac/i82443bxgx_edac.c
+++ b/drivers/edac/i82443bxgx_edac.c
@@ -203,7 +203,7 @@ static void i82443bxgx_init_csrows(struct mem_ctl_info *mci,
203 row_high_limit = ((u32) drbar << 23); 203 row_high_limit = ((u32) drbar << 23);
204 /* find the DRAM Chip Select Base address and mask */ 204 /* find the DRAM Chip Select Base address and mask */
205 debugf1("MC%d: %s: %s() Row=%d, " 205 debugf1("MC%d: %s: %s() Row=%d, "
206 "Boundry Address=%#0x, Last = %#0x\n", 206 "Boundary Address=%#0x, Last = %#0x\n",
207 mci->mc_idx, __FILE__, __func__, index, row_high_limit, 207 mci->mc_idx, __FILE__, __func__, index, row_high_limit,
208 row_high_limit_last); 208 row_high_limit_last);
209 209
@@ -305,7 +305,7 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
305 i82443bxgx_init_csrows(mci, pdev, edac_mode, mtype); 305 i82443bxgx_init_csrows(mci, pdev, edac_mode, mtype);
306 306
307 /* Many BIOSes don't clear error flags on boot, so do this 307 /* Many BIOSes don't clear error flags on boot, so do this
308 * here, or we get "phantom" errors occuring at module-load 308 * here, or we get "phantom" errors occurring at module-load
309 * time. */ 309 * time. */
310 pci_write_bits32(pdev, I82443BXGX_EAP, 310 pci_write_bits32(pdev, I82443BXGX_EAP,
311 (I82443BXGX_EAP_OFFSET_SBE | 311 (I82443BXGX_EAP_OFFSET_SBE |
diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c
index 733a7e7a8d6f..a4987e03f59e 100644
--- a/drivers/edac/mce_amd_inj.c
+++ b/drivers/edac/mce_amd_inj.c
@@ -90,7 +90,7 @@ static ssize_t edac_inject_bank_store(struct kobject *kobj,
90 90
91 if (value > 5) 91 if (value > 5)
92 if (boot_cpu_data.x86 != 0x15 || value > 6) { 92 if (boot_cpu_data.x86 != 0x15 || value > 6) {
93 printk(KERN_ERR "Non-existant MCE bank: %lu\n", value); 93 printk(KERN_ERR "Non-existent MCE bank: %lu\n", value);
94 return -EINVAL; 94 return -EINVAL;
95 } 95 }
96 96
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index ffb5ad080bee..38ab8e2cd7f4 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -1147,13 +1147,14 @@ static struct platform_driver mpc85xx_mc_err_driver = {
1147static void __init mpc85xx_mc_clear_rfxe(void *data) 1147static void __init mpc85xx_mc_clear_rfxe(void *data)
1148{ 1148{
1149 orig_hid1[smp_processor_id()] = mfspr(SPRN_HID1); 1149 orig_hid1[smp_processor_id()] = mfspr(SPRN_HID1);
1150 mtspr(SPRN_HID1, (orig_hid1[smp_processor_id()] & ~0x20000)); 1150 mtspr(SPRN_HID1, (orig_hid1[smp_processor_id()] & ~HID1_RFXE));
1151} 1151}
1152#endif 1152#endif
1153 1153
1154static int __init mpc85xx_mc_init(void) 1154static int __init mpc85xx_mc_init(void)
1155{ 1155{
1156 int res = 0; 1156 int res = 0;
1157 u32 pvr = 0;
1157 1158
1158 printk(KERN_INFO "Freescale(R) MPC85xx EDAC driver, " 1159 printk(KERN_INFO "Freescale(R) MPC85xx EDAC driver, "
1159 "(C) 2006 Montavista Software\n"); 1160 "(C) 2006 Montavista Software\n");
@@ -1183,12 +1184,17 @@ static int __init mpc85xx_mc_init(void)
1183#endif 1184#endif
1184 1185
1185#ifdef CONFIG_FSL_SOC_BOOKE 1186#ifdef CONFIG_FSL_SOC_BOOKE
1186 /* 1187 pvr = mfspr(SPRN_PVR);
1187 * need to clear HID1[RFXE] to disable machine check int 1188
1188 * so we can catch it 1189 if ((PVR_VER(pvr) == PVR_VER_E500V1) ||
1189 */ 1190 (PVR_VER(pvr) == PVR_VER_E500V2)) {
1190 if (edac_op_state == EDAC_OPSTATE_INT) 1191 /*
1191 on_each_cpu(mpc85xx_mc_clear_rfxe, NULL, 0); 1192 * need to clear HID1[RFXE] to disable machine check int
1193 * so we can catch it
1194 */
1195 if (edac_op_state == EDAC_OPSTATE_INT)
1196 on_each_cpu(mpc85xx_mc_clear_rfxe, NULL, 0);
1197 }
1192#endif 1198#endif
1193 1199
1194 return 0; 1200 return 0;
@@ -1206,7 +1212,12 @@ static void __exit mpc85xx_mc_restore_hid1(void *data)
1206static void __exit mpc85xx_mc_exit(void) 1212static void __exit mpc85xx_mc_exit(void)
1207{ 1213{
1208#ifdef CONFIG_FSL_SOC_BOOKE 1214#ifdef CONFIG_FSL_SOC_BOOKE
1209 on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0); 1215 u32 pvr = mfspr(SPRN_PVR);
1216
1217 if ((PVR_VER(pvr) == PVR_VER_E500V1) ||
1218 (PVR_VER(pvr) == PVR_VER_E500V2)) {
1219 on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
1220 }
1210#endif 1221#endif
1211#ifdef CONFIG_PCI 1222#ifdef CONFIG_PCI
1212 platform_driver_unregister(&mpc85xx_pci_err_driver); 1223 platform_driver_unregister(&mpc85xx_pci_err_driver);
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c
index 208244e4a6f2..0de7d8770891 100644
--- a/drivers/edac/ppc4xx_edac.c
+++ b/drivers/edac/ppc4xx_edac.c
@@ -1019,7 +1019,7 @@ ppc4xx_edac_mc_init(struct mem_ctl_info *mci,
1019 struct ppc4xx_edac_pdata *pdata = NULL; 1019 struct ppc4xx_edac_pdata *pdata = NULL;
1020 const struct device_node *np = op->dev.of_node; 1020 const struct device_node *np = op->dev.of_node;
1021 1021
1022 if (op->dev.of_match == NULL) 1022 if (of_match_device(ppc4xx_edac_match, &op->dev) == NULL)
1023 return -EINVAL; 1023 return -EINVAL;
1024 1024
1025 /* Initial driver pointers and private data */ 1025 /* Initial driver pointers and private data */
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index 387997a3fab5..b153674431f1 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -120,7 +120,7 @@
120 * write 0=NOP 120 * write 0=NOP
121 */ 121 */
122 122
123#define R82600_DRBA 0x60 /* + 0x60..0x63 SDRAM Row Boundry Address 123#define R82600_DRBA 0x60 /* + 0x60..0x63 SDRAM Row Boundary Address
124 * Registers 124 * Registers
125 * 125 *
126 * 7:0 Address lines 30:24 - upper limit of 126 * 7:0 Address lines 30:24 - upper limit of
@@ -217,7 +217,7 @@ static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
217{ 217{
218 struct csrow_info *csrow; 218 struct csrow_info *csrow;
219 int index; 219 int index;
220 u8 drbar; /* SDRAM Row Boundry Address Register */ 220 u8 drbar; /* SDRAM Row Boundary Address Register */
221 u32 row_high_limit, row_high_limit_last; 221 u32 row_high_limit, row_high_limit_last;
222 u32 reg_sdram, ecc_on, row_base; 222 u32 reg_sdram, ecc_on, row_base;
223 223
@@ -236,7 +236,7 @@ static void r82600_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev,
236 row_high_limit = ((u32) drbar << 24); 236 row_high_limit = ((u32) drbar << 24);
237/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */ 237/* row_high_limit = ((u32)drbar << 24) | 0xffffffUL; */
238 238
239 debugf1("%s() Row=%d, Boundry Address=%#0x, Last = %#0x\n", 239 debugf1("%s() Row=%d, Boundary Address=%#0x, Last = %#0x\n",
240 __func__, index, row_high_limit, row_high_limit_last); 240 __func__, index, row_high_limit, row_high_limit_last);
241 241
242 /* Empty row [p.57] */ 242 /* Empty row [p.57] */