mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 00:08:50 +00:00
Fix EDAC lockdep splat
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJR7wupAAoJEKurIx+X31iBdGkP/2ySjQyhBZbY7wlqyTu7H6fk xF6TZ8Wu2swcEMSqQ/lDSDVX1G2iLtSWFBIYNapCp1inTpvOptPBX3Elh717HYau iOBl+B5NWyrZYcRMKL4uF+q+1MnTDpd+F2rfp16LqTHc+xUXRghokQMIVvGmCAp7 L5vf1icKFvR3e2SWKnkqPUkQeq6RzFSYQkXqmJn6iRa4BBQOgnjEhEXId+DzDEK6 7YMfD4lIjISeuYHL/Vt236aJOWGg4Edbbm+9HavEl6H5/QHxH/r2OEJHOoCZ4E9k BV/UHxbT8YcC+yjg67WzoV8AmDrgeMfeLRzcrGFxl1ldA3ncDTwOjgP5UPnU5w2U ZmmHtieTeI4UduKAFmB67SKjzh0vREeSLe8JcAuF7pWxLdrqpfCV7ak0SYYyPIU3 kbOHK9S1rwRriG484PZkE9JIcT/VXew00ZFvN9KSOrRvKUXLsnm3NVhBbJgb7uHk trKZK8bDhPyLDiAfvqGr9jU6kodKzggXtXlhXrgKmOIcbbyqqj/PLdd84fU0ofki z7QCqzua/2bs3tJIvLois70NPERIsQtEp45uKl03e547l/Ue+qWntrftIf/h0sBX FLUOGaTFkl1P8Ijd5bbpseEiH5rd7QPY2W96TfsVU3qvZqDLo+qGIL+PW+uoikNI zSTB6KERhR3hR0KfpZGK =WKhM -----END PGP SIGNATURE----- Merge tag 'please-pull-bp-edac' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fix from Tony Luck: "Fix EDAC lockdep splat" * tag 'please-pull-bp-edac' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC: Fix lockdep splat
This commit is contained in:
commit
04012e3076
@ -48,6 +48,8 @@ static LIST_HEAD(mc_devices);
|
||||
*/
|
||||
static void const *edac_mc_owner;
|
||||
|
||||
static struct bus_type mc_bus[EDAC_MAX_MCS];
|
||||
|
||||
unsigned edac_dimm_info_location(struct dimm_info *dimm, char *buf,
|
||||
unsigned len)
|
||||
{
|
||||
@ -723,6 +725,11 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
|
||||
int ret = -EINVAL;
|
||||
edac_dbg(0, "\n");
|
||||
|
||||
if (mci->mc_idx >= EDAC_MAX_MCS) {
|
||||
pr_warn_once("Too many memory controllers: %d\n", mci->mc_idx);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EDAC_DEBUG
|
||||
if (edac_debug_level >= 3)
|
||||
edac_mc_dump_mci(mci);
|
||||
@ -762,6 +769,8 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
|
||||
/* set load time so that error rate can be tracked */
|
||||
mci->start_time = jiffies;
|
||||
|
||||
mci->bus = &mc_bus[mci->mc_idx];
|
||||
|
||||
if (edac_create_sysfs_mci_device(mci)) {
|
||||
edac_mc_printk(mci, KERN_WARNING,
|
||||
"failed to create sysfs device\n");
|
||||
|
@ -370,7 +370,7 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
|
||||
return -ENODEV;
|
||||
|
||||
csrow->dev.type = &csrow_attr_type;
|
||||
csrow->dev.bus = &mci->bus;
|
||||
csrow->dev.bus = mci->bus;
|
||||
device_initialize(&csrow->dev);
|
||||
csrow->dev.parent = &mci->dev;
|
||||
csrow->mci = mci;
|
||||
@ -605,7 +605,7 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci,
|
||||
dimm->mci = mci;
|
||||
|
||||
dimm->dev.type = &dimm_attr_type;
|
||||
dimm->dev.bus = &mci->bus;
|
||||
dimm->dev.bus = mci->bus;
|
||||
device_initialize(&dimm->dev);
|
||||
|
||||
dimm->dev.parent = &mci->dev;
|
||||
@ -975,11 +975,13 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
|
||||
* The memory controller needs its own bus, in order to avoid
|
||||
* namespace conflicts at /sys/bus/edac.
|
||||
*/
|
||||
mci->bus.name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
|
||||
if (!mci->bus.name)
|
||||
mci->bus->name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
|
||||
if (!mci->bus->name)
|
||||
return -ENOMEM;
|
||||
edac_dbg(0, "creating bus %s\n", mci->bus.name);
|
||||
err = bus_register(&mci->bus);
|
||||
|
||||
edac_dbg(0, "creating bus %s\n", mci->bus->name);
|
||||
|
||||
err = bus_register(mci->bus);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@ -988,7 +990,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
|
||||
device_initialize(&mci->dev);
|
||||
|
||||
mci->dev.parent = mci_pdev;
|
||||
mci->dev.bus = &mci->bus;
|
||||
mci->dev.bus = mci->bus;
|
||||
dev_set_name(&mci->dev, "mc%d", mci->mc_idx);
|
||||
dev_set_drvdata(&mci->dev, mci);
|
||||
pm_runtime_forbid(&mci->dev);
|
||||
@ -997,8 +999,8 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
|
||||
err = device_add(&mci->dev);
|
||||
if (err < 0) {
|
||||
edac_dbg(1, "failure: create device %s\n", dev_name(&mci->dev));
|
||||
bus_unregister(&mci->bus);
|
||||
kfree(mci->bus.name);
|
||||
bus_unregister(mci->bus);
|
||||
kfree(mci->bus->name);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1064,8 +1066,8 @@ fail:
|
||||
}
|
||||
fail2:
|
||||
device_unregister(&mci->dev);
|
||||
bus_unregister(&mci->bus);
|
||||
kfree(mci->bus.name);
|
||||
bus_unregister(mci->bus);
|
||||
kfree(mci->bus->name);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1098,8 +1100,8 @@ void edac_unregister_sysfs(struct mem_ctl_info *mci)
|
||||
{
|
||||
edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
|
||||
device_unregister(&mci->dev);
|
||||
bus_unregister(&mci->bus);
|
||||
kfree(mci->bus.name);
|
||||
bus_unregister(mci->bus);
|
||||
kfree(mci->bus->name);
|
||||
}
|
||||
|
||||
static void mc_attr_release(struct device *dev)
|
||||
|
@ -974,7 +974,7 @@ static int i5100_setup_debugfs(struct mem_ctl_info *mci)
|
||||
if (!i5100_debugfs)
|
||||
return -ENODEV;
|
||||
|
||||
priv->debugfs = debugfs_create_dir(mci->bus.name, i5100_debugfs);
|
||||
priv->debugfs = debugfs_create_dir(mci->bus->name, i5100_debugfs);
|
||||
|
||||
if (!priv->debugfs)
|
||||
return -ENOMEM;
|
||||
|
@ -622,7 +622,7 @@ struct edac_raw_error_desc {
|
||||
*/
|
||||
struct mem_ctl_info {
|
||||
struct device dev;
|
||||
struct bus_type bus;
|
||||
struct bus_type *bus;
|
||||
|
||||
struct list_head link; /* for global list of mem_ctl_info structs */
|
||||
|
||||
@ -742,4 +742,9 @@ struct mem_ctl_info {
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* Maximum number of memory controllers in the coherent fabric.
|
||||
*/
|
||||
#define EDAC_MAX_MCS 16
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user