Commit 477ea1169667a88d8ee12d83a0b0863091fb8670

Authored by Linus Torvalds

Merge tag 'edac_fixes_for_3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp

Pull two EDAC fixes from Borislav Petkov:

 - A fix to sb_edac for proper detection on SNB machines

 - A fix to amd64_edac to not explode on Numascale machines with more
   than 16 memory controllers, from Daniel J Blueman.

* tag 'edac_fixes_for_3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  EDAC, amd64_edac: Prevent OOPS with >16 memory controllers
  sb_edac: Fix detection on SNB machines

Showing 2 changed files Side-by-side Diff

drivers/edac/amd64_edac.c
... ... @@ -2174,13 +2174,19 @@
2174 2174  
2175 2175 static inline void decode_bus_error(int node_id, struct mce *m)
2176 2176 {
2177   - struct mem_ctl_info *mci = mcis[node_id];
2178   - struct amd64_pvt *pvt = mci->pvt_info;
  2177 + struct mem_ctl_info *mci;
  2178 + struct amd64_pvt *pvt;
2179 2179 u8 ecc_type = (m->status >> 45) & 0x3;
2180 2180 u8 xec = XEC(m->status, 0x1f);
2181 2181 u16 ec = EC(m->status);
2182 2182 u64 sys_addr;
2183 2183 struct err_info err;
  2184 +
  2185 + mci = edac_mc_find(node_id);
  2186 + if (!mci)
  2187 + return;
  2188 +
  2189 + pvt = mci->pvt_info;
2184 2190  
2185 2191 /* Bail out early if this was an 'observed' error */
2186 2192 if (PP(ec) == NBSL_PP_OBS)
drivers/edac/sb_edac.c
... ... @@ -2447,7 +2447,7 @@
2447 2447 rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_ibridge_table);
2448 2448 type = IVY_BRIDGE;
2449 2449 break;
2450   - case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA:
  2450 + case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0:
2451 2451 rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_sbridge_table);
2452 2452 type = SANDY_BRIDGE;
2453 2453 break;
2454 2454  
... ... @@ -2460,8 +2460,11 @@
2460 2460 type = BROADWELL;
2461 2461 break;
2462 2462 }
2463   - if (unlikely(rc < 0))
  2463 + if (unlikely(rc < 0)) {
  2464 + edac_dbg(0, "couldn't get all devices for 0x%x\n", pdev->device);
2464 2465 goto fail0;
  2466 + }
  2467 +
2465 2468 mc = 0;
2466 2469  
2467 2470 list_for_each_entry(sbridge_dev, &sbridge_edac_list, list) {
... ... @@ -2474,7 +2477,7 @@
2474 2477 goto fail1;
2475 2478 }
2476 2479  
2477   - sbridge_printk(KERN_INFO, "Driver loaded.\n");
  2480 + sbridge_printk(KERN_INFO, "%s\n", SBRIDGE_REVISION);
2478 2481  
2479 2482 mutex_unlock(&sbridge_edac_lock);
2480 2483 return 0;