aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/amd64_edac.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-26 12:39:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-26 12:39:40 -0400
commit4075ea8c54a7506844a69f674990241e7766357b (patch)
tree4f9549b54325e8ee4f631ea8ba1817db2abf22a7 /drivers/edac/amd64_edac.c
parent919a6d10fdd9e256dfcd31937fb0b18d1c066be6 (diff)
parent37da045067b4e923190662e21029005ea53bfaa1 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: amd64_edac: misc small cleanups amd64_edac: fix ecc_enable_override handling amd64_edac: check only ECC bit in amd64_determine_edac_cap
Diffstat (limited to 'drivers/edac/amd64_edac.c')
-rw-r--r--drivers/edac/amd64_edac.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index c36bf40568cf..858fe6037223 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -754,13 +754,13 @@ static void amd64_cpu_display_info(struct amd64_pvt *pvt)
754static enum edac_type amd64_determine_edac_cap(struct amd64_pvt *pvt) 754static enum edac_type amd64_determine_edac_cap(struct amd64_pvt *pvt)
755{ 755{
756 int bit; 756 int bit;
757 enum dev_type edac_cap = EDAC_NONE; 757 enum dev_type edac_cap = EDAC_FLAG_NONE;
758 758
759 bit = (boot_cpu_data.x86 > 0xf || pvt->ext_model >= OPTERON_CPU_REV_F) 759 bit = (boot_cpu_data.x86 > 0xf || pvt->ext_model >= OPTERON_CPU_REV_F)
760 ? 19 760 ? 19
761 : 17; 761 : 17;
762 762
763 if (pvt->dclr0 >> BIT(bit)) 763 if (pvt->dclr0 & BIT(bit))
764 edac_cap = EDAC_FLAG_SECDED; 764 edac_cap = EDAC_FLAG_SECDED;
765 765
766 return edac_cap; 766 return edac_cap;
@@ -1269,7 +1269,7 @@ static int f10_early_channel_count(struct amd64_pvt *pvt)
1269 if (channels == 0) 1269 if (channels == 0)
1270 channels = 1; 1270 channels = 1;
1271 1271
1272 debugf0("DIMM count= %d\n", channels); 1272 debugf0("MCT channel count: %d\n", channels);
1273 1273
1274 return channels; 1274 return channels;
1275 1275
@@ -2966,7 +2966,12 @@ static int amd64_check_ecc_enabled(struct amd64_pvt *pvt)
2966 " Use of the override can cause " 2966 " Use of the override can cause "
2967 "unknown side effects.\n"); 2967 "unknown side effects.\n");
2968 ret = -ENODEV; 2968 ret = -ENODEV;
2969 } 2969 } else
2970 /*
2971 * enable further driver loading if ECC enable is
2972 * overridden.
2973 */
2974 ret = 0;
2970 } else { 2975 } else {
2971 amd64_printk(KERN_INFO, 2976 amd64_printk(KERN_INFO,
2972 "ECC is enabled by BIOS, Proceeding " 2977 "ECC is enabled by BIOS, Proceeding "
@@ -3006,7 +3011,6 @@ static void amd64_setup_mci_misc_attributes(struct mem_ctl_info *mci)
3006 3011
3007 mci->mtype_cap = MEM_FLAG_DDR2 | MEM_FLAG_RDDR2; 3012 mci->mtype_cap = MEM_FLAG_DDR2 | MEM_FLAG_RDDR2;
3008 mci->edac_ctl_cap = EDAC_FLAG_NONE; 3013 mci->edac_ctl_cap = EDAC_FLAG_NONE;
3009 mci->edac_cap = EDAC_FLAG_NONE;
3010 3014
3011 if (pvt->nbcap & K8_NBCAP_SECDED) 3015 if (pvt->nbcap & K8_NBCAP_SECDED)
3012 mci->edac_ctl_cap |= EDAC_FLAG_SECDED; 3016 mci->edac_ctl_cap |= EDAC_FLAG_SECDED;
@@ -3052,7 +3056,7 @@ static int amd64_probe_one_instance(struct pci_dev *dram_f2_ctl,
3052 if (!pvt) 3056 if (!pvt)
3053 goto err_exit; 3057 goto err_exit;
3054 3058
3055 pvt->mc_node_id = get_mc_node_id_from_pdev(dram_f2_ctl); 3059 pvt->mc_node_id = get_node_id(dram_f2_ctl);
3056 3060
3057 pvt->dram_f2_ctl = dram_f2_ctl; 3061 pvt->dram_f2_ctl = dram_f2_ctl;
3058 pvt->ext_model = boot_cpu_data.x86_model >> 4; 3062 pvt->ext_model = boot_cpu_data.x86_model >> 4;
@@ -3179,8 +3183,7 @@ static int __devinit amd64_init_one_instance(struct pci_dev *pdev,
3179{ 3183{
3180 int ret = 0; 3184 int ret = 0;
3181 3185
3182 debugf0("(MC node=%d,mc_type='%s')\n", 3186 debugf0("(MC node=%d,mc_type='%s')\n", get_node_id(pdev),
3183 get_mc_node_id_from_pdev(pdev),
3184 get_amd_family_name(mc_type->driver_data)); 3187 get_amd_family_name(mc_type->driver_data));
3185 3188
3186 ret = pci_enable_device(pdev); 3189 ret = pci_enable_device(pdev);
@@ -3319,15 +3322,17 @@ static int __init amd64_edac_init(void)
3319 3322
3320 err = amd64_init_2nd_stage(pvt_lookup[nb]); 3323 err = amd64_init_2nd_stage(pvt_lookup[nb]);
3321 if (err) 3324 if (err)
3322 goto err_exit; 3325 goto err_2nd_stage;
3323 } 3326 }
3324 3327
3325 amd64_setup_pci_device(); 3328 amd64_setup_pci_device();
3326 3329
3327 return 0; 3330 return 0;
3328 3331
3332err_2nd_stage:
3333 debugf0("2nd stage failed\n");
3334
3329err_exit: 3335err_exit:
3330 debugf0("'finish_setup' stage failed\n");
3331 pci_unregister_driver(&amd64_pci_driver); 3336 pci_unregister_driver(&amd64_pci_driver);
3332 3337
3333 return err; 3338 return err;