LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [GIT PATCH] driver core fixes against 2.6.25-rc3 git
@ 2008-03-04 23:15 Greg KH
2008-03-04 23:18 ` [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED Greg Kroah-Hartman
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: Greg KH @ 2008-03-04 23:15 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel
Here are a few driver core fixes against your current git tree that fix some
more problems that have cropped up:
- suspend/resume bugfixes
- ksets were not getting properly initialized
- CONFIG_SYSFS_DEPRECATED was catching people with old userspace
versions of LVM now that the block core is changed to use
struct device.
- other driver core bugs on error paths.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
Patches will be sent as a follow-on to this message to lkml for people
to see.
thanks,
greg k-h
------------
drivers/base/core.c | 14 +-----
drivers/base/power/main.c | 108 +++++++--------------------------------------
drivers/usb/core/usb.c | 2 +-
fs/debugfs/inode.c | 4 --
include/linux/debugfs.h | 5 ++
init/Kconfig | 11 +++-
lib/kobject.c | 11 ++---
7 files changed, 39 insertions(+), 116 deletions(-)
---------------
Alan Stern (1):
PM: fix new mutex-locking bug in the PM core
Cornelia Huck (1):
Driver core: Fix cleanup when failing device_add().
Greg Kroah-Hartman (2):
driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED
kobject: properly initialize ksets
Harvey Harrison (1):
debugfs: fix sparse warnings
Ingo Molnar (1):
sysfs: CONFIG_SYSFS_DEPRECATED fix
Rafael J. Wysocki (2):
PM: Do not acquire device semaphores upfront during suspend
driver core: Remove dpm_sysfs_remove() from error path of device_add()
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
2008-03-05 15:58 ` Valdis.Kletnieks
2008-03-04 23:18 ` [PATCH 2/8] sysfs: CONFIG_SYSFS_DEPRECATED fix Greg Kroah-Hartman
` (6 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Kay Sievers, Jiri Slaby
As things get moved into this config option, the hard date of 2006 does
not work anymore, so update the text to be more descriptive.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
init/Kconfig | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/init/Kconfig b/init/Kconfig
index f698a5a..e6606e6 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -382,10 +382,11 @@ config SYSFS_DEPRECATED
If enabled, this option will also move any device structures
that belong to a class, back into the /sys/class hierarchy, in
- order to support older versions of udev.
+ order to support older versions of udev and some userspace
+ programs.
- If you are using a distro that was released in 2006 or later,
- it should be safe to say N here.
+ If you are using a distro with the most recent userspace
+ packages, it should be safe to say N here.
config CGROUP_MEM_CONT
bool "Memory controller for cgroups"
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/8] sysfs: CONFIG_SYSFS_DEPRECATED fix
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
2008-03-04 23:18 ` [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED Greg Kroah-Hartman
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 3/8] kobject: properly initialize ksets Greg Kroah-Hartman
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel
Cc: Ingo Molnar, Kay Sievers, Linus Torvalds, Andrew Morton,
Greg Kroah-Hartman
From: Ingo Molnar <mingo@elte.hu>
CONFIG_SYSFS_DEPRECATED=y changed its meaning recently and causes
regressions in working setups that had SYSFS_DEPRECATED disabled.
so rename it to SYSFS_DEPRECATED_V2 so that testers pick up the new
default via 'make oldconfig', even if their old .config's disabled
CONFIG_SYSFS_DEPRECATED ...
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
init/Kconfig | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/init/Kconfig b/init/Kconfig
index e6606e6..98ebf37 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -367,9 +367,13 @@ config RESOURCE_COUNTERS
depends on CGROUPS
config SYSFS_DEPRECATED
+ bool
+
+config SYSFS_DEPRECATED_V2
bool "Create deprecated sysfs files"
depends on SYSFS
default y
+ select SYSFS_DEPRECATED
help
This option creates deprecated symlinks such as the
"device"-link, the <subsystem>:<name>-link, and the
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/8] kobject: properly initialize ksets
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
2008-03-04 23:18 ` [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 2/8] sysfs: CONFIG_SYSFS_DEPRECATED fix Greg Kroah-Hartman
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 4/8] PM: Do not acquire device semaphores upfront during suspend Greg Kroah-Hartman
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Kay Sievers, Hannes Reinecke
kset_initialize was calling kobject_init_internal() which didn't
initialize the kobject as well as kobject_init() was. So have
kobject_init() call kobject_init_internal() and move the logic to
initalize the kobject there.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
lib/kobject.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/kobject.c b/lib/kobject.c
index d784dae..0d03252 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -153,6 +153,10 @@ static void kobject_init_internal(struct kobject *kobj)
return;
kref_init(&kobj->kref);
INIT_LIST_HEAD(&kobj->entry);
+ kobj->state_in_sysfs = 0;
+ kobj->state_add_uevent_sent = 0;
+ kobj->state_remove_uevent_sent = 0;
+ kobj->state_initialized = 1;
}
@@ -289,13 +293,8 @@ void kobject_init(struct kobject *kobj, struct kobj_type *ktype)
dump_stack();
}
- kref_init(&kobj->kref);
- INIT_LIST_HEAD(&kobj->entry);
+ kobject_init_internal(kobj);
kobj->ktype = ktype;
- kobj->state_in_sysfs = 0;
- kobj->state_add_uevent_sent = 0;
- kobj->state_remove_uevent_sent = 0;
- kobj->state_initialized = 1;
return;
error:
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/8] PM: Do not acquire device semaphores upfront during suspend
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
` (2 preceding siblings ...)
2008-03-04 23:18 ` [PATCH 3/8] kobject: properly initialize ksets Greg Kroah-Hartman
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 5/8] PM: fix new mutex-locking bug in the PM core Greg Kroah-Hartman
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Rafael J. Wysocki, Greg Kroah-Hartman
From: Rafael J. Wysocki <rjw@sisk.pl>
Remove the code that acquires all device semaphores from the suspend
code path as it causes multiple problems to appear (most notably,
http://bugzilla.kernel.org/show_bug.cgi?id=10030) and revert the
change introduced by commit 4145ed6dc597a9bea5f6ae8c574653b2de10620f
depending on the code being removed.
Remove pm_sleep_lock()/pm_sleep_unlock() from device_add() to avoid
the issue reported at http://bugzilla.kernel.org/show_bug.cgi?id=9874.
It should fix the regreesions reported at:
http://bugzilla.kernel.org/show_bug.cgi?id=9874
http://bugzilla.kernel.org/show_bug.cgi?id=10030
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/core.c | 8 ---
drivers/base/power/main.c | 106 +++++++--------------------------------------
drivers/usb/core/usb.c | 2 +-
3 files changed, 17 insertions(+), 99 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 9c0070b..1e2e0fa 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -770,13 +770,6 @@ int device_add(struct device *dev)
struct class_interface *class_intf;
int error;
- error = pm_sleep_lock();
- if (error) {
- dev_warn(dev, "Suspicious %s during suspend\n", __FUNCTION__);
- dump_stack();
- return error;
- }
-
dev = get_device(dev);
if (!dev || !strlen(dev->bus_id)) {
error = -EINVAL;
@@ -843,7 +836,6 @@ int device_add(struct device *dev)
}
Done:
put_device(dev);
- pm_sleep_unlock();
return error;
BusError:
device_pm_remove(dev);
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index ee9d1c8..b0c16f6 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -48,7 +48,6 @@
*/
LIST_HEAD(dpm_active);
-static LIST_HEAD(dpm_locked);
static LIST_HEAD(dpm_off);
static LIST_HEAD(dpm_off_irq);
static LIST_HEAD(dpm_destroy);
@@ -81,28 +80,6 @@ void device_pm_add(struct device *dev)
*/
void device_pm_remove(struct device *dev)
{
- /*
- * If this function is called during a suspend, it will be blocked,
- * because we're holding the device's semaphore at that time, which may
- * lead to a deadlock. In that case we want to print a warning.
- * However, it may also be called by unregister_dropped_devices() with
- * the device's semaphore released, in which case the warning should
- * not be printed.
- */
- if (down_trylock(&dev->sem)) {
- if (down_read_trylock(&pm_sleep_rwsem)) {
- /* No suspend in progress, wait on dev->sem */
- down(&dev->sem);
- up_read(&pm_sleep_rwsem);
- } else {
- /* Suspend in progress, we may deadlock */
- dev_warn(dev, "Suspicious %s during suspend\n",
- __FUNCTION__);
- dump_stack();
- /* The user has been warned ... */
- down(&dev->sem);
- }
- }
pr_debug("PM: Removing info for %s:%s\n",
dev->bus ? dev->bus->name : "No Bus",
kobject_name(&dev->kobj));
@@ -110,7 +87,6 @@ void device_pm_remove(struct device *dev)
dpm_sysfs_remove(dev);
list_del_init(&dev->power.entry);
mutex_unlock(&dpm_list_mtx);
- up(&dev->sem);
}
/**
@@ -230,6 +206,8 @@ static int resume_device(struct device *dev)
TRACE_DEVICE(dev);
TRACE_RESUME(0);
+ down(&dev->sem);
+
if (dev->bus && dev->bus->resume) {
dev_dbg(dev,"resuming\n");
error = dev->bus->resume(dev);
@@ -245,6 +223,8 @@ static int resume_device(struct device *dev)
error = dev->class->resume(dev);
}
+ up(&dev->sem);
+
TRACE_RESUME(error);
return error;
}
@@ -266,7 +246,7 @@ static void dpm_resume(void)
struct list_head *entry = dpm_off.next;
struct device *dev = to_device(entry);
- list_move_tail(entry, &dpm_locked);
+ list_move_tail(entry, &dpm_active);
mutex_unlock(&dpm_list_mtx);
resume_device(dev);
mutex_lock(&dpm_list_mtx);
@@ -275,25 +255,6 @@ static void dpm_resume(void)
}
/**
- * unlock_all_devices - Release each device's semaphore
- *
- * Go through the dpm_off list. Put each device on the dpm_active
- * list and unlock it.
- */
-static void unlock_all_devices(void)
-{
- mutex_lock(&dpm_list_mtx);
- while (!list_empty(&dpm_locked)) {
- struct list_head *entry = dpm_locked.prev;
- struct device *dev = to_device(entry);
-
- list_move(entry, &dpm_active);
- up(&dev->sem);
- }
- mutex_unlock(&dpm_list_mtx);
-}
-
-/**
* unregister_dropped_devices - Unregister devices scheduled for removal
*
* Unregister all devices on the dpm_destroy list.
@@ -305,7 +266,6 @@ static void unregister_dropped_devices(void)
struct list_head *entry = dpm_destroy.next;
struct device *dev = to_device(entry);
- up(&dev->sem);
mutex_unlock(&dpm_list_mtx);
/* This also removes the device from the list */
device_unregister(dev);
@@ -324,7 +284,6 @@ void device_resume(void)
{
might_sleep();
dpm_resume();
- unlock_all_devices();
unregister_dropped_devices();
up_write(&pm_sleep_rwsem);
}
@@ -388,18 +347,15 @@ int device_power_down(pm_message_t state)
struct list_head *entry = dpm_off.prev;
struct device *dev = to_device(entry);
- list_del_init(&dev->power.entry);
error = suspend_device_late(dev, state);
if (error) {
printk(KERN_ERR "Could not power down device %s: "
"error %d\n",
kobject_name(&dev->kobj), error);
- if (list_empty(&dev->power.entry))
- list_add(&dev->power.entry, &dpm_off);
break;
}
- if (list_empty(&dev->power.entry))
- list_add(&dev->power.entry, &dpm_off_irq);
+ if (!list_empty(&dev->power.entry))
+ list_move(&dev->power.entry, &dpm_off_irq);
}
if (!error)
@@ -419,6 +375,8 @@ static int suspend_device(struct device *dev, pm_message_t state)
{
int error = 0;
+ down(&dev->sem);
+
if (dev->power.power_state.event) {
dev_dbg(dev, "PM: suspend %d-->%d\n",
dev->power.power_state.event, state.event);
@@ -441,6 +399,9 @@ static int suspend_device(struct device *dev, pm_message_t state)
error = dev->bus->suspend(dev, state);
suspend_report_result(dev->bus->suspend, error);
}
+
+ up(&dev->sem);
+
return error;
}
@@ -461,11 +422,10 @@ static int dpm_suspend(pm_message_t state)
int error = 0;
mutex_lock(&dpm_list_mtx);
- while (!list_empty(&dpm_locked)) {
- struct list_head *entry = dpm_locked.prev;
+ while (!list_empty(&dpm_active)) {
+ struct list_head *entry = dpm_active.prev;
struct device *dev = to_device(entry);
- list_del_init(&dev->power.entry);
mutex_unlock(&dpm_list_mtx);
error = suspend_device(dev, state);
if (error) {
@@ -476,14 +436,11 @@ static int dpm_suspend(pm_message_t state)
(error == -EAGAIN ?
" (please convert to suspend_late)" :
""));
- mutex_lock(&dpm_list_mtx);
- if (list_empty(&dev->power.entry))
- list_add(&dev->power.entry, &dpm_locked);
break;
}
mutex_lock(&dpm_list_mtx);
- if (list_empty(&dev->power.entry))
- list_add(&dev->power.entry, &dpm_off);
+ if (!list_empty(&dev->power.entry))
+ list_move(&dev->power.entry, &dpm_off);
}
mutex_unlock(&dpm_list_mtx);
@@ -491,36 +448,6 @@ static int dpm_suspend(pm_message_t state)
}
/**
- * lock_all_devices - Acquire every device's semaphore
- *
- * Go through the dpm_active list. Carefully lock each device's
- * semaphore and put it in on the dpm_locked list.
- */
-static void lock_all_devices(void)
-{
- mutex_lock(&dpm_list_mtx);
- while (!list_empty(&dpm_active)) {
- struct list_head *entry = dpm_active.next;
- struct device *dev = to_device(entry);
-
- /* Required locking order is dev->sem first,
- * then dpm_list_mutex. Hence this awkward code.
- */
- get_device(dev);
- mutex_unlock(&dpm_list_mtx);
- down(&dev->sem);
- mutex_lock(&dpm_list_mtx);
-
- if (list_empty(entry))
- up(&dev->sem); /* Device was removed */
- else
- list_move_tail(entry, &dpm_locked);
- put_device(dev);
- }
- mutex_unlock(&dpm_list_mtx);
-}
-
-/**
* device_suspend - Save state and stop all devices in system.
* @state: new power management state
*
@@ -533,7 +460,6 @@ int device_suspend(pm_message_t state)
might_sleep();
down_write(&pm_sleep_rwsem);
- lock_all_devices();
error = dpm_suspend(state);
if (error)
device_resume();
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index f6f1990..1f0db51 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -233,7 +233,7 @@ static int ksuspend_usb_init(void)
* singlethreaded. Its job doesn't justify running on more
* than one CPU.
*/
- ksuspend_usb_wq = create_singlethread_workqueue("ksuspend_usbd");
+ ksuspend_usb_wq = create_freezeable_workqueue("ksuspend_usbd");
if (!ksuspend_usb_wq)
return -ENOMEM;
return 0;
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/8] PM: fix new mutex-locking bug in the PM core
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
` (3 preceding siblings ...)
2008-03-04 23:18 ` [PATCH 4/8] PM: Do not acquire device semaphores upfront during suspend Greg Kroah-Hartman
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 6/8] driver core: Remove dpm_sysfs_remove() from error path of device_add() Greg Kroah-Hartman
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Alan Stern, Greg Kroah-Hartman
From: Alan Stern <stern@rowland.harvard.edu>
This patch (as1041) fixes a bug introduced by the
acquire-all-device-semaphores reversion. The error pathway of
dpm_suspend() fails to reacquire a mutex it should be holding.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/power/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index b0c16f6..d887d5c 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -428,6 +428,7 @@ static int dpm_suspend(pm_message_t state)
mutex_unlock(&dpm_list_mtx);
error = suspend_device(dev, state);
+ mutex_lock(&dpm_list_mtx);
if (error) {
printk(KERN_ERR "Could not suspend device %s: "
"error %d%s\n",
@@ -438,7 +439,6 @@ static int dpm_suspend(pm_message_t state)
""));
break;
}
- mutex_lock(&dpm_list_mtx);
if (!list_empty(&dev->power.entry))
list_move(&dev->power.entry, &dpm_off);
}
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 6/8] driver core: Remove dpm_sysfs_remove() from error path of device_add()
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
` (4 preceding siblings ...)
2008-03-04 23:18 ` [PATCH 5/8] PM: fix new mutex-locking bug in the PM core Greg Kroah-Hartman
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 7/8] Driver core: Fix cleanup when failing device_add() Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 8/8] debugfs: fix sparse warnings Greg Kroah-Hartman
7 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Rafael J. Wysocki, Greg Kroah-Hartman
From: Rafael J. Wysocki <rjw@sisk.pl>
Since device_pm_remove(dev) calls dpm_sysfs_remove(dev), it's
incorrect to call the latter after the former in the device_add()
error path.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/core.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 1e2e0fa..7f59c2f 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -839,7 +839,6 @@ int device_add(struct device *dev)
return error;
BusError:
device_pm_remove(dev);
- dpm_sysfs_remove(dev);
PMError:
if (dev->bus)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 7/8] Driver core: Fix cleanup when failing device_add().
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
` (5 preceding siblings ...)
2008-03-04 23:18 ` [PATCH 6/8] driver core: Remove dpm_sysfs_remove() from error path of device_add() Greg Kroah-Hartman
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 8/8] debugfs: fix sparse warnings Greg Kroah-Hartman
7 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Cornelia Huck, Greg Kroah-Hartman
From: Cornelia Huck <cornelia.huck@de.ibm.com>
Driver core: Fix cleanup when failing device_add().
- Don't call cleanup_device_parent() if we didn't call setup_parent().
- dev->kobj.parent may be NULL when cleanup_device_parent() is called,
so we need to handle glue_dir == NULL in cleanup_glue_dir().
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/core.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 7f59c2f..7de543d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -621,7 +621,8 @@ static struct kobject *get_device_parent(struct device *dev,
static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
{
/* see if we live in a "glue" directory */
- if (!dev->class || glue_dir->kset != &dev->class->class_dirs)
+ if (!glue_dir || !dev->class ||
+ glue_dir->kset != &dev->class->class_dirs)
return;
kobject_put(glue_dir);
@@ -773,7 +774,7 @@ int device_add(struct device *dev)
dev = get_device(dev);
if (!dev || !strlen(dev->bus_id)) {
error = -EINVAL;
- goto Error;
+ goto Done;
}
pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 8/8] debugfs: fix sparse warnings
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
` (6 preceding siblings ...)
2008-03-04 23:18 ` [PATCH 7/8] Driver core: Fix cleanup when failing device_add() Greg Kroah-Hartman
@ 2008-03-04 23:18 ` Greg Kroah-Hartman
7 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2008-03-04 23:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Harvey Harrison, Greg Kroah-Hartman
From: Harvey Harrison <harvey.harrison@gmail.com>
extern does not belong in C files, move declaration to linux/debugfs.h
fs/debugfs/file.c:42:30: warning: symbol 'debugfs_file_operations' was not declared. Should it be static?
fs/debugfs/file.c:54:31: warning: symbol 'debugfs_link_operations' was not declared. Should it be static?
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
fs/debugfs/inode.c | 4 ----
include/linux/debugfs.h | 5 +++++
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index d26e282..e9602d8 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -29,10 +29,6 @@
#define DEBUGFS_MAGIC 0x64626720
-/* declared over in file.c */
-extern struct file_operations debugfs_file_operations;
-extern struct inode_operations debugfs_link_operations;
-
static struct vfsmount *debugfs_mount;
static int debugfs_mount_count;
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index f592d6d..7266124 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -27,6 +27,11 @@ struct debugfs_blob_wrapper {
};
#if defined(CONFIG_DEBUG_FS)
+
+/* declared over in file.c */
+extern const struct file_operations debugfs_file_operations;
+extern const struct inode_operations debugfs_link_operations;
+
struct dentry *debugfs_create_file(const char *name, mode_t mode,
struct dentry *parent, void *data,
const struct file_operations *fops);
--
1.5.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED
2008-03-04 23:18 ` [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED Greg Kroah-Hartman
@ 2008-03-05 15:58 ` Valdis.Kletnieks
2008-03-05 16:05 ` Greg KH
0 siblings, 1 reply; 12+ messages in thread
From: Valdis.Kletnieks @ 2008-03-05 15:58 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Kay Sievers, Jiri Slaby
[-- Attachment #1: Type: text/plain, Size: 515 bytes --]
On Tue, 04 Mar 2008 15:18:45 PST, Greg Kroah-Hartman said:
> - If you are using a distro that was released in 2006 or later,
> - it should be safe to say N here.
> + If you are using a distro with the most recent userspace
> + packages, it should be safe to say N here.
Might want to be a bit more specific here - I *think* udev, lvm, and nash
were the common ones that broke this time around. Speaking of which,
did anybody rev Documentation/Changes to mention the currently required
releases of stuff?
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED
2008-03-05 15:58 ` Valdis.Kletnieks
@ 2008-03-05 16:05 ` Greg KH
2008-03-05 21:24 ` Valdis.Kletnieks
0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2008-03-05 16:05 UTC (permalink / raw)
To: Valdis.Kletnieks; +Cc: linux-kernel, Kay Sievers, Jiri Slaby
On Wed, Mar 05, 2008 at 10:58:13AM -0500, Valdis.Kletnieks@vt.edu wrote:
> On Tue, 04 Mar 2008 15:18:45 PST, Greg Kroah-Hartman said:
>
> > - If you are using a distro that was released in 2006 or later,
> > - it should be safe to say N here.
> > + If you are using a distro with the most recent userspace
> > + packages, it should be safe to say N here.
>
> Might want to be a bit more specific here - I *think* udev, lvm, and nash
> were the common ones that broke this time around.
udev did not break, and nash is a shell, so it would have a hard time
"breaking" :)
> Speaking of which, did anybody rev Documentation/Changes to mention
> the currently required releases of stuff?
The versions "required" did not change if you just enable that config
option.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED
2008-03-05 16:05 ` Greg KH
@ 2008-03-05 21:24 ` Valdis.Kletnieks
0 siblings, 0 replies; 12+ messages in thread
From: Valdis.Kletnieks @ 2008-03-05 21:24 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Kay Sievers, Jiri Slaby
[-- Attachment #1: Type: text/plain, Size: 861 bytes --]
On Wed, 05 Mar 2008 08:05:55 PST, Greg KH said:
> On Wed, Mar 05, 2008 at 10:58:13AM -0500, Valdis.Kletnieks@vt.edu wrote:
> > On Tue, 04 Mar 2008 15:18:45 PST, Greg Kroah-Hartman said:
> >
> > > - If you are using a distro that was released in 2006 or later,
> > > - it should be safe to say N here.
> > > + If you are using a distro with the most recent userspace
> > > + packages, it should be safe to say N here.
> >
> > Might want to be a bit more specific here - I *think* udev, lvm, and nash
> > were the common ones that broke this time around.
>
> udev did not break, and nash is a shell, so it would have a hard time
> "breaking" :)
The problem with nash was that it has some builtins for creating
entries in /dev (basically, a subset of udev).
And you're right, this time was nash, the others were the *last* time
we busticated /sys. ;)
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-03-05 21:53 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04 23:15 [GIT PATCH] driver core fixes against 2.6.25-rc3 git Greg KH
2008-03-04 23:18 ` [PATCH 1/8] driver core: fix up Kconfig text for CONFIG_SYSFS_DEPRECATED Greg Kroah-Hartman
2008-03-05 15:58 ` Valdis.Kletnieks
2008-03-05 16:05 ` Greg KH
2008-03-05 21:24 ` Valdis.Kletnieks
2008-03-04 23:18 ` [PATCH 2/8] sysfs: CONFIG_SYSFS_DEPRECATED fix Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 3/8] kobject: properly initialize ksets Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 4/8] PM: Do not acquire device semaphores upfront during suspend Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 5/8] PM: fix new mutex-locking bug in the PM core Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 6/8] driver core: Remove dpm_sysfs_remove() from error path of device_add() Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 7/8] Driver core: Fix cleanup when failing device_add() Greg Kroah-Hartman
2008-03-04 23:18 ` [PATCH 8/8] debugfs: fix sparse warnings Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).