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:
  edac, pci: remove pesky debug printk
  amd64_edac: restrict PCI config space access
  amd64_edac: fix forcing module load/unload
  amd64_edac: make driver loading more robust
  amd64_edac: fix driver instance freeing
  amd64_edac: fix K8 chip select reporting
This commit is contained in:
Linus Torvalds 2009-12-24 12:55:40 -08:00
commit eec74a410f
2 changed files with 28 additions and 19 deletions

View file

@ -1700,11 +1700,14 @@ static void f10_map_sysaddr_to_csrow(struct mem_ctl_info *mci,
*/ */
static void amd64_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt) static void amd64_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt)
{ {
int dimm, size0, size1; int dimm, size0, size1, factor = 0;
u32 dbam; u32 dbam;
u32 *dcsb; u32 *dcsb;
if (boot_cpu_data.x86 == 0xf) { if (boot_cpu_data.x86 == 0xf) {
if (pvt->dclr0 & F10_WIDTH_128)
factor = 1;
/* K8 families < revF not supported yet */ /* K8 families < revF not supported yet */
if (pvt->ext_model < K8_REV_F) if (pvt->ext_model < K8_REV_F)
return; return;
@ -1732,7 +1735,8 @@ static void amd64_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt)
size1 = pvt->ops->dbam_to_cs(pvt, DBAM_DIMM(dimm, dbam)); size1 = pvt->ops->dbam_to_cs(pvt, DBAM_DIMM(dimm, dbam));
edac_printk(KERN_DEBUG, EDAC_MC, " %d: %5dMB %d: %5dMB\n", edac_printk(KERN_DEBUG, EDAC_MC, " %d: %5dMB %d: %5dMB\n",
dimm * 2, size0, dimm * 2 + 1, size1); dimm * 2, size0 << factor,
dimm * 2 + 1, size1 << factor);
} }
} }
@ -2345,7 +2349,7 @@ static void amd64_read_mc_registers(struct amd64_pvt *pvt)
amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCLR_0, &pvt->dclr0); amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCLR_0, &pvt->dclr0);
amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCHR_0, &pvt->dchr0); amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCHR_0, &pvt->dchr0);
if (!dct_ganging_enabled(pvt)) { if (!dct_ganging_enabled(pvt) && boot_cpu_data.x86 >= 0x10) {
amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCLR_1, &pvt->dclr1); amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCLR_1, &pvt->dclr1);
amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCHR_1, &pvt->dchr1); amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCHR_1, &pvt->dchr1);
} }
@ -2686,9 +2690,8 @@ static int amd64_check_ecc_enabled(struct amd64_pvt *pvt)
amd64_printk(KERN_WARNING, "%s", ecc_warning); amd64_printk(KERN_WARNING, "%s", ecc_warning);
return -ENODEV; return -ENODEV;
} }
} else
/* CLEAR the override, since BIOS controlled it */
ecc_enable_override = 0; ecc_enable_override = 0;
}
return 0; return 0;
} }
@ -2925,16 +2928,15 @@ static void __devexit amd64_remove_one_instance(struct pci_dev *pdev)
amd64_free_mc_sibling_devices(pvt); amd64_free_mc_sibling_devices(pvt);
kfree(pvt);
mci->pvt_info = NULL;
mci_lookup[pvt->mc_node_id] = NULL;
/* unregister from EDAC MCE */ /* unregister from EDAC MCE */
amd_report_gart_errors(false); amd_report_gart_errors(false);
amd_unregister_ecc_decoder(amd64_decode_bus_error); amd_unregister_ecc_decoder(amd64_decode_bus_error);
/* Free the EDAC CORE resources */ /* Free the EDAC CORE resources */
mci->pvt_info = NULL;
mci_lookup[pvt->mc_node_id] = NULL;
kfree(pvt);
edac_mc_free(mci); edac_mc_free(mci);
} }
@ -3011,25 +3013,29 @@ static void amd64_setup_pci_device(void)
static int __init amd64_edac_init(void) static int __init amd64_edac_init(void)
{ {
int nb, err = -ENODEV; int nb, err = -ENODEV;
bool load_ok = false;
edac_printk(KERN_INFO, EDAC_MOD_STR, EDAC_AMD64_VERSION "\n"); edac_printk(KERN_INFO, EDAC_MOD_STR, EDAC_AMD64_VERSION "\n");
opstate_init(); opstate_init();
if (cache_k8_northbridges() < 0) if (cache_k8_northbridges() < 0)
return err; goto err_ret;
msrs = msrs_alloc(); msrs = msrs_alloc();
if (!msrs)
goto err_ret;
err = pci_register_driver(&amd64_pci_driver); err = pci_register_driver(&amd64_pci_driver);
if (err) if (err)
return err; goto err_pci;
/* /*
* At this point, the array 'pvt_lookup[]' contains pointers to alloc'd * At this point, the array 'pvt_lookup[]' contains pointers to alloc'd
* amd64_pvt structs. These will be used in the 2nd stage init function * amd64_pvt structs. These will be used in the 2nd stage init function
* to finish initialization of the MC instances. * to finish initialization of the MC instances.
*/ */
err = -ENODEV;
for (nb = 0; nb < num_k8_northbridges; nb++) { for (nb = 0; nb < num_k8_northbridges; nb++) {
if (!pvt_lookup[nb]) if (!pvt_lookup[nb])
continue; continue;
@ -3037,16 +3043,21 @@ static int __init amd64_edac_init(void)
err = amd64_init_2nd_stage(pvt_lookup[nb]); err = amd64_init_2nd_stage(pvt_lookup[nb]);
if (err) if (err)
goto err_2nd_stage; goto err_2nd_stage;
load_ok = true;
} }
amd64_setup_pci_device(); if (load_ok) {
amd64_setup_pci_device();
return 0; return 0;
}
err_2nd_stage: err_2nd_stage:
debugf0("2nd stage failed\n");
pci_unregister_driver(&amd64_pci_driver); pci_unregister_driver(&amd64_pci_driver);
err_pci:
msrs_free(msrs);
msrs = NULL;
err_ret:
return err; return err;
} }

View file

@ -534,8 +534,6 @@ static void edac_pci_dev_parity_clear(struct pci_dev *dev)
{ {
u8 header_type; u8 header_type;
debugf0("%s()\n", __func__);
get_pci_parity_status(dev, 0); get_pci_parity_status(dev, 0);
/* read the device TYPE, looking for bridges */ /* read the device TYPE, looking for bridges */