kobject: show debug info on delayed kobject release

Useful for locating buggy drivers on kernel oops.

It may add dozens of new lines to boot dmesg. DEBUG_KOBJECT_RELEASE is
hopefully only enabled in debug kernels (like maybe the Fedora rawhide
one, or at developers), so being a bit more verbose is likely ok.

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Fengguang Wu 2013-10-09 09:26:21 +08:00 коммит произвёл Greg Kroah-Hartman
Родитель a6b01deda1
Коммит 1461c5be7b
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -628,7 +628,7 @@ static void kobject_release(struct kref *kref)
{ {
struct kobject *kobj = container_of(kref, struct kobject, kref); struct kobject *kobj = container_of(kref, struct kobject, kref);
#ifdef CONFIG_DEBUG_KOBJECT_RELEASE #ifdef CONFIG_DEBUG_KOBJECT_RELEASE
pr_debug("kobject: '%s' (%p): %s, parent %p (delayed)\n", pr_info("kobject: '%s' (%p): %s, parent %p (delayed)\n",
kobject_name(kobj), kobj, __func__, kobj->parent); kobject_name(kobj), kobj, __func__, kobj->parent);
INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup); INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup);
schedule_delayed_work(&kobj->release, HZ); schedule_delayed_work(&kobj->release, HZ);