* [GIT PATCH] Driver core fixes for 2.6.21-rc3
@ 2007-03-10 4:04 Greg KH
2007-03-10 4:07 ` [PATCH 1/5] Revert "driver core: refcounting fix" Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2007-03-10 4:04 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 1333 bytes --]
Here are some driver core fixes for 2.6.21-rc3.
They fix the following thing:
- fix reference counting bug when removing any driver module from the
system by reverting a previous "fix".
- allow older versions of HAL to find network devices even if
CONFIG_SYSFS_DEPRECATED is disabled.
- fix an oops when moving kobjects to the same destination location as
they currently are caused by the bluetooth layer.
- export a symbol to allow the wireless core to be built as a module -
remove the devfs entry in the MAINTAINERS file.
All of these have been in the -mm tree.
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
MAINTAINERS | 3 ---
drivers/base/core.c | 23 ++++++++++++++---------
kernel/module.c | 6 ------
lib/kobject.c | 2 ++
4 files changed, 16 insertions(+), 18 deletions(-)
---------------
Dmitriy Monakhov (1):
kobject: new_device->kref wasn't putted after error in kobject_move()
Greg Kroah-Hartman (2):
Revert "driver core: refcounting fix"
Driver core: add device symlink back to sysfs
Johannes Berg (1):
driver core: export device_rename
Jörn Engel (1):
Remove devfs from MAINTAINERS
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] Revert "driver core: refcounting fix"
2007-03-10 4:04 [GIT PATCH] Driver core fixes for 2.6.21-rc3 Greg KH
@ 2007-03-10 4:07 ` Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 2/5] Driver core: add device symlink back to sysfs Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2007-03-10 4:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman
This reverts commit 63ce18cfe685115ff8d341bae4c9204a79043cf0.
It was the incorrect fix and causes a reference counting bug whenever
any driver module is removed from the system. Mike Galbraith
<efault@gmx.de> is looking for the real fix for his problem.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
kernel/module.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index f77e893..fbc51de 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2419,12 +2419,6 @@ void module_remove_driver(struct device_driver *drv)
kfree(driver_name);
}
}
- /*
- * Undo the additional reference we added in module_add_driver()
- * via kset_find_obj()
- */
- if (drv->mod_name)
- kobject_put(&drv->kobj);
}
EXPORT_SYMBOL(module_remove_driver);
#endif
--
1.5.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] Driver core: add device symlink back to sysfs
2007-03-10 4:07 ` [PATCH 1/5] Revert "driver core: refcounting fix" Greg Kroah-Hartman
@ 2007-03-10 4:07 ` Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 3/5] Remove devfs from MAINTAINERS Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2007-03-10 4:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman
This moves the device symlink back to sysfs even if
CONFIG_SYSFS_DEPRECATED is enabled as too many userspace programs (well,
HAL), still rely on this link to be present.
I will rework the ability for sysfs to change layouts like this in the
future, but for now, this patch should fix people's network connections.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/core.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 89ebe36..fb16f29 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -584,17 +584,17 @@ int device_add(struct device *dev)
if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
sysfs_create_link(&dev->class->subsys.kset.kobj,
&dev->kobj, dev->bus_id);
-#ifdef CONFIG_SYSFS_DEPRECATED
if (parent) {
sysfs_create_link(&dev->kobj, &dev->parent->kobj,
"device");
+#ifdef CONFIG_SYSFS_DEPRECATED
class_name = make_class_name(dev->class->name,
&dev->kobj);
if (class_name)
sysfs_create_link(&dev->parent->kobj,
&dev->kobj, class_name);
- }
#endif
+ }
}
if ((error = device_add_attrs(dev)))
@@ -651,17 +651,17 @@ int device_add(struct device *dev)
if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
sysfs_remove_link(&dev->class->subsys.kset.kobj,
dev->bus_id);
-#ifdef CONFIG_SYSFS_DEPRECATED
if (parent) {
+#ifdef CONFIG_SYSFS_DEPRECATED
char *class_name = make_class_name(dev->class->name,
&dev->kobj);
if (class_name)
sysfs_remove_link(&dev->parent->kobj,
class_name);
kfree(class_name);
+#endif
sysfs_remove_link(&dev->kobj, "device");
}
-#endif
down(&dev->class->sem);
/* notify any interfaces that the device is now gone */
@@ -761,17 +761,17 @@ void device_del(struct device * dev)
if (dev->kobj.parent != &dev->class->subsys.kset.kobj)
sysfs_remove_link(&dev->class->subsys.kset.kobj,
dev->bus_id);
-#ifdef CONFIG_SYSFS_DEPRECATED
if (parent) {
+#ifdef CONFIG_SYSFS_DEPRECATED
char *class_name = make_class_name(dev->class->name,
&dev->kobj);
if (class_name)
sysfs_remove_link(&dev->parent->kobj,
class_name);
kfree(class_name);
+#endif
sysfs_remove_link(&dev->kobj, "device");
}
-#endif
down(&dev->class->sem);
/* notify any interfaces that the device is now gone */
@@ -1071,8 +1071,8 @@ static int device_move_class_links(struct device *dev,
struct device *old_parent,
struct device *new_parent)
{
+ int error = 0;
#ifdef CONFIG_SYSFS_DEPRECATED
- int error;
char *class_name;
class_name = make_class_name(dev->class->name, &dev->kobj);
@@ -1100,7 +1100,12 @@ out:
kfree(class_name);
return error;
#else
- return 0;
+ if (old_parent)
+ sysfs_remove_link(&dev->kobj, "device");
+ if (new_parent)
+ error = sysfs_create_link(&dev->kobj, &new_parent->kobj,
+ "device");
+ return error;
#endif
}
--
1.5.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] Remove devfs from MAINTAINERS
2007-03-10 4:07 ` [PATCH 2/5] Driver core: add device symlink back to sysfs Greg Kroah-Hartman
@ 2007-03-10 4:07 ` Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 4/5] driver core: export device_rename Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2007-03-10 4:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Jörn Engel, Greg Kroah-Hartman
From: Jörn Engel <joern@lazybastard.org>
Remove last remaining trace of devfs.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
MAINTAINERS | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 9993b90..17555bb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1103,9 +1103,6 @@ W: http://lanana.org/docs/device-list/index.html
L: linux-kernel@vger.kernel.org
S: Maintained
-DEVICE FILESYSTEM
-S: Obsolete
-
DIGI INTL. EPCA DRIVER
P: Digi International, Inc
M: Eng.Linux@digi.com
--
1.5.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] driver core: export device_rename
2007-03-10 4:07 ` [PATCH 3/5] Remove devfs from MAINTAINERS Greg Kroah-Hartman
@ 2007-03-10 4:07 ` Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 5/5] kobject: new_device->kref wasn't putted after error in kobject_move() Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2007-03-10 4:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Johannes Berg, Greg Kroah-Hartman
From: Johannes Berg <johannes@sipsolutions.net>
In wireless we'd like to allow renaming of the phy devices we surface in
sysfs. The base wireless code, however, can be built modular and thus we
need device_rename exported.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index fb16f29..f191afe 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1065,7 +1065,7 @@ int device_rename(struct device *dev, char *new_name)
return error;
}
-
+EXPORT_SYMBOL_GPL(device_rename);
static int device_move_class_links(struct device *dev,
struct device *old_parent,
--
1.5.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] kobject: new_device->kref wasn't putted after error in kobject_move()
2007-03-10 4:07 ` [PATCH 4/5] driver core: export device_rename Greg Kroah-Hartman
@ 2007-03-10 4:07 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2007-03-10 4:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Dmitriy Monakhov, Monakhov Dmitriy, Greg Kroah-Hartman
From: Dmitriy Monakhov <dmonakhov@sw.ru>
If error happen we jump to "out" label, in this case new_device not yet
became the parent but it wasn't putted.
Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
lib/kobject.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/kobject.c b/lib/kobject.c
index f4f6176..057921c 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -385,9 +385,11 @@ int kobject_move(struct kobject *kobj, struct kobject *new_parent)
goto out;
old_parent = kobj->parent;
kobj->parent = new_parent;
+ new_parent = NULL;
kobject_put(old_parent);
kobject_uevent_env(kobj, KOBJ_MOVE, envp);
out:
+ kobject_put(new_parent);
kobject_put(kobj);
kfree(devpath_string);
kfree(devpath);
--
1.5.0.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-03-10 4:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-10 4:04 [GIT PATCH] Driver core fixes for 2.6.21-rc3 Greg KH
2007-03-10 4:07 ` [PATCH 1/5] Revert "driver core: refcounting fix" Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 2/5] Driver core: add device symlink back to sysfs Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 3/5] Remove devfs from MAINTAINERS Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 4/5] driver core: export device_rename Greg Kroah-Hartman
2007-03-10 4:07 ` [PATCH 5/5] kobject: new_device->kref wasn't putted after error in kobject_move() 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