Commit 90de8c9dc26ddcfb52cfabe8b7da4a9857f8e132

Authored by Borislav Petkov
Committed by Greg Kroah-Hartman
1 parent 177f6a7ea9

sb_edac: Fix detection on SNB machines

commit 11249e73992981e31fd50e7231da24fad68e3320 upstream.

d0585cd815fa ("sb_edac: Claim a different PCI device") changed the
probing of sb_edac to look for PCI device 0x3ca0:

3f:0e.0 System peripheral: Intel Corporation Xeon E5/Core i7 Processor Home Agent (rev 07)
00: 86 80 a0 3c 00 00 00 00 07 00 80 08 00 00 80 00
...

but we're matching for 0x3ca8, i.e. PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA
in sbridge_probe() therefore the probing fails.

Changing it to probe for 0x3ca0 (PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0),
.i.e., the 14.0 device, fixes the issue and driver loads successfully
again:

[ 2449.013120] EDAC DEBUG: sbridge_init:
[ 2449.017029] EDAC sbridge: Seeking for: PCI ID 8086:3ca0
[ 2449.022368] EDAC DEBUG: sbridge_get_onedevice: Detected 8086:3ca0
[ 2449.028498] EDAC sbridge: Seeking for: PCI ID 8086:3ca0
[ 2449.033768] EDAC sbridge: Seeking for: PCI ID 8086:3ca8
[ 2449.039028] EDAC DEBUG: sbridge_get_onedevice: Detected 8086:3ca8
[ 2449.045155] EDAC sbridge: Seeking for: PCI ID 8086:3ca8
...

Add a debug printk while at it to be able to catch the failure in the
future and dump driver version on successful load.

Fixes: d0585cd815fa ("sb_edac: Claim a different PCI device")
Acked-by: Aristeu Rozanski <aris@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 6 additions and 3 deletions Side-by-side Diff

drivers/edac/sb_edac.c
... ... @@ -2297,7 +2297,7 @@
2297 2297 rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_ibridge_table);
2298 2298 type = IVY_BRIDGE;
2299 2299 break;
2300   - case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA:
  2300 + case PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0:
2301 2301 rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_sbridge_table);
2302 2302 type = SANDY_BRIDGE;
2303 2303 break;
2304 2304  
... ... @@ -2306,8 +2306,11 @@
2306 2306 type = HASWELL;
2307 2307 break;
2308 2308 }
2309   - if (unlikely(rc < 0))
  2309 + if (unlikely(rc < 0)) {
  2310 + edac_dbg(0, "couldn't get all devices for 0x%x\n", pdev->device);
2310 2311 goto fail0;
  2312 + }
  2313 +
2311 2314 mc = 0;
2312 2315  
2313 2316 list_for_each_entry(sbridge_dev, &sbridge_edac_list, list) {
... ... @@ -2320,7 +2323,7 @@
2320 2323 goto fail1;
2321 2324 }
2322 2325  
2323   - sbridge_printk(KERN_INFO, "Driver loaded.\n");
  2326 + sbridge_printk(KERN_INFO, "%s\n", SBRIDGE_REVISION);
2324 2327  
2325 2328 mutex_unlock(&sbridge_edac_lock);
2326 2329 return 0;