aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 20:59:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 20:59:47 -0400
commitdae430c6f6e5d0b98c238c340a41a39e221e8940 (patch)
tree20bdd49b142bd006cf7f81cf1a09fde811a43581 /drivers/edac
parentcf821923ba9aa0917165a12573bdd6dc0a354421 (diff)
parentebe2aea86872622d4352cd71d55298fedf69a7bb (diff)
Merge tag 'amd64-edac-updates-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Pull AMD64 EDAC fixes from Borislav Petkov: "A bunch of fixes/updates for the AMD side of EDAC including * MCE decoding updates * tree-wide EDAC sweep making pci_device_ids __devinitconst * Scrub rate API correction * two amd64_edac corrections for K8 boxes and sysfs csrow nodes" * tag 'amd64-edac-updates-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: MCE, AMD: Constify error tables MCE, AMD: Correct bank 5 error signatures MCE, AMD: Rework NB MCE signatures MCE, AMD: Correct VB data error description MCE, AMD: Correct ucode patch buffer description MCE, AMD: Correct some MC0 error types EDAC: Make pci_device_id tables __devinitconst. EDAC: Correct scrub rate API amd64_edac: Fix K8 revD and later chip select sizes amd64_edac: Fix missing csrows sysfs nodes
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/amd64_edac.c50
-rw-r--r--drivers/edac/amd76x_edac.c2
-rw-r--r--drivers/edac/e752x_edac.c2
-rw-r--r--drivers/edac/e7xxx_edac.c2
-rw-r--r--drivers/edac/edac_mc_sysfs.c4
-rw-r--r--drivers/edac/i3000_edac.c2
-rw-r--r--drivers/edac/i3200_edac.c2
-rw-r--r--drivers/edac/i5000_edac.c2
-rw-r--r--drivers/edac/i5100_edac.c2
-rw-r--r--drivers/edac/i5400_edac.c2
-rw-r--r--drivers/edac/i7300_edac.c2
-rw-r--r--drivers/edac/i7core_edac.c2
-rw-r--r--drivers/edac/i82443bxgx_edac.c2
-rw-r--r--drivers/edac/i82860_edac.c2
-rw-r--r--drivers/edac/i82875p_edac.c2
-rw-r--r--drivers/edac/i82975x_edac.c2
-rw-r--r--drivers/edac/mce_amd.c208
-rw-r--r--drivers/edac/mce_amd.h13
-rw-r--r--drivers/edac/r82600_edac.c2
-rw-r--r--drivers/edac/sb_edac.c2
-rw-r--r--drivers/edac/x38_edac.c2
21 files changed, 125 insertions, 184 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index c9eee6d33e9a..7ef73c919c5d 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1132,12 +1132,36 @@ static int k8_dbam_to_chip_select(struct amd64_pvt *pvt, u8 dct,
1132 return ddr2_cs_size(cs_mode, dclr & WIDTH_128); 1132 return ddr2_cs_size(cs_mode, dclr & WIDTH_128);
1133 } 1133 }
1134 else if (pvt->ext_model >= K8_REV_D) { 1134 else if (pvt->ext_model >= K8_REV_D) {
1135 unsigned diff;
1135 WARN_ON(cs_mode > 10); 1136 WARN_ON(cs_mode > 10);
1136 1137
1137 if (cs_mode == 3 || cs_mode == 8) 1138 /*
1138 return 32 << (cs_mode - 1); 1139 * the below calculation, besides trying to win an obfuscated C
1139 else 1140 * contest, maps cs_mode values to DIMM chip select sizes. The
1140 return 32 << cs_mode; 1141 * mappings are:
1142 *
1143 * cs_mode CS size (mb)
1144 * ======= ============
1145 * 0 32
1146 * 1 64
1147 * 2 128
1148 * 3 128
1149 * 4 256
1150 * 5 512
1151 * 6 256
1152 * 7 512
1153 * 8 1024
1154 * 9 1024
1155 * 10 2048
1156 *
1157 * Basically, it calculates a value with which to shift the
1158 * smallest CS size of 32MB.
1159 *
1160 * ddr[23]_cs_size have a similar purpose.
1161 */
1162 diff = cs_mode/3 + (unsigned)(cs_mode > 5);
1163
1164 return 32 << (cs_mode - diff);
1141 } 1165 }
1142 else { 1166 else {
1143 WARN_ON(cs_mode > 6); 1167 WARN_ON(cs_mode > 6);
@@ -2133,6 +2157,7 @@ static void read_mc_regs(struct amd64_pvt *pvt)
2133static u32 amd64_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr) 2157static u32 amd64_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr)
2134{ 2158{
2135 u32 cs_mode, nr_pages; 2159 u32 cs_mode, nr_pages;
2160 u32 dbam = dct ? pvt->dbam1 : pvt->dbam0;
2136 2161
2137 /* 2162 /*
2138 * The math on this doesn't look right on the surface because x/2*4 can 2163 * The math on this doesn't look right on the surface because x/2*4 can
@@ -2141,16 +2166,10 @@ static u32 amd64_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr)
2141 * number of bits to shift the DBAM register to extract the proper CSROW 2166 * number of bits to shift the DBAM register to extract the proper CSROW
2142 * field. 2167 * field.
2143 */ 2168 */
2144 cs_mode = (pvt->dbam0 >> ((csrow_nr / 2) * 4)) & 0xF; 2169 cs_mode = (dbam >> ((csrow_nr / 2) * 4)) & 0xF;
2145 2170
2146 nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode) << (20 - PAGE_SHIFT); 2171 nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode) << (20 - PAGE_SHIFT);
2147 2172
2148 /*
2149 * If dual channel then double the memory size of single channel.
2150 * Channel count is 1 or 2
2151 */
2152 nr_pages <<= (pvt->channel_count - 1);
2153
2154 debugf0(" (csrow=%d) DBAM map index= %d\n", csrow_nr, cs_mode); 2173 debugf0(" (csrow=%d) DBAM map index= %d\n", csrow_nr, cs_mode);
2155 debugf0(" nr_pages= %u channel-count = %d\n", 2174 debugf0(" nr_pages= %u channel-count = %d\n",
2156 nr_pages, pvt->channel_count); 2175 nr_pages, pvt->channel_count);
@@ -2181,7 +2200,7 @@ static int init_csrows(struct mem_ctl_info *mci)
2181 for_each_chip_select(i, 0, pvt) { 2200 for_each_chip_select(i, 0, pvt) {
2182 csrow = &mci->csrows[i]; 2201 csrow = &mci->csrows[i];
2183 2202
2184 if (!csrow_enabled(i, 0, pvt)) { 2203 if (!csrow_enabled(i, 0, pvt) && !csrow_enabled(i, 1, pvt)) {
2185 debugf1("----CSROW %d EMPTY for node %d\n", i, 2204 debugf1("----CSROW %d EMPTY for node %d\n", i,
2186 pvt->mc_node_id); 2205 pvt->mc_node_id);
2187 continue; 2206 continue;
@@ -2191,7 +2210,10 @@ static int init_csrows(struct mem_ctl_info *mci)
2191 i, pvt->mc_node_id); 2210 i, pvt->mc_node_id);
2192 2211
2193 empty = 0; 2212 empty = 0;
2194 csrow->nr_pages = amd64_csrow_nr_pages(pvt, 0, i); 2213 if (csrow_enabled(i, 0, pvt))
2214 csrow->nr_pages = amd64_csrow_nr_pages(pvt, 0, i);
2215 if (csrow_enabled(i, 1, pvt))
2216 csrow->nr_pages += amd64_csrow_nr_pages(pvt, 1, i);
2195 find_csrow_limits(mci, i, &input_addr_min, &input_addr_max); 2217 find_csrow_limits(mci, i, &input_addr_min, &input_addr_max);
2196 sys_addr = input_addr_to_sys_addr(mci, input_addr_min); 2218 sys_addr = input_addr_to_sys_addr(mci, input_addr_min);
2197 csrow->first_page = (u32) (sys_addr >> PAGE_SHIFT); 2219 csrow->first_page = (u32) (sys_addr >> PAGE_SHIFT);
@@ -2685,7 +2707,7 @@ static void __devexit amd64_remove_one_instance(struct pci_dev *pdev)
2685 * PCI core identifies what devices are on a system during boot, and then 2707 * PCI core identifies what devices are on a system during boot, and then
2686 * inquiry this table to see if this driver is for a given device found. 2708 * inquiry this table to see if this driver is for a given device found.
2687 */ 2709 */
2688static const struct pci_device_id amd64_pci_table[] __devinitdata = { 2710static DEFINE_PCI_DEVICE_TABLE(amd64_pci_table) = {
2689 { 2711 {
2690 .vendor = PCI_VENDOR_ID_AMD, 2712 .vendor = PCI_VENDOR_ID_AMD,
2691 .device = PCI_DEVICE_ID_AMD_K8_NB_MEMCTL, 2713 .device = PCI_DEVICE_ID_AMD_K8_NB_MEMCTL,
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c
index e47e73bbbcc5..f8fd3c807bde 100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
@@ -321,7 +321,7 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
321 edac_mc_free(mci); 321 edac_mc_free(mci);
322} 322}
323 323
324static const struct pci_device_id amd76x_pci_tbl[] __devinitdata = { 324static DEFINE_PCI_DEVICE_TABLE(amd76x_pci_tbl) = {
325 { 325 {
326 PCI_VEND_DEV(AMD, FE_GATE_700C), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 326 PCI_VEND_DEV(AMD, FE_GATE_700C), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
327 AMD762}, 327 AMD762},
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 1af531a11d21..41223261ede9 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -1380,7 +1380,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev)
1380 edac_mc_free(mci); 1380 edac_mc_free(mci);
1381} 1381}
1382 1382
1383static const struct pci_device_id e752x_pci_tbl[] __devinitdata = { 1383static DEFINE_PCI_DEVICE_TABLE(e752x_pci_tbl) = {
1384 { 1384 {
1385 PCI_VEND_DEV(INTEL, 7520_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1385 PCI_VEND_DEV(INTEL, 7520_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1386 E7520}, 1386 E7520},
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
index 6ffb6d23281f..68dea87b72e6 100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
@@ -525,7 +525,7 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
525 edac_mc_free(mci); 525 edac_mc_free(mci);
526} 526}
527 527
528static const struct pci_device_id e7xxx_pci_tbl[] __devinitdata = { 528static DEFINE_PCI_DEVICE_TABLE(e7xxx_pci_tbl) = {
529 { 529 {
530 PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 530 PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
531 E7205}, 531 E7205},
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index d56e63477d5c..e9a28f576d14 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -452,7 +452,7 @@ static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci,
452 int new_bw = 0; 452 int new_bw = 0;
453 453
454 if (!mci->set_sdram_scrub_rate) 454 if (!mci->set_sdram_scrub_rate)
455 return -EINVAL; 455 return -ENODEV;
456 456
457 if (strict_strtoul(data, 10, &bandwidth) < 0) 457 if (strict_strtoul(data, 10, &bandwidth) < 0)
458 return -EINVAL; 458 return -EINVAL;
@@ -475,7 +475,7 @@ static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data)
475 int bandwidth = 0; 475 int bandwidth = 0;
476 476
477 if (!mci->get_sdram_scrub_rate) 477 if (!mci->get_sdram_scrub_rate)
478 return -EINVAL; 478 return -ENODEV;
479 479
480 bandwidth = mci->get_sdram_scrub_rate(mci); 480 bandwidth = mci->get_sdram_scrub_rate(mci);
481 if (bandwidth < 0) { 481 if (bandwidth < 0) {
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c
index c0510b3d7035..277689a68841 100644
--- a/drivers/edac/i3000_edac.c
+++ b/drivers/edac/i3000_edac.c
@@ -470,7 +470,7 @@ static void __devexit i3000_remove_one(struct pci_dev *pdev)
470 edac_mc_free(mci); 470 edac_mc_free(mci);
471} 471}
472 472
473static const struct pci_device_id i3000_pci_tbl[] __devinitdata = { 473static DEFINE_PCI_DEVICE_TABLE(i3000_pci_tbl) = {
474 { 474 {
475 PCI_VEND_DEV(INTEL, 3000_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 475 PCI_VEND_DEV(INTEL, 3000_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
476 I3000}, 476 I3000},
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c
index 73f55e2008c2..046808c6357d 100644
--- a/drivers/edac/i3200_edac.c
+++ b/drivers/edac/i3200_edac.c
@@ -445,7 +445,7 @@ static void __devexit i3200_remove_one(struct pci_dev *pdev)
445 edac_mc_free(mci); 445 edac_mc_free(mci);
446} 446}
447 447
448static const struct pci_device_id i3200_pci_tbl[] __devinitdata = { 448static DEFINE_PCI_DEVICE_TABLE(i3200_pci_tbl) = {
449 { 449 {
450 PCI_VEND_DEV(INTEL, 3200_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 450 PCI_VEND_DEV(INTEL, 3200_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
451 I3200}, 451 I3200},
diff --git a/drivers/edac/i5000_edac.c b/drivers/edac/i5000_edac.c
index 4dc3ac25a422..a2680d8e744b 100644
--- a/drivers/edac/i5000_edac.c
+++ b/drivers/edac/i5000_edac.c
@@ -1516,7 +1516,7 @@ static void __devexit i5000_remove_one(struct pci_dev *pdev)
1516 * 1516 *
1517 * The "E500P" device is the first device supported. 1517 * The "E500P" device is the first device supported.
1518 */ 1518 */
1519static const struct pci_device_id i5000_pci_tbl[] __devinitdata = { 1519static DEFINE_PCI_DEVICE_TABLE(i5000_pci_tbl) = {
1520 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000_DEV16), 1520 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000_DEV16),
1521 .driver_data = I5000P}, 1521 .driver_data = I5000P},
1522 1522
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
index bcbdeeca48b8..2e23547b2f24 100644
--- a/drivers/edac/i5100_edac.c
+++ b/drivers/edac/i5100_edac.c
@@ -1051,7 +1051,7 @@ static void __devexit i5100_remove_one(struct pci_dev *pdev)
1051 edac_mc_free(mci); 1051 edac_mc_free(mci);
1052} 1052}
1053 1053
1054static const struct pci_device_id i5100_pci_tbl[] __devinitdata = { 1054static DEFINE_PCI_DEVICE_TABLE(i5100_pci_tbl) = {
1055 /* Device 16, Function 0, Channel 0 Memory Map, Error Flag/Mask, ... */ 1055 /* Device 16, Function 0, Channel 0 Memory Map, Error Flag/Mask, ... */
1056 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5100_16) }, 1056 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5100_16) },
1057 { 0, } 1057 { 0, }
diff --git a/drivers/edac/i5400_edac.c b/drivers/edac/i5400_edac.c
index 74d6ec342afb..67ec9626a330 100644
--- a/drivers/edac/i5400_edac.c
+++ b/drivers/edac/i5400_edac.c
@@ -1383,7 +1383,7 @@ static void __devexit i5400_remove_one(struct pci_dev *pdev)
1383 * 1383 *
1384 * The "E500P" device is the first device supported. 1384 * The "E500P" device is the first device supported.
1385 */ 1385 */
1386static const struct pci_device_id i5400_pci_tbl[] __devinitdata = { 1386static DEFINE_PCI_DEVICE_TABLE(i5400_pci_tbl) = {
1387 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_ERR)}, 1387 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_ERR)},
1388 {0,} /* 0 terminated list. */ 1388 {0,} /* 0 terminated list. */
1389}; 1389};
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
index 6104dba380b6..3bafa3bca148 100644
--- a/drivers/edac/i7300_edac.c
+++ b/drivers/edac/i7300_edac.c
@@ -1192,7 +1192,7 @@ static void __devexit i7300_remove_one(struct pci_dev *pdev)
1192 * 1192 *
1193 * Has only 8086:360c PCI ID 1193 * Has only 8086:360c PCI ID
1194 */ 1194 */
1195static const struct pci_device_id i7300_pci_tbl[] __devinitdata = { 1195static DEFINE_PCI_DEVICE_TABLE(i7300_pci_tbl) = {
1196 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I7300_MCH_ERR)}, 1196 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I7300_MCH_ERR)},
1197 {0,} /* 0 terminated list. */ 1197 {0,} /* 0 terminated list. */
1198}; 1198};
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 8568d9b61875..85226ccf5290 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -391,7 +391,7 @@ static const struct pci_id_table pci_dev_table[] = {
391/* 391/*
392 * pci_device_id table for which devices we are looking for 392 * pci_device_id table for which devices we are looking for
393 */ 393 */
394static const struct pci_device_id i7core_pci_tbl[] __devinitdata = { 394static DEFINE_PCI_DEVICE_TABLE(i7core_pci_tbl) = {
395 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_X58_HUB_MGMT)}, 395 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_X58_HUB_MGMT)},
396 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNNFIELD_QPI_LINK0)}, 396 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNNFIELD_QPI_LINK0)},
397 {0,} /* 0 terminated list. */ 397 {0,} /* 0 terminated list. */
diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c
index 4329d39f902c..3bf2b2f490e7 100644
--- a/drivers/edac/i82443bxgx_edac.c
+++ b/drivers/edac/i82443bxgx_edac.c
@@ -380,7 +380,7 @@ static void __devexit i82443bxgx_edacmc_remove_one(struct pci_dev *pdev)
380 380
381EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_remove_one); 381EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_remove_one);
382 382
383static const struct pci_device_id i82443bxgx_pci_tbl[] __devinitdata = { 383static DEFINE_PCI_DEVICE_TABLE(i82443bxgx_pci_tbl) = {
384 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_0)}, 384 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_0)},
385 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2)}, 385 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2)},
386 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0)}, 386 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0)},
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c
index 931a05775049..c779092d18d1 100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
@@ -270,7 +270,7 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev)
270 edac_mc_free(mci); 270 edac_mc_free(mci);
271} 271}
272 272
273static const struct pci_device_id i82860_pci_tbl[] __devinitdata = { 273static DEFINE_PCI_DEVICE_TABLE(i82860_pci_tbl) = {
274 { 274 {
275 PCI_VEND_DEV(INTEL, 82860_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 275 PCI_VEND_DEV(INTEL, 82860_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
276 I82860}, 276 I82860},
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 33864c63c684..10f15d85fb5e 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -511,7 +511,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev)
511 edac_mc_free(mci); 511 edac_mc_free(mci);
512} 512}
513 513
514static const struct pci_device_id i82875p_pci_tbl[] __devinitdata = { 514static DEFINE_PCI_DEVICE_TABLE(i82875p_pci_tbl) = {
515 { 515 {
516 PCI_VEND_DEV(INTEL, 82875_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 516 PCI_VEND_DEV(INTEL, 82875_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
517 I82875P}, 517 I82875P},
diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c
index 4184e0171f00..0cd8368f88f8 100644
--- a/drivers/edac/i82975x_edac.c
+++ b/drivers/edac/i82975x_edac.c
@@ -612,7 +612,7 @@ static void __devexit i82975x_remove_one(struct pci_dev *pdev)
612 edac_mc_free(mci); 612 edac_mc_free(mci);
613} 613}
614 614
615static const struct pci_device_id i82975x_pci_tbl[] __devinitdata = { 615static DEFINE_PCI_DEVICE_TABLE(i82975x_pci_tbl) = {
616 { 616 {
617 PCI_VEND_DEV(INTEL, 82975_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 617 PCI_VEND_DEV(INTEL, 82975_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
618 I82975X 618 I82975X
diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index bd926ea2e00c..36e1486eb9aa 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -39,42 +39,31 @@ EXPORT_SYMBOL_GPL(amd_unregister_ecc_decoder);
39 */ 39 */
40 40
41/* transaction type */ 41/* transaction type */
42const char *tt_msgs[] = { "INSN", "DATA", "GEN", "RESV" }; 42const char * const tt_msgs[] = { "INSN", "DATA", "GEN", "RESV" };
43EXPORT_SYMBOL_GPL(tt_msgs); 43EXPORT_SYMBOL_GPL(tt_msgs);
44 44
45/* cache level */ 45/* cache level */
46const char *ll_msgs[] = { "RESV", "L1", "L2", "L3/GEN" }; 46const char * const ll_msgs[] = { "RESV", "L1", "L2", "L3/GEN" };
47EXPORT_SYMBOL_GPL(ll_msgs); 47EXPORT_SYMBOL_GPL(ll_msgs);
48 48
49/* memory transaction type */ 49/* memory transaction type */
50const char *rrrr_msgs[] = { 50const char * const rrrr_msgs[] = {
51 "GEN", "RD", "WR", "DRD", "DWR", "IRD", "PRF", "EV", "SNP" 51 "GEN", "RD", "WR", "DRD", "DWR", "IRD", "PRF", "EV", "SNP"
52}; 52};
53EXPORT_SYMBOL_GPL(rrrr_msgs); 53EXPORT_SYMBOL_GPL(rrrr_msgs);
54 54
55/* participating processor */ 55/* participating processor */
56const char *pp_msgs[] = { "SRC", "RES", "OBS", "GEN" }; 56const char * const pp_msgs[] = { "SRC", "RES", "OBS", "GEN" };
57EXPORT_SYMBOL_GPL(pp_msgs); 57EXPORT_SYMBOL_GPL(pp_msgs);
58 58
59/* request timeout */ 59/* request timeout */
60const char *to_msgs[] = { "no timeout", "timed out" }; 60const char * const to_msgs[] = { "no timeout", "timed out" };
61EXPORT_SYMBOL_GPL(to_msgs); 61EXPORT_SYMBOL_GPL(to_msgs);
62 62
63/* memory or i/o */ 63/* memory or i/o */
64const char *ii_msgs[] = { "MEM", "RESV", "IO", "GEN" }; 64const char * const ii_msgs[] = { "MEM", "RESV", "IO", "GEN" };
65EXPORT_SYMBOL_GPL(ii_msgs); 65EXPORT_SYMBOL_GPL(ii_msgs);
66 66
67static const char *f10h_nb_mce_desc[] = {
68 "HT link data error",
69 "Protocol error (link, L3, probe filter, etc.)",
70 "Parity error in NB-internal arrays",
71 "Link Retry due to IO link transmission error",
72 "L3 ECC data cache error",
73 "ECC error in L3 cache tag",
74 "L3 LRU parity bits error",
75 "ECC Error in the Probe Filter directory"
76};
77
78static const char * const f15h_ic_mce_desc[] = { 67static const char * const f15h_ic_mce_desc[] = {
79 "UC during a demand linefill from L2", 68 "UC during a demand linefill from L2",
80 "Parity error during data load from IC", 69 "Parity error during data load from IC",
@@ -88,7 +77,7 @@ static const char * const f15h_ic_mce_desc[] = {
88 "Parity error for IC probe tag valid bit", 77 "Parity error for IC probe tag valid bit",
89 "PFB non-cacheable bit parity error", 78 "PFB non-cacheable bit parity error",
90 "PFB valid bit parity error", /* xec = 0xd */ 79 "PFB valid bit parity error", /* xec = 0xd */
91 "patch RAM", /* xec = 010 */ 80 "Microcode Patch Buffer", /* xec = 010 */
92 "uop queue", 81 "uop queue",
93 "insn buffer", 82 "insn buffer",
94 "predecode buffer", 83 "predecode buffer",
@@ -104,7 +93,7 @@ static const char * const f15h_cu_mce_desc[] = {
104 "WCC Tag ECC error", 93 "WCC Tag ECC error",
105 "WCC Data ECC error", 94 "WCC Data ECC error",
106 "WCB Data parity error", 95 "WCB Data parity error",
107 "VB Data/ECC error", 96 "VB Data ECC or parity error",
108 "L2 Tag ECC error", /* xec = 0x10 */ 97 "L2 Tag ECC error", /* xec = 0x10 */
109 "Hard L2 Tag ECC error", 98 "Hard L2 Tag ECC error",
110 "Multiple hits on L2 tag", 99 "Multiple hits on L2 tag",
@@ -112,6 +101,28 @@ static const char * const f15h_cu_mce_desc[] = {
112 "PRB address parity error" 101 "PRB address parity error"
113}; 102};
114 103
104static const char * const nb_mce_desc[] = {
105 "DRAM ECC error detected on the NB",
106 "CRC error detected on HT link",
107 "Link-defined sync error packets detected on HT link",
108 "HT Master abort",
109 "HT Target abort",
110 "Invalid GART PTE entry during GART table walk",
111 "Unsupported atomic RMW received from an IO link",
112 "Watchdog timeout due to lack of progress",
113 "DRAM ECC error detected on the NB",
114 "SVM DMA Exclusion Vector error",
115 "HT data error detected on link",
116 "Protocol error (link, L3, probe filter)",
117 "NB internal arrays parity error",
118 "DRAM addr/ctl signals parity error",
119 "IO link transmission error",
120 "L3 data cache ECC error", /* xec = 0x1c */
121 "L3 cache tag error",
122 "L3 LRU parity bits error",
123 "ECC Error in the Probe Filter directory"
124};
125
115static const char * const fr_ex_mce_desc[] = { 126static const char * const fr_ex_mce_desc[] = {
116 "CPU Watchdog timer expire", 127 "CPU Watchdog timer expire",
117 "Wakeup array dest tag", 128 "Wakeup array dest tag",
@@ -125,7 +136,7 @@ static const char * const fr_ex_mce_desc[] = {
125 "Physical register file AG0 port", 136 "Physical register file AG0 port",
126 "Physical register file AG1 port", 137 "Physical register file AG1 port",
127 "Flag register file", 138 "Flag register file",
128 "DE correctable error could not be corrected" 139 "DE error occurred"
129}; 140};
130 141
131static bool f12h_dc_mce(u16 ec, u8 xec) 142static bool f12h_dc_mce(u16 ec, u8 xec)
@@ -255,10 +266,9 @@ static bool f15h_dc_mce(u16 ec, u8 xec)
255 } else if (BUS_ERROR(ec)) { 266 } else if (BUS_ERROR(ec)) {
256 267
257 if (!xec) 268 if (!xec)
258 pr_cont("during system linefill.\n"); 269 pr_cont("System Read Data Error.\n");
259 else 270 else
260 pr_cont(" Internal %s condition.\n", 271 pr_cont(" Internal error condition type %d.\n", xec);
261 ((xec == 1) ? "livelock" : "deadlock"));
262 } else 272 } else
263 ret = false; 273 ret = false;
264 274
@@ -355,7 +365,11 @@ static bool f15h_ic_mce(u16 ec, u8 xec)
355 pr_cont("%s.\n", f15h_ic_mce_desc[xec-2]); 365 pr_cont("%s.\n", f15h_ic_mce_desc[xec-2]);
356 break; 366 break;
357 367
358 case 0x10 ... 0x14: 368 case 0x10:
369 pr_cont("%s.\n", f15h_ic_mce_desc[xec-4]);
370 break;
371
372 case 0x11 ... 0x14:
359 pr_cont("Decoder %s parity error.\n", f15h_ic_mce_desc[xec-4]); 373 pr_cont("Decoder %s parity error.\n", f15h_ic_mce_desc[xec-4]);
360 break; 374 break;
361 375
@@ -496,58 +510,31 @@ wrong_ls_mce:
496 pr_emerg(HW_ERR "Corrupted LS MCE info?\n"); 510 pr_emerg(HW_ERR "Corrupted LS MCE info?\n");
497} 511}
498 512
499static bool k8_nb_mce(u16 ec, u8 xec) 513void amd_decode_nb_mce(struct mce *m)
500{ 514{
501 bool ret = true; 515 struct cpuinfo_x86 *c = &boot_cpu_data;
502 516 int node_id = amd_get_nb_id(m->extcpu);
503 switch (xec) { 517 u16 ec = EC(m->status);
504 case 0x1: 518 u8 xec = XEC(m->status, 0x1f);
505 pr_cont("CRC error detected on HT link.\n"); 519 u8 offset = 0;
506 break;
507
508 case 0x5:
509 pr_cont("Invalid GART PTE entry during GART table walk.\n");
510 break;
511
512 case 0x6:
513 pr_cont("Unsupported atomic RMW received from an IO link.\n");
514 break;
515
516 case 0x0:
517 case 0x8:
518 if (boot_cpu_data.x86 == 0x11)
519 return false;
520
521 pr_cont("DRAM ECC error detected on the NB.\n");
522 break;
523
524 case 0xd:
525 pr_cont("Parity error on the DRAM addr/ctl signals.\n");
526 break;
527
528 default:
529 ret = false;
530 break;
531 }
532 520
533 return ret; 521 pr_emerg(HW_ERR "Northbridge Error (node %d): ", node_id);
534}
535 522
536static bool f10h_nb_mce(u16 ec, u8 xec) 523 switch (xec) {
537{ 524 case 0x0 ... 0xe:
538 bool ret = true;
539 u8 offset = 0;
540 525
541 if (k8_nb_mce(ec, xec)) 526 /* special handling for DRAM ECCs */
542 return true; 527 if (xec == 0x0 || xec == 0x8) {
528 /* no ECCs on F11h */
529 if (c->x86 == 0x11)
530 goto wrong_nb_mce;
543 531
544 switch(xec) { 532 pr_cont("%s.\n", nb_mce_desc[xec]);
545 case 0xa ... 0xc:
546 offset = 10;
547 break;
548 533
549 case 0xe: 534 if (nb_bus_decoder)
550 offset = 11; 535 nb_bus_decoder(node_id, m);
536 return;
537 }
551 break; 538 break;
552 539
553 case 0xf: 540 case 0xf:
@@ -556,83 +543,25 @@ static bool f10h_nb_mce(u16 ec, u8 xec)
556 else if (BUS_ERROR(ec)) 543 else if (BUS_ERROR(ec))
557 pr_cont("DMA Exclusion Vector Table Walk error.\n"); 544 pr_cont("DMA Exclusion Vector Table Walk error.\n");
558 else 545 else
559 ret = false; 546 goto wrong_nb_mce;
560 547 return;
561 goto out;
562 break;
563 548
564 case 0x19: 549 case 0x19:
565 if (boot_cpu_data.x86 == 0x15) 550 if (boot_cpu_data.x86 == 0x15)
566 pr_cont("Compute Unit Data Error.\n"); 551 pr_cont("Compute Unit Data Error.\n");
567 else 552 else
568 ret = false; 553 goto wrong_nb_mce;
569 554 return;
570 goto out;
571 break;
572 555
573 case 0x1c ... 0x1f: 556 case 0x1c ... 0x1f:
574 offset = 24; 557 offset = 13;
575 break; 558 break;
576 559
577 default: 560 default:
578 ret = false;
579
580 goto out;
581 break;
582 }
583
584 pr_cont("%s.\n", f10h_nb_mce_desc[xec - offset]);
585
586out:
587 return ret;
588}
589
590static bool nb_noop_mce(u16 ec, u8 xec)
591{
592 return false;
593}
594
595void amd_decode_nb_mce(struct mce *m)
596{
597 struct cpuinfo_x86 *c = &boot_cpu_data;
598 int node_id = amd_get_nb_id(m->extcpu);
599 u16 ec = EC(m->status);
600 u8 xec = XEC(m->status, 0x1f);
601
602 pr_emerg(HW_ERR "Northbridge Error (node %d): ", node_id);
603
604 switch (xec) {
605 case 0x2:
606 pr_cont("Sync error (sync packets on HT link detected).\n");
607 return;
608
609 case 0x3:
610 pr_cont("HT Master abort.\n");
611 return;
612
613 case 0x4:
614 pr_cont("HT Target abort.\n");
615 return;
616
617 case 0x7:
618 pr_cont("NB Watchdog timeout.\n");
619 return;
620
621 case 0x9:
622 pr_cont("SVM DMA Exclusion Vector error.\n");
623 return;
624
625 default:
626 break;
627 }
628
629 if (!fam_ops->nb_mce(ec, xec))
630 goto wrong_nb_mce; 561 goto wrong_nb_mce;
562 }
631 563
632 if (c->x86 == 0xf || c->x86 == 0x10 || c->x86 == 0x15) 564 pr_cont("%s.\n", nb_mce_desc[xec - offset]);
633 if ((xec == 0x8 || xec == 0x0) && nb_bus_decoder)
634 nb_bus_decoder(node_id, m);
635
636 return; 565 return;
637 566
638wrong_nb_mce: 567wrong_nb_mce:
@@ -648,9 +577,6 @@ static void amd_decode_fr_mce(struct mce *m)
648 if (c->x86 == 0xf || c->x86 == 0x11) 577 if (c->x86 == 0xf || c->x86 == 0x11)
649 goto wrong_fr_mce; 578 goto wrong_fr_mce;
650 579
651 if (c->x86 != 0x15 && xec != 0x0)
652 goto wrong_fr_mce;
653
654 pr_emerg(HW_ERR "%s Error: ", 580 pr_emerg(HW_ERR "%s Error: ",
655 (c->x86 == 0x15 ? "Execution Unit" : "FIROB")); 581 (c->x86 == 0x15 ? "Execution Unit" : "FIROB"));
656 582
@@ -841,39 +767,33 @@ static int __init mce_amd_init(void)
841 case 0xf: 767 case 0xf:
842 fam_ops->dc_mce = k8_dc_mce; 768 fam_ops->dc_mce = k8_dc_mce;
843 fam_ops->ic_mce = k8_ic_mce; 769 fam_ops->ic_mce = k8_ic_mce;
844 fam_ops->nb_mce = k8_nb_mce;
845 break; 770 break;
846 771
847 case 0x10: 772 case 0x10:
848 fam_ops->dc_mce = f10h_dc_mce; 773 fam_ops->dc_mce = f10h_dc_mce;
849 fam_ops->ic_mce = k8_ic_mce; 774 fam_ops->ic_mce = k8_ic_mce;
850 fam_ops->nb_mce = f10h_nb_mce;
851 break; 775 break;
852 776
853 case 0x11: 777 case 0x11:
854 fam_ops->dc_mce = k8_dc_mce; 778 fam_ops->dc_mce = k8_dc_mce;
855 fam_ops->ic_mce = k8_ic_mce; 779 fam_ops->ic_mce = k8_ic_mce;
856 fam_ops->nb_mce = f10h_nb_mce;
857 break; 780 break;
858 781
859 case 0x12: 782 case 0x12:
860 fam_ops->dc_mce = f12h_dc_mce; 783 fam_ops->dc_mce = f12h_dc_mce;
861 fam_ops->ic_mce = k8_ic_mce; 784 fam_ops->ic_mce = k8_ic_mce;
862 fam_ops->nb_mce = nb_noop_mce;
863 break; 785 break;
864 786
865 case 0x14: 787 case 0x14:
866 nb_err_cpumask = 0x3; 788 nb_err_cpumask = 0x3;
867 fam_ops->dc_mce = f14h_dc_mce; 789 fam_ops->dc_mce = f14h_dc_mce;
868 fam_ops->ic_mce = f14h_ic_mce; 790 fam_ops->ic_mce = f14h_ic_mce;
869 fam_ops->nb_mce = nb_noop_mce;
870 break; 791 break;
871 792
872 case 0x15: 793 case 0x15:
873 xec_mask = 0x1f; 794 xec_mask = 0x1f;
874 fam_ops->dc_mce = f15h_dc_mce; 795 fam_ops->dc_mce = f15h_dc_mce;
875 fam_ops->ic_mce = f15h_ic_mce; 796 fam_ops->ic_mce = f15h_ic_mce;
876 fam_ops->nb_mce = f10h_nb_mce;
877 break; 797 break;
878 798
879 default: 799 default:
diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h
index 0106747e240c..c6074c5cd1ef 100644
--- a/drivers/edac/mce_amd.h
+++ b/drivers/edac/mce_amd.h
@@ -69,12 +69,12 @@ enum rrrr_ids {
69 R4_SNOOP, 69 R4_SNOOP,
70}; 70};
71 71
72extern const char *tt_msgs[]; 72extern const char * const tt_msgs[];
73extern const char *ll_msgs[]; 73extern const char * const ll_msgs[];
74extern const char *rrrr_msgs[]; 74extern const char * const rrrr_msgs[];
75extern const char *pp_msgs[]; 75extern const char * const pp_msgs[];
76extern const char *to_msgs[]; 76extern const char * const to_msgs[];
77extern const char *ii_msgs[]; 77extern const char * const ii_msgs[];
78 78
79/* 79/*
80 * per-family decoder ops 80 * per-family decoder ops
@@ -82,7 +82,6 @@ extern const char *ii_msgs[];
82struct amd_decoder_ops { 82struct amd_decoder_ops {
83 bool (*dc_mce)(u16, u8); 83 bool (*dc_mce)(u16, u8);
84 bool (*ic_mce)(u16, u8); 84 bool (*ic_mce)(u16, u8);
85 bool (*nb_mce)(u16, u8);
86}; 85};
87 86
88void amd_report_gart_errors(bool); 87void amd_report_gart_errors(bool);
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index e294e1b3616c..6d908ad72d64 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -373,7 +373,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
373 edac_mc_free(mci); 373 edac_mc_free(mci);
374} 374}
375 375
376static const struct pci_device_id r82600_pci_tbl[] __devinitdata = { 376static DEFINE_PCI_DEVICE_TABLE(r82600_pci_tbl) = {
377 { 377 {
378 PCI_DEVICE(PCI_VENDOR_ID_RADISYS, R82600_BRIDGE_ID) 378 PCI_DEVICE(PCI_VENDOR_ID_RADISYS, R82600_BRIDGE_ID)
379 }, 379 },
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 1dc118d83cc6..3a605f777712 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -367,7 +367,7 @@ static const struct pci_id_table pci_dev_descr_sbridge_table[] = {
367/* 367/*
368 * pci_device_id table for which devices we are looking for 368 * pci_device_id table for which devices we are looking for
369 */ 369 */
370static const struct pci_device_id sbridge_pci_tbl[] __devinitdata = { 370static DEFINE_PCI_DEVICE_TABLE(sbridge_pci_tbl) = {
371 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA)}, 371 {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA)},
372 {0,} /* 0 terminated list. */ 372 {0,} /* 0 terminated list. */
373}; 373};
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c
index b6f47de152f3..a438297389e5 100644
--- a/drivers/edac/x38_edac.c
+++ b/drivers/edac/x38_edac.c
@@ -440,7 +440,7 @@ static void __devexit x38_remove_one(struct pci_dev *pdev)
440 edac_mc_free(mci); 440 edac_mc_free(mci);
441} 441}
442 442
443static const struct pci_device_id x38_pci_tbl[] __devinitdata = { 443static DEFINE_PCI_DEVICE_TABLE(x38_pci_tbl) = {
444 { 444 {
445 PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0, 445 PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
446 X38}, 446 X38},