aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2016-06-02 13:58:08 -0400
committerBorislav Petkov <bp@suse.de>2016-06-03 11:28:21 -0400
commit665f05e0b836d46b22f0b712eb76d8b7f69a5ea0 (patch)
tree3d9a03cd9ab37e2be3922807b8b4d96e0fc23065
parentfbedcaf43fba35677c01a4ae51e6f79edf4049ba (diff)
EDAC, sb_edac: Readd accidentally dropped Broadwell-D support
In commit 2c1ea4c700af ("EDAC, sb_edac: Use cpu family/model in driver detection") we switched from using PCI ids to determine which platform we are running on to using CPU model instead. I forgot that Broadwell-DE has its own distinct model number different from Broadwell-EP or -EX. Fixing this isn't just adding a line to the array of cpuids - the exising code assumed a 1:1 mapping between entries in that array and the "enum type" values. Added the type to pci_id_table structure to remove this dependency and allows two Broadwell cpu models. Signed-off-by: Tony Luck <tony.luck@intel.com> Cc: Aristeu Rozanski <arozansk@redhat.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: linux-edac <linux-edac@vger.kernel.org> Fixes: 2c1ea4c700af ("EDAC, sb_edac: Use cpu family/model in driver detection") Link: http://lkml.kernel.org/r/b3cffe40dec6dfe0235a5d52a504f0ba86a07ce7.1464902605.git.tony.luck@intel.com Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--drivers/edac/sb_edac.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index ace662e8a7a8..6744d88bdea8 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -329,6 +329,7 @@ struct pci_id_descr {
329struct pci_id_table { 329struct pci_id_table {
330 const struct pci_id_descr *descr; 330 const struct pci_id_descr *descr;
331 int n_devs; 331 int n_devs;
332 enum type type;
332}; 333};
333 334
334struct sbridge_dev { 335struct sbridge_dev {
@@ -397,9 +398,14 @@ static const struct pci_id_descr pci_dev_descr_sbridge[] = {
397 { PCI_DESCR(PCI_DEVICE_ID_INTEL_SBRIDGE_BR, 0) }, 398 { PCI_DESCR(PCI_DEVICE_ID_INTEL_SBRIDGE_BR, 0) },
398}; 399};
399 400
400#define PCI_ID_TABLE_ENTRY(A) { .descr=A, .n_devs = ARRAY_SIZE(A) } 401#define PCI_ID_TABLE_ENTRY(A, T) { \
402 .descr = A, \
403 .n_devs = ARRAY_SIZE(A), \
404 .type = T \
405}
406
401static const struct pci_id_table pci_dev_descr_sbridge_table[] = { 407static const struct pci_id_table pci_dev_descr_sbridge_table[] = {
402 PCI_ID_TABLE_ENTRY(pci_dev_descr_sbridge), 408 PCI_ID_TABLE_ENTRY(pci_dev_descr_sbridge, SANDY_BRIDGE),
403 {0,} /* 0 terminated list. */ 409 {0,} /* 0 terminated list. */
404}; 410};
405 411
@@ -466,7 +472,7 @@ static const struct pci_id_descr pci_dev_descr_ibridge[] = {
466}; 472};
467 473
468static const struct pci_id_table pci_dev_descr_ibridge_table[] = { 474static const struct pci_id_table pci_dev_descr_ibridge_table[] = {
469 PCI_ID_TABLE_ENTRY(pci_dev_descr_ibridge), 475 PCI_ID_TABLE_ENTRY(pci_dev_descr_ibridge, IVY_BRIDGE),
470 {0,} /* 0 terminated list. */ 476 {0,} /* 0 terminated list. */
471}; 477};
472 478
@@ -539,7 +545,7 @@ static const struct pci_id_descr pci_dev_descr_haswell[] = {
539}; 545};
540 546
541static const struct pci_id_table pci_dev_descr_haswell_table[] = { 547static const struct pci_id_table pci_dev_descr_haswell_table[] = {
542 PCI_ID_TABLE_ENTRY(pci_dev_descr_haswell), 548 PCI_ID_TABLE_ENTRY(pci_dev_descr_haswell, HASWELL),
543 {0,} /* 0 terminated list. */ 549 {0,} /* 0 terminated list. */
544}; 550};
545 551
@@ -583,7 +589,7 @@ static const struct pci_id_descr pci_dev_descr_knl[] = {
583}; 589};
584 590
585static const struct pci_id_table pci_dev_descr_knl_table[] = { 591static const struct pci_id_table pci_dev_descr_knl_table[] = {
586 PCI_ID_TABLE_ENTRY(pci_dev_descr_knl), 592 PCI_ID_TABLE_ENTRY(pci_dev_descr_knl, KNIGHTS_LANDING),
587 {0,} 593 {0,}
588}; 594};
589 595
@@ -651,7 +657,7 @@ static const struct pci_id_descr pci_dev_descr_broadwell[] = {
651}; 657};
652 658
653static const struct pci_id_table pci_dev_descr_broadwell_table[] = { 659static const struct pci_id_table pci_dev_descr_broadwell_table[] = {
654 PCI_ID_TABLE_ENTRY(pci_dev_descr_broadwell), 660 PCI_ID_TABLE_ENTRY(pci_dev_descr_broadwell, BROADWELL),
655 {0,} /* 0 terminated list. */ 661 {0,} /* 0 terminated list. */
656}; 662};
657 663
@@ -3360,12 +3366,12 @@ fail0:
3360#define ICPU(model, table) \ 3366#define ICPU(model, table) \
3361 { X86_VENDOR_INTEL, 6, model, 0, (unsigned long)&table } 3367 { X86_VENDOR_INTEL, 6, model, 0, (unsigned long)&table }
3362 3368
3363/* Order here must match "enum type" */
3364static const struct x86_cpu_id sbridge_cpuids[] = { 3369static const struct x86_cpu_id sbridge_cpuids[] = {
3365 ICPU(0x2d, pci_dev_descr_sbridge_table), /* SANDY_BRIDGE */ 3370 ICPU(0x2d, pci_dev_descr_sbridge_table), /* SANDY_BRIDGE */
3366 ICPU(0x3e, pci_dev_descr_ibridge_table), /* IVY_BRIDGE */ 3371 ICPU(0x3e, pci_dev_descr_ibridge_table), /* IVY_BRIDGE */
3367 ICPU(0x3f, pci_dev_descr_haswell_table), /* HASWELL */ 3372 ICPU(0x3f, pci_dev_descr_haswell_table), /* HASWELL */
3368 ICPU(0x4f, pci_dev_descr_broadwell_table), /* BROADWELL */ 3373 ICPU(0x4f, pci_dev_descr_broadwell_table), /* BROADWELL */
3374 ICPU(0x56, pci_dev_descr_broadwell_table), /* BROADWELL-DE */
3369 ICPU(0x57, pci_dev_descr_knl_table), /* KNIGHTS_LANDING */ 3375 ICPU(0x57, pci_dev_descr_knl_table), /* KNIGHTS_LANDING */
3370 { } 3376 { }
3371}; 3377};
@@ -3401,7 +3407,7 @@ static int sbridge_probe(const struct x86_cpu_id *id)
3401 mc, mc + 1, num_mc); 3407 mc, mc + 1, num_mc);
3402 3408
3403 sbridge_dev->mc = mc++; 3409 sbridge_dev->mc = mc++;
3404 rc = sbridge_register_mci(sbridge_dev, id - sbridge_cpuids); 3410 rc = sbridge_register_mci(sbridge_dev, ptable->type);
3405 if (unlikely(rc < 0)) 3411 if (unlikely(rc < 0))
3406 goto fail1; 3412 goto fail1;
3407 } 3413 }