]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/edac/sb_edac.c
x86/msr: Add definitions for new speculation control MSRs
[mirror_ubuntu-artful-kernel.git] / drivers / edac / sb_edac.c
index 80d860cb0746ff00b97a4f4f22997a16298572eb..5c3e707ff3fcb54f9479021c12da5dff36c9d6a5 100644 (file)
@@ -455,6 +455,7 @@ static const struct pci_id_table pci_dev_descr_sbridge_table[] = {
 static const struct pci_id_descr pci_dev_descr_ibridge[] = {
                /* Processor Home Agent */
        { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0,        0, IMC0) },
+       { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1,        1, IMC1) },
 
                /* Memory controller */
        { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA,     0, IMC0) },
@@ -465,7 +466,6 @@ static const struct pci_id_descr pci_dev_descr_ibridge[] = {
        { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TAD3,   0, IMC0) },
 
                /* Optional, mode 2HA */
-       { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1,        1, IMC1) },
        { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TA,     1, IMC1) },
        { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_RAS,    1, IMC1) },
        { PCI_DESCR(PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA1_TAD0,   1, IMC1) },
@@ -1311,9 +1311,7 @@ static int knl_get_dimm_capacity(struct sbridge_pvt *pvt, u64 *mc_sizes)
        int cur_reg_start;
        int mc;
        int channel;
-       int way;
        int participants[KNL_MAX_CHANNELS];
-       int participant_count = 0;
 
        for (i = 0; i < KNL_MAX_CHANNELS; i++)
                mc_sizes[i] = 0;
@@ -1488,21 +1486,14 @@ static int knl_get_dimm_capacity(struct sbridge_pvt *pvt, u64 *mc_sizes)
                 * this channel mapped to the given target?
                 */
                for (channel = 0; channel < KNL_MAX_CHANNELS; channel++) {
-                       for (way = 0; way < intrlv_ways; way++) {
-                               int target;
-                               int cha;
-
-                               if (KNL_MOD3(dram_rule))
-                                       target = way;
-                               else
-                                       target = 0x7 & sad_pkg(
-                               pvt->info.interleave_pkg, interleave_reg, way);
+                       int target;
+                       int cha;
 
+                       for (target = 0; target < KNL_MAX_CHANNELS; target++) {
                                for (cha = 0; cha < KNL_MAX_CHAS; cha++) {
                                        if (knl_get_mc_route(target,
                                                mc_route_reg[cha]) == channel
                                                && !participants[channel]) {
-                                               participant_count++;
                                                participants[channel] = 1;
                                                break;
                                        }
@@ -1510,10 +1501,6 @@ static int knl_get_dimm_capacity(struct sbridge_pvt *pvt, u64 *mc_sizes)
                        }
                }
 
-               if (participant_count != intrlv_ways)
-                       edac_dbg(0, "participant_count (%d) != interleave_ways (%d): DIMM size may be incorrect\n",
-                               participant_count, intrlv_ways);
-
                for (channel = 0; channel < KNL_MAX_CHANNELS; channel++) {
                        mc = knl_channel_mc(channel);
                        if (participants[channel]) {
@@ -2260,6 +2247,13 @@ static int sbridge_get_onedevice(struct pci_dev **prev,
 next_imc:
        sbridge_dev = get_sbridge_dev(bus, dev_descr->dom, multi_bus, sbridge_dev);
        if (!sbridge_dev) {
+               /* If the HA1 wasn't found, don't create EDAC second memory controller */
+               if (dev_descr->dom == IMC1 && devno != 1) {
+                       edac_dbg(0, "Skip IMC1: %04x:%04x (since HA1 was absent)\n",
+                                PCI_VENDOR_ID_INTEL, dev_descr->dev_id);
+                       pci_dev_put(pdev);
+                       return 0;
+               }
 
                if (dev_descr->dom == SOCK)
                        goto out_imc;