From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
linux-kernel@vger.kernel.org,
Samuel Ortiz <sameo@linux.intel.com>,
Ben Dooks <ben@simtec.co.uk>,
Wolfram Sang <w.sang@pengutronix.de>
Subject: Re: [tps_init] BUG: unable to handle kernel paging request at 484970c9
Date: Sun, 25 Aug 2013 10:17:00 +0100 [thread overview]
Message-ID: <20130825091700.GT6617@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130825040939.GB17883@kroah.com>
On Sat, Aug 24, 2013 at 09:09:39PM -0700, Greg Kroah-Hartman wrote:
> Same as before, are you unloading and loading modules? We have a fix
> for modules that cause problems when unloading with the config option
> above enabled. But that shouldn't be this issue.
What seems to be is going on here is that something creates a kobject,
which gets exported into sysfs, then removed and then immediately
recreated.
It appears that sysfs entries are deleted in the cleanup function:
static void kobject_cleanup(struct kobject *kobj)
{
...
/* remove from sysfs if the caller did not do it */
if (kobj->state_in_sysfs) {
pr_debug("kobject: '%s' (%p): auto cleanup kobject_del\n",
kobject_name(kobj), kobj);
kobject_del(kobj);
}
which is now delayed. I don't think this is specifically a problem of
my patch - I think my patch is revealing a problem here.
Let's take it from the point of view of a struct device. Lets say that
a device with name "foo" gets created. This creates a sysfs directory
entry called "foo". Various things take a reference on the device.
You then unregister that struct device because it's been removed. As
all the references haven't yet been released, it means that the sysfs
directory persists. Now, if the device is recreated with the same
name, sysfs complains that the directory exists.
In this case, it's not a struct device, but a device driver itself:
/* some boards have startup glitches */
while (tries--) {
status = i2c_add_driver(&tps65010_driver);
if (the_tps)
break;
i2c_del_driver(&tps65010_driver);
if (!tries) {
printk(KERN_ERR "%s: no chip?\n", DRIVER_NAME);
return -ENODEV;
}
pr_debug("%s: re-probe ...\n", DRIVER_NAME);
msleep(10);
}
Notice how the (i2c) driver is registered and removed multiple times.
If something can independently grab a reference to the kobject associated
with that driver, then it can cause the sysfs directory to persist longer
than the re-probe, which will cause sysfs to complain.
I don't think moving the sysfs directory cleanup (via kobject_del()) before
the delayed release fixes the fundamental problem here, because that just
covers up what happens if a reference is held.
Commit 0f4dafc05 (Kobject: auto-cleanup on final unref) introduced the
kobject_del() into the cleanup function.
Any thoughts?
prev parent reply other threads:[~2013-08-25 9:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-25 0:04 Fengguang Wu
2013-08-25 4:09 ` Greg Kroah-Hartman
2013-08-25 4:39 ` Fengguang Wu
2013-08-25 9:17 ` Russell King - ARM Linux [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130825091700.GT6617@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=ben@simtec.co.uk \
--cc=fengguang.wu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=w.sang@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®