Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac
Browse files Browse the repository at this point in the history
Pull EDAC fixes from Mauro Carvalho Chehab.

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac:
  edac: Do alignment logic properly in edac_align_ptr()
  mpc85xx_edac: fix error: too few arguments to function 'edac_mc_alloc'
  edac: fix the error about memory type detection on SandyBridge
  edac: avoid mce decoding crash after edac driver unloaded
  • Loading branch information
Linus Torvalds committed Jun 18, 2012
2 parents 67f5d06 + 8447c4d commit 02edf6a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems)
else
return (char *)ptr;

r = size % align;
r = (unsigned long)p % align;

if (r == 0)
return (char *)ptr;
Expand Down
15 changes: 4 additions & 11 deletions drivers/edac/i7core_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1814,12 +1814,6 @@ static int i7core_mce_check_error(struct notifier_block *nb, unsigned long val,
if (mce->bank != 8)
return NOTIFY_DONE;

#ifdef CONFIG_SMP
/* Only handle if it is the right mc controller */
if (mce->socketid != pvt->i7core_dev->socket)
return NOTIFY_DONE;
#endif

smp_rmb();
if ((pvt->mce_out + 1) % MCE_LOG_LEN == pvt->mce_in) {
smp_wmb();
Expand Down Expand Up @@ -2116,8 +2110,6 @@ static void i7core_unregister_mci(struct i7core_dev *i7core_dev)
if (pvt->enable_scrub)
disable_sdram_scrub_setting(mci);

mce_unregister_decode_chain(&i7_mce_dec);

/* Disable EDAC polling */
i7core_pci_ctl_release(pvt);

Expand Down Expand Up @@ -2222,8 +2214,6 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev)
/* DCLK for scrub rate setting */
pvt->dclk_freq = get_dclk_freq();

mce_register_decode_chain(&i7_mce_dec);

return 0;

fail0:
Expand Down Expand Up @@ -2367,8 +2357,10 @@ static int __init i7core_init(void)

pci_rc = pci_register_driver(&i7core_driver);

if (pci_rc >= 0)
if (pci_rc >= 0) {
mce_register_decode_chain(&i7_mce_dec);
return 0;
}

i7core_printk(KERN_ERR, "Failed to register device with error %d.\n",
pci_rc);
Expand All @@ -2384,6 +2376,7 @@ static void __exit i7core_exit(void)
{
debugf2("MC: " __FILE__ ": %s()\n", __func__);
pci_unregister_driver(&i7core_driver);
mce_unregister_decode_chain(&i7_mce_dec);
}

module_init(i7core_init);
Expand Down
3 changes: 2 additions & 1 deletion drivers/edac/mpc85xx_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,8 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
layers[1].type = EDAC_MC_LAYER_CHANNEL;
layers[1].size = 1;
layers[1].is_virt_csrow = false;
mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), sizeof(*pdata));
mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers,
sizeof(*pdata));
if (!mci) {
devres_release_group(&op->dev, mpc85xx_mc_err_probe);
return -ENOMEM;
Expand Down
10 changes: 5 additions & 5 deletions drivers/edac/sb_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ static int get_dimm_config(struct mem_ctl_info *mci)
pvt->is_close_pg = false;
}

pci_read_config_dword(pvt->pci_ta, RANK_CFG_A, &reg);
pci_read_config_dword(pvt->pci_ddrio, RANK_CFG_A, &reg);
if (IS_RDIMM_ENABLED(reg)) {
/* FIXME: Can also be LRDIMM */
debugf0("Memory is registered\n");
Expand Down Expand Up @@ -1604,8 +1604,6 @@ static void sbridge_unregister_mci(struct sbridge_dev *sbridge_dev)
debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\n",
__func__, mci, &sbridge_dev->pdev[0]->dev);

mce_unregister_decode_chain(&sbridge_mce_dec);

/* Remove MC sysfs nodes */
edac_mc_del_mc(mci->dev);

Expand Down Expand Up @@ -1682,7 +1680,6 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev)
goto fail0;
}

mce_register_decode_chain(&sbridge_mce_dec);
return 0;

fail0:
Expand Down Expand Up @@ -1811,8 +1808,10 @@ static int __init sbridge_init(void)

pci_rc = pci_register_driver(&sbridge_driver);

if (pci_rc >= 0)
if (pci_rc >= 0) {
mce_register_decode_chain(&sbridge_mce_dec);
return 0;
}

sbridge_printk(KERN_ERR, "Failed to register device with error %d.\n",
pci_rc);
Expand All @@ -1828,6 +1827,7 @@ static void __exit sbridge_exit(void)
{
debugf2("MC: " __FILE__ ": %s()\n", __func__);
pci_unregister_driver(&sbridge_driver);
mce_unregister_decode_chain(&sbridge_mce_dec);
}

module_init(sbridge_init);
Expand Down

0 comments on commit 02edf6a

Please sign in to comment.