* [RFC] bind and unbind drivers from userspace through sysfs
@ 2005-06-24 5:12 Greg KH
2005-06-24 5:14 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
` (2 more replies)
0 siblings, 3 replies; 70+ messages in thread
From: Greg KH @ 2005-06-24 5:12 UTC (permalink / raw)
To: linux-kernel; +Cc: Patrick Mochel
Now that we have the internal infrastructure of the driver model
reworked so the locks aren't so global and imposing, it's possible to
bind and unbind drivers from devices from userspace with only a very
tiny ammount of code.
In reply to this email, are two patches, one that adds bind and one that
adds unbind functionality. I've added these to my trees and should show
up in the next -mm releases. Comments appreciated.
Oh, and yes, we still need a way to add new device ids to drivers from
sysfs, like PCI currently has. I'll be working on that next.
Even so, with these two patches, people should be able to do things that
they have been wanting to do for a while (like take over the what driver
to what device logic in userspace, as I know some distro installers
really want to do.)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread* [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-24 5:12 [RFC] bind and unbind drivers from userspace through sysfs Greg KH
@ 2005-06-24 5:14 ` Greg KH
2005-06-24 5:15 ` [PATCH] driver core: Add the ability to bind " Greg KH
2005-06-24 15:57 ` [PATCH] driver core: Add the ability to unbind " Patrick Mochel
2005-06-25 3:05 ` [RFC] bind and unbind drivers from userspace through sysfs Bill Nottingham
2005-06-25 4:22 ` Dmitry Torokhov
2 siblings, 2 replies; 70+ messages in thread
From: Greg KH @ 2005-06-24 5:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Patrick Mochel
This adds a single file, "unbind", to the sysfs directory of every
device that is currently bound to a driver. To unbind the driver from
the device, write anything to this file and they will be disconnected
from each other.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/dd.c | 11 +++++++++++
1 files changed, 11 insertions(+)
--- gregkh-2.6.orig/drivers/base/dd.c 2005-06-22 17:56:48.000000000 -0700
+++ gregkh-2.6/drivers/base/dd.c 2005-06-22 17:56:59.000000000 -0700
@@ -23,6 +23,15 @@
#define to_drv(node) container_of(node, struct device_driver, kobj.entry)
+/* manually detach a device from it's associated driver. */
+/* Any write will cause it to happen. */
+static ssize_t device_unbind(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ device_release_driver(dev);
+ return count;
+}
+static DEVICE_ATTR(unbind, S_IWUSR, NULL, device_unbind);
/**
* device_bind_driver - bind a driver to one device.
@@ -46,6 +55,7 @@
sysfs_create_link(&dev->driver->kobj, &dev->kobj,
kobject_name(&dev->kobj));
sysfs_create_link(&dev->kobj, &dev->driver->kobj, "driver");
+ device_create_file(dev, &dev_attr_unbind);
}
/**
@@ -191,6 +201,7 @@
get_driver(drv);
sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj));
sysfs_remove_link(&dev->kobj, "driver");
+ device_remove_file(dev, &dev_attr_unbind);
klist_remove(&dev->knode_driver);
if (drv->remove)
^ permalink raw reply [flat|nested] 70+ messages in thread* [PATCH] driver core: Add the ability to bind drivers to devices from userspace
2005-06-24 5:14 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
@ 2005-06-24 5:15 ` Greg KH
2005-06-24 15:57 ` [PATCH] driver core: Add the ability to unbind " Patrick Mochel
1 sibling, 0 replies; 70+ messages in thread
From: Greg KH @ 2005-06-24 5:15 UTC (permalink / raw)
To: linux-kernel; +Cc: Patrick Mochel
This adds a single file, "bind", to the sysfs directory of every driver
registered with the driver core. To bind a device to a driver, write
the bus id of the device you wish to bind to that specific driver to the
"bind" file (remember to not add a trailing \n). If that bus id matches
a device on that bus, and it does not currently have a driver bound to
it, the probe sequence will be initiated with that driver and device.
Note, this requires that the driver itself be willing and able to accept
that device (usually through a device id type table). This patch does
not make it possible to override the driver's id table.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/base.h | 1 +
drivers/base/bus.c | 36 ++++++++++++++++++++++++++++++++++++
drivers/base/dd.c | 2 +-
3 files changed, 38 insertions(+), 1 deletion(-)
--- gregkh-2.6.orig/drivers/base/bus.c 2005-06-22 23:21:11.000000000 -0700
+++ gregkh-2.6/drivers/base/bus.c 2005-06-22 23:23:19.000000000 -0700
@@ -133,6 +133,40 @@
decl_subsys(bus, &ktype_bus, NULL);
+/*
+ * Manually attach a device to a driver.
+ * Note: the driver must want to bind to the device,
+ * it is not possible to override the driver's id table.
+ */
+static int driver_bind_helper(struct device *dev, void *data)
+{
+ const char *name = data;
+
+ if ((dev->driver == NULL) &&
+ (strcmp(name, dev->bus_id) == 0))
+ return 1;
+ return 0;
+}
+
+static ssize_t driver_bind(struct device_driver *drv,
+ const char *buf, size_t count)
+{
+ struct bus_type *bus = get_bus(drv->bus);
+ struct device *dev;
+ int err = -ENODEV;
+
+ dev = bus_find_device(bus, NULL, (void *)buf, driver_bind_helper);
+ if (dev) {
+ down(&dev->sem);
+ err = driver_probe_device(drv, dev);
+ up(&dev->sem);
+ put_device(dev);
+ }
+ return err;
+}
+static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
+
+
static struct device * next_device(struct klist_iter * i)
{
struct klist_node * n = klist_next(i);
@@ -396,6 +430,7 @@
module_add_driver(drv->owner, drv);
driver_add_attrs(bus, drv);
+ driver_create_file(drv, &driver_attr_bind);
}
return error;
}
@@ -413,6 +448,7 @@
void bus_remove_driver(struct device_driver * drv)
{
if (drv->bus) {
+ driver_remove_file(drv, &driver_attr_bind);
driver_remove_attrs(drv->bus, drv);
klist_remove(&drv->knode_bus);
pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
--- gregkh-2.6.orig/drivers/base/base.h 2005-06-22 23:20:58.000000000 -0700
+++ gregkh-2.6/drivers/base/base.h 2005-06-22 23:21:14.000000000 -0700
@@ -5,6 +5,7 @@
extern void bus_remove_driver(struct device_driver *);
extern void driver_detach(struct device_driver * drv);
+extern int driver_probe_device(struct device_driver *, struct device *);
static inline struct class_device *to_class_dev(struct kobject *obj)
{
--- gregkh-2.6.orig/drivers/base/dd.c 2005-06-22 23:21:13.000000000 -0700
+++ gregkh-2.6/drivers/base/dd.c 2005-06-22 23:21:14.000000000 -0700
@@ -75,7 +75,7 @@
*
* This function must be called with @dev->sem held.
*/
-static int driver_probe_device(struct device_driver * drv, struct device * dev)
+int driver_probe_device(struct device_driver * drv, struct device * dev)
{
int ret = 0;
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-24 5:14 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-24 5:15 ` [PATCH] driver core: Add the ability to bind " Greg KH
@ 2005-06-24 15:57 ` Patrick Mochel
2005-06-25 3:27 ` Greg KH
1 sibling, 1 reply; 70+ messages in thread
From: Patrick Mochel @ 2005-06-24 15:57 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
On Thu, 23 Jun 2005, Greg KH wrote:
> This adds a single file, "unbind", to the sysfs directory of every
> device that is currently bound to a driver. To unbind the driver from
> the device, write anything to this file and they will be disconnected
> from each other.
Do you think it would be better to put the 'unbind' file in the driver's
directory and have it accept the bus ID of a device that it's bound to?
This would make it more similar to the complementary 'bind' functionality.
Pat
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-24 15:57 ` [PATCH] driver core: Add the ability to unbind " Patrick Mochel
@ 2005-06-25 3:27 ` Greg KH
2005-06-25 4:16 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-06-25 3:27 UTC (permalink / raw)
To: Patrick Mochel; +Cc: linux-kernel
On Fri, Jun 24, 2005 at 08:57:15AM -0700, Patrick Mochel wrote:
>
> On Thu, 23 Jun 2005, Greg KH wrote:
>
> > This adds a single file, "unbind", to the sysfs directory of every
> > device that is currently bound to a driver. To unbind the driver from
> > the device, write anything to this file and they will be disconnected
> > from each other.
>
> Do you think it would be better to put the 'unbind' file in the driver's
> directory and have it accept the bus ID of a device that it's bound to?
> This would make it more similar to the complementary 'bind' functionality.
Yeah, you are right, I'll make that change. Heh, symmetry, what a
concept...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-25 3:27 ` Greg KH
@ 2005-06-25 4:16 ` Dmitry Torokhov
2005-06-25 9:39 ` Michael Tokarev
0 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-06-25 4:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg KH, Patrick Mochel
On Friday 24 June 2005 22:27, Greg KH wrote:
> On Fri, Jun 24, 2005 at 08:57:15AM -0700, Patrick Mochel wrote:
> >
> > On Thu, 23 Jun 2005, Greg KH wrote:
> >
> > > This adds a single file, "unbind", to the sysfs directory of every
> > > device that is currently bound to a driver. To unbind the driver from
> > > the device, write anything to this file and they will be disconnected
> > > from each other.
> >
> > Do you think it would be better to put the 'unbind' file in the driver's
> > directory and have it accept the bus ID of a device that it's bound to?
> > This would make it more similar to the complementary 'bind' functionality.
>
It is more complex this way. You need to do additional parsing...
> Yeah, you are right, I'll make that change. Heh, symmetry, what a
> concept...
>
Actually, I think that both should be in device's directory. When unbinding
a device you normally don't care what driver it is bound to, you just want
to make sure that there is no driver bound to the device afterwards. I.e it
is a operation on device. When binding you could argue both ways, but then
again you usually have a piece of hardware you want to assign specific driver
for, so I'd say it is operation on device as well.
Also, some buses may implement other similar operatons, like rescan and
reconnect (serio/gameport buses). They are similar to "bind" except that
you do not specify driver at all. If bind/unbind is in the driver and
connect/reconnect are in the device's directory it will be complete mess.
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-25 4:16 ` Dmitry Torokhov
@ 2005-06-25 9:39 ` Michael Tokarev
0 siblings, 0 replies; 70+ messages in thread
From: Michael Tokarev @ 2005-06-25 9:39 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, Greg KH, Patrick Mochel
Dmitry Torokhov wrote:
[bind/unbind in device or driver dir in sysfs]
>
> Actually, I think that both should be in device's directory. When unbinding
> a device you normally don't care what driver it is bound to, you just want
> to make sure that there is no driver bound to the device afterwards. I.e it
> is a operation on device. When binding you could argue both ways, but then
> again you usually have a piece of hardware you want to assign specific driver
> for, so I'd say it is operation on device as well.
A small comment. How about having one file named 'bind', which acts like
either bind or unbind if nothing (empty string) has written to it?
(for fun.. that'd be 'driver' file, which, when read, returns the name
of the driver currently bound to the device.. but too bad, 'driver' is
a symlink already...)
/mjt
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-24 5:12 [RFC] bind and unbind drivers from userspace through sysfs Greg KH
2005-06-24 5:14 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
@ 2005-06-25 3:05 ` Bill Nottingham
2005-06-25 3:26 ` Greg KH
2005-06-25 4:22 ` Dmitry Torokhov
2 siblings, 1 reply; 70+ messages in thread
From: Bill Nottingham @ 2005-06-25 3:05 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Patrick Mochel
Greg KH (greg@kroah.com) said:
> Even so, with these two patches, people should be able to do things that
> they have been wanting to do for a while (like take over the what driver
> to what device logic in userspace, as I know some distro installers
> really want to do.)
Playing devils advocate, with this, the process flow is:
- kernel sees a new device
- kernel sends hotplug event for bus with slot, address, vendor id, etc.
- userspace loads a module based on that info
<some sort of synchronization here waiting for driver to initialize>
- userspace echos to sysfs to bind device
- kernel sends hotplug device event
- userspace creates device node, then continues with device
This looks:
a) inefficient
b) an awful lot like the PCMCIA model. Which... eww.
Bill
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-25 3:05 ` [RFC] bind and unbind drivers from userspace through sysfs Bill Nottingham
@ 2005-06-25 3:26 ` Greg KH
0 siblings, 0 replies; 70+ messages in thread
From: Greg KH @ 2005-06-25 3:26 UTC (permalink / raw)
To: linux-kernel, Patrick Mochel
On Fri, Jun 24, 2005 at 11:05:53PM -0400, Bill Nottingham wrote:
> Greg KH (greg@kroah.com) said:
> > Even so, with these two patches, people should be able to do things that
> > they have been wanting to do for a while (like take over the what driver
> > to what device logic in userspace, as I know some distro installers
> > really want to do.)
>
> Playing devils advocate, with this, the process flow is:
>
> - kernel sees a new device
> - kernel sends hotplug event for bus with slot, address, vendor id, etc.
> - userspace loads a module based on that info
> <some sort of synchronization here waiting for driver to initialize>
> - userspace echos to sysfs to bind device
> - kernel sends hotplug device event
> - userspace creates device node, then continues with device
Yeah, I'm not saying I think it's a good process flow for people to
implement. But if they want to, they now can.
The main reason for this is for drivers that replace built in drivers,
or multiple modules for the same device (think of new rev of driver,
both loaded at once, some devices should bind to the new one, other
devices you want staying with the old one due to it controlling your
root partition.) Now userspace has a chance to unbind and bind devices
to drivers in those situations, which it never could before.
But remember, I'm not changing the way things bind to devices here, like
requiring userspace to pick the driver for the device, so no one lives
will change at all, if they don't want to.
Hope this helps explain it.
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-24 5:12 [RFC] bind and unbind drivers from userspace through sysfs Greg KH
2005-06-24 5:14 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-25 3:05 ` [RFC] bind and unbind drivers from userspace through sysfs Bill Nottingham
@ 2005-06-25 4:22 ` Dmitry Torokhov
2005-06-29 23:47 ` Greg KH
2 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-06-25 4:22 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg KH, Patrick Mochel
On Friday 24 June 2005 00:12, Greg KH wrote:
> Now that we have the internal infrastructure of the driver model
> reworked so the locks aren't so global and imposing, it's possible to
> bind and unbind drivers from devices from userspace with only a very
> tiny ammount of code.
>
> In reply to this email, are two patches, one that adds bind and one that
> adds unbind functionality. I've added these to my trees and should show
> up in the next -mm releases. Comments appreciated.
>
> Oh, and yes, we still need a way to add new device ids to drivers from
> sysfs, like PCI currently has. I'll be working on that next.
>
I think this is an overkill if you can do manual bind/unbind.
> Even so, with these two patches, people should be able to do things that
> they have been wanting to do for a while (like take over the what driver
> to what device logic in userspace, as I know some distro installers
> really want to do.)
>
I think bind/unbind should be bus's methods and attributes should be
created only if bus supports such operations. Some buses either have
or may need additional locking considerations and will not particularly
like driver core getting in the middle of things.
Btw, do we really need separate attributes for bind/unbind?
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-25 4:22 ` Dmitry Torokhov
@ 2005-06-29 23:47 ` Greg KH
2005-06-30 6:13 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-06-29 23:47 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, Patrick Mochel
On Fri, Jun 24, 2005 at 11:22:57PM -0500, Dmitry Torokhov wrote:
> On Friday 24 June 2005 00:12, Greg KH wrote:
> > Now that we have the internal infrastructure of the driver model
> > reworked so the locks aren't so global and imposing, it's possible to
> > bind and unbind drivers from devices from userspace with only a very
> > tiny ammount of code.
> >
> > In reply to this email, are two patches, one that adds bind and one that
> > adds unbind functionality. I've added these to my trees and should show
> > up in the next -mm releases. Comments appreciated.
> >
> > Oh, and yes, we still need a way to add new device ids to drivers from
> > sysfs, like PCI currently has. I'll be working on that next.
> >
>
> I think this is an overkill if you can do manual bind/unbind.
No, this is needed. You can only bind a device to a driver that will
accept it. As we can not add new device ids to all drivers yet (only
PCI supports that), this isn't as useful as it could be. I'll be moving
that PCI code into the driver core, so that all busses that want to
support this (adding new device ids on the fly), can.
> > Even so, with these two patches, people should be able to do things that
> > they have been wanting to do for a while (like take over the what driver
> > to what device logic in userspace, as I know some distro installers
> > really want to do.)
> >
>
> I think bind/unbind should be bus's methods and attributes should be
> created only if bus supports such operations. Some buses either have
> or may need additional locking considerations and will not particularly
> like driver core getting in the middle of things.
Examples of such? Yes, a bus that isn't really expecting this to
happen, as it has some odd locking logic in the
registering/unregistering of a new driver for it, might have issues.
But I'd say that this is the bus's fault, not the driver core's fault.
Becides, you can just have the bus fail such a bind/unbind attempt, if
you really want to do that.
Anyway, I've tested this with PCI and USB devices, and they both work
just fine, and those are the busses that the majority of people want
this functionality for.
> Btw, do we really need separate attributes for bind/unbind?
Overloading a single file would be messier. The overhead for an
additional attribute per driver is quite small (I move the unbind
attribute to the driver, as it makes more sense there as Pat mentioned.)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-29 23:47 ` Greg KH
@ 2005-06-30 6:13 ` Dmitry Torokhov
2005-06-30 16:01 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-06-30 6:13 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Patrick Mochel
On Wednesday 29 June 2005 18:47, Greg KH wrote:
> On Fri, Jun 24, 2005 at 11:22:57PM -0500, Dmitry Torokhov wrote:
> > On Friday 24 June 2005 00:12, Greg KH wrote:
> > > Now that we have the internal infrastructure of the driver model
> > > reworked so the locks aren't so global and imposing, it's possible to
> > > bind and unbind drivers from devices from userspace with only a very
> > > tiny ammount of code.
> > >
> > > In reply to this email, are two patches, one that adds bind and one that
> > > adds unbind functionality. I've added these to my trees and should show
> > > up in the next -mm releases. Comments appreciated.
> > >
> > > Oh, and yes, we still need a way to add new device ids to drivers from
> > > sysfs, like PCI currently has. I'll be working on that next.
> > >
> >
> > I think this is an overkill if you can do manual bind/unbind.
>
> No, this is needed. You can only bind a device to a driver that will
> accept it. As we can not add new device ids to all drivers yet (only
> PCI supports that), this isn't as useful as it could be. I'll be moving
> that PCI code into the driver core, so that all busses that want to
> support this (adding new device ids on the fly), can.
>
Yes, you are right, sorry.
> > > Even so, with these two patches, people should be able to do things that
> > > they have been wanting to do for a while (like take over the what driver
> > > to what device logic in userspace, as I know some distro installers
> > > really want to do.)
> > >
> >
> > I think bind/unbind should be bus's methods and attributes should be
> > created only if bus supports such operations. Some buses either have
> > or may need additional locking considerations and will not particularly
> > like driver core getting in the middle of things.
>
> Examples of such?
serio, gameport. Everything is protected by a semaphore, partly for
historical reasons, partly because when adding children devices parent
devices need to be locked too...
> Yes, a bus that isn't really expecting this to
> happen, as it has some odd locking logic in the
> registering/unregistering of a new driver for it, might have issues.
> But I'd say that this is the bus's fault, not the driver core's fault.
>
I don't think so. Up to now all driver core iteractions were under
individual bus code control. Now out of sudden you allow disconnecting
device from its driver from outside of bus control and you are saying
that's all right. Driver core is a framework; buses use driver core to
simplify their tasks but driver core does not really control their
operations.
> Becides, you can just have the bus fail such a bind/unbind attempt, if
> you really want to do that.
>
How can you do it cleanly? probe and remove routined do not have any idea
how they were called.
> Anyway, I've tested this with PCI and USB devices, and they both work
> just fine, and those are the busses that the majority of people want
> this functionality for.
That is really sloppy. "It happens to work for 2 buses I care about so it
must be perfect"?
>
> > Btw, do we really need separate attributes for bind/unbind?
>
> Overloading a single file would be messier. The overhead for an
> additional attribute per driver is quite small (I move the unbind
> attribute to the driver, as it makes more sense there as Pat mentioned.)
>
Let me ask again - what if we need more operations similar to [un]bind,
such as rescan? They do not use a specific driver but work for device.
If you keep bind/unbind in driver and rescan/reconnect/etc in device
subdirectoty it will be rather messy. Please consider movin in the
opposite directtion - have bind and unbind attributes of device, not
driver.
Also, what about rolling bind_mode attribute into driver core as well?
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-30 6:13 ` Dmitry Torokhov
@ 2005-06-30 16:01 ` Greg KH
2005-06-30 20:20 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-06-30 16:01 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, Patrick Mochel
On Thu, Jun 30, 2005 at 01:13:53AM -0500, Dmitry Torokhov wrote:
> On Wednesday 29 June 2005 18:47, Greg KH wrote:
> > On Fri, Jun 24, 2005 at 11:22:57PM -0500, Dmitry Torokhov wrote:
> > > On Friday 24 June 2005 00:12, Greg KH wrote:
> > > > Even so, with these two patches, people should be able to do things that
> > > > they have been wanting to do for a while (like take over the what driver
> > > > to what device logic in userspace, as I know some distro installers
> > > > really want to do.)
> > > >
> > >
> > > I think bind/unbind should be bus's methods and attributes should be
> > > created only if bus supports such operations. Some buses either have
> > > or may need additional locking considerations and will not particularly
> > > like driver core getting in the middle of things.
> >
> > Examples of such?
>
> serio, gameport. Everything is protected by a semaphore, partly for
> historical reasons, partly because when adding children devices parent
> devices need to be locked too...
Why do parent devices need to be locked? Reference counting in the
driver core should take care of everything properly, right? Also, these
are not hotpluggable devices, so it should be a lot easier :)
> > Yes, a bus that isn't really expecting this to
> > happen, as it has some odd locking logic in the
> > registering/unregistering of a new driver for it, might have issues.
> > But I'd say that this is the bus's fault, not the driver core's fault.
> >
>
> I don't think so. Up to now all driver core iteractions were under
> individual bus code control. Now out of sudden you allow disconnecting
> device from its driver from outside of bus control and you are saying
> that's all right. Driver core is a framework; buses use driver core to
> simplify their tasks but driver core does not really control their
> operations.
Well, yes and no. I see the driver core driving a lot of interactions,
due to the probing and matching and disconnecting all coming from the
core, but I guess as they are usually initiated from the bus itself, I
can see how you feel this way also. So ok, yes, this is a change, I
agree. But it isn't one that should cause major issues.
> > Becides, you can just have the bus fail such a bind/unbind attempt, if
> > you really want to do that.
> >
>
> How can you do it cleanly? probe and remove routined do not have any idea
> how they were called.
You can set a flag if those functions come from your own bus (due to
device/driver add/remove) and check that, but I agree, that's an ugly
hack...
> > Anyway, I've tested this with PCI and USB devices, and they both work
> > just fine, and those are the busses that the majority of people want
> > this functionality for.
>
> That is really sloppy. "It happens to work for 2 buses I care about so it
> must be perfect"?
Heh, at least I tried 2 :)
No, I don't mean to be sloppy, I just tested what I had availble, like
almost everyone else.
> > > Btw, do we really need separate attributes for bind/unbind?
> >
> > Overloading a single file would be messier. The overhead for an
> > additional attribute per driver is quite small (I move the unbind
> > attribute to the driver, as it makes more sense there as Pat mentioned.)
> >
>
> Let me ask again - what if we need more operations similar to [un]bind,
> such as rescan?
"rescan"? Like reprobe the bus address space? That sounds like a bus
specific issue. But if you like I could add a general bus callback for
that and an attribute for it. I know pci could use that for some odd
cases (see the fakephp driver for an example of how to do rescan for pci
devices from a driver itself.)
> They do not use a specific driver but work for device.
Yes, and as such, rescan should be a bus attribute, not a driver or
device one.
> If you keep bind/unbind in driver and rescan/reconnect/etc in device
> subdirectoty it will be rather messy. Please consider movin in the
> opposite directtion - have bind and unbind attributes of device, not
> driver.
No, I put bind/unbind in the driver directory. There is no additions to
the device directory.
> Also, what about rolling bind_mode attribute into driver core as well?
Um, I don't recall what you are referring to here. Have a
pointer/patch?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-30 16:01 ` Greg KH
@ 2005-06-30 20:20 ` Dmitry Torokhov
2005-07-01 22:31 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-06-30 20:20 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Patrick Mochel
On 6/30/05, Greg KH <greg@kroah.com> wrote:
> On Thu, Jun 30, 2005 at 01:13:53AM -0500, Dmitry Torokhov wrote:
> > On Wednesday 29 June 2005 18:47, Greg KH wrote:
> > > On Fri, Jun 24, 2005 at 11:22:57PM -0500, Dmitry Torokhov wrote:
> > > > On Friday 24 June 2005 00:12, Greg KH wrote:
> > > > > Even so, with these two patches, people should be able to do things that
> > > > > they have been wanting to do for a while (like take over the what driver
> > > > > to what device logic in userspace, as I know some distro installers
> > > > > really want to do.)
> > > > >
> > > >
> > > > I think bind/unbind should be bus's methods and attributes should be
> > > > created only if bus supports such operations. Some buses either have
> > > > or may need additional locking considerations and will not particularly
> > > > like driver core getting in the middle of things.
> > >
> > > Examples of such?
> >
> > serio, gameport. Everything is protected by a semaphore, partly for
> > historical reasons, partly because when adding children devices parent
> > devices need to be locked too...
>
> Why do parent devices need to be locked? Reference counting in the
> driver core should take care of everything properly, right? Also, these
Children devices access hardware thtough their parent, which has to be
functional at that time, otherwise if you initializing child device
while parent is half gone you'll get bunch of errors reported. And
again - historical reasons - when driver core did not allow adding
children from parents probe routines serio core had to work around it
and it required additional locking.
> are not hotpluggable devices, so it should be a lot easier :)
Some of them are and some are not. Hot-plugging an PS/2 mouse or
keyboard usually works, although there are exceptions.
>
> > > Yes, a bus that isn't really expecting this to
> > > happen, as it has some odd locking logic in the
> > > registering/unregistering of a new driver for it, might have issues.
> > > But I'd say that this is the bus's fault, not the driver core's fault.
> > >
> >
> > I don't think so. Up to now all driver core iteractions were under
> > individual bus code control. Now out of sudden you allow disconnecting
> > device from its driver from outside of bus control and you are saying
> > that's all right. Driver core is a framework; buses use driver core to
> > simplify their tasks but driver core does not really control their
> > operations.
>
> Well, yes and no. I see the driver core driving a lot of interactions,
> due to the probing and matching and disconnecting all coming from the
> core, but I guess as they are usually initiated from the bus itself, I
> can see how you feel this way also. So ok, yes, this is a change, I
> agree. But it isn't one that should cause major issues.
>
It is fixable and I meant to cange it, but not ATM and I hate leaving
the code with bad locking in kernel proper ;(
> > > > Btw, do we really need separate attributes for bind/unbind?
> > >
> > > Overloading a single file would be messier. The overhead for an
> > > additional attribute per driver is quite small (I move the unbind
> > > attribute to the driver, as it makes more sense there as Pat mentioned.)
> > >
> >
> > Let me ask again - what if we need more operations similar to [un]bind,
> > such as rescan?
>
> "rescan"? Like reprobe the bus address space? That sounds like a bus
> specific issue. But if you like I could add a general bus callback for
> that and an attribute for it. I know pci could use that for some odd
> cases (see the fakephp driver for an example of how to do rescan for pci
> devices from a driver itself.)
>
No, it for entire bus space. Imagine you have a device that is marked
as "bind_mode=manual" because normally you don't want to have it
activated for some reason. Later you want to activate it. Right now in
serio you can do:
echo -n "rescan" > /sys/bus/serio/devices/serioX/drvctl
and it will do the standard binding (match + probe) for that device
only. It is different from bus-wide rescan operation. Maybe rescan is
not the best name, but that what I have in serio for now.
Reconnect is indeed bus-specific issue but it is very close to rescan.
We already know the driver, we just want to reinitialize hardware, if
possible. Helps to keep input devices the same when mouse goes crazy
for some reason.
> > They do not use a specific driver but work for device.
>
> Yes, and as such, rescan should be a bus attribute, not a driver or
> device one.
>
See above, I want a per-device operation here. Bus-wide one could be
also useful, but I was talking about per-device.
> > If you keep bind/unbind in driver and rescan/reconnect/etc in device
> > subdirectoty it will be rather messy. Please consider movin in the
> > opposite directtion - have bind and unbind attributes of device, not
> > driver.
>
> No, I put bind/unbind in the driver directory. There is no additions to
> the device directory.
>
Could you give your rationale for putting it in driver?
> > Also, what about rolling bind_mode attribute into driver core as well?
>
> Um, I don't recall what you are referring to here. Have a
> pointer/patch?
>
No patch at the moment, there were quite few changes since I sent it
to you last time. You could take a look in serio for the usage though.
Basically both drivers and devices get a new attribute "bind_mode"
(auto|manual). When bind mode is set to manual devices are bound to
driver only when user explicitely says so. This allows having 2+
drivers for the same hardware at the same time. The preferred one has
bind_mode=auto, secondary has bind_mode=manual. Take for example
serio_raw. We really want psmouse be loaded by default but if user
needs raw access to a specific serio port he can manually bind
serio_raw module to that port.
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-06-30 20:20 ` Dmitry Torokhov
@ 2005-07-01 22:31 ` Greg KH
2005-07-02 4:25 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-01 22:31 UTC (permalink / raw)
To: dtor_core; +Cc: linux-kernel, Patrick Mochel
On Thu, Jun 30, 2005 at 03:20:10PM -0500, Dmitry Torokhov wrote:
> On 6/30/05, Greg KH <greg@kroah.com> wrote:
> > On Thu, Jun 30, 2005 at 01:13:53AM -0500, Dmitry Torokhov wrote:
> > > On Wednesday 29 June 2005 18:47, Greg KH wrote:
> > > > On Fri, Jun 24, 2005 at 11:22:57PM -0500, Dmitry Torokhov wrote:
> > > > > On Friday 24 June 2005 00:12, Greg KH wrote:
> > > > > > Even so, with these two patches, people should be able to do things that
> > > > > > they have been wanting to do for a while (like take over the what driver
> > > > > > to what device logic in userspace, as I know some distro installers
> > > > > > really want to do.)
> > > > > >
> > > > >
> > > > > I think bind/unbind should be bus's methods and attributes should be
> > > > > created only if bus supports such operations. Some buses either have
> > > > > or may need additional locking considerations and will not particularly
> > > > > like driver core getting in the middle of things.
> > > >
> > > > Examples of such?
> > >
> > > serio, gameport. Everything is protected by a semaphore, partly for
> > > historical reasons, partly because when adding children devices parent
> > > devices need to be locked too...
> >
> > Why do parent devices need to be locked? Reference counting in the
> > driver core should take care of everything properly, right? Also, these
>
> Children devices access hardware thtough their parent, which has to be
> functional at that time, otherwise if you initializing child device
> while parent is half gone you'll get bunch of errors reported. And
> again - historical reasons - when driver core did not allow adding
> children from parents probe routines serio core had to work around it
> and it required additional locking.
Ok, that locking can now be removed :)
> > are not hotpluggable devices, so it should be a lot easier :)
>
> Some of them are and some are not. Hot-plugging an PS/2 mouse or
> keyboard usually works, although there are exceptions.
hot-plugging a ps/2 device is a short trip to a burnt out motherboard.
I've worked with the ps/2 specs long enough to know that :)
Anyway, you aren't discovering them on the fly, but I see how a rescan
would help you out here, right?
> > > > > Btw, do we really need separate attributes for bind/unbind?
> > > >
> > > > Overloading a single file would be messier. The overhead for an
> > > > additional attribute per driver is quite small (I move the unbind
> > > > attribute to the driver, as it makes more sense there as Pat mentioned.)
> > > >
> > >
> > > Let me ask again - what if we need more operations similar to [un]bind,
> > > such as rescan?
> >
> > "rescan"? Like reprobe the bus address space? That sounds like a bus
> > specific issue. But if you like I could add a general bus callback for
> > that and an attribute for it. I know pci could use that for some odd
> > cases (see the fakephp driver for an example of how to do rescan for pci
> > devices from a driver itself.)
> >
>
> No, it for entire bus space. Imagine you have a device that is marked
> as "bind_mode=manual" because normally you don't want to have it
> activated for some reason.
I don't like "modes" like that. Just have the driver have no built in
ids, then use the addition of a dynamic id from userspace do the bind,
like pci.
> Later you want to activate it. Right now in serio you can do:
>
> echo -n "rescan" > /sys/bus/serio/devices/serioX/drvctl
>
> and it will do the standard binding (match + probe) for that device
> only. It is different from bus-wide rescan operation. Maybe rescan is
> not the best name, but that what I have in serio for now.
Sure, for this I think it should be a bus specific thing.
> Reconnect is indeed bus-specific issue but it is very close to rescan.
> We already know the driver, we just want to reinitialize hardware, if
> possible. Helps to keep input devices the same when mouse goes crazy
> for some reason.
But rescan/reconnect is a bus thing. The driver core never kicks this
off, nor should it.
> > > They do not use a specific driver but work for device.
> >
> > Yes, and as such, rescan should be a bus attribute, not a driver or
> > device one.
>
> See above, I want a per-device operation here. Bus-wide one could be
> also useful, but I was talking about per-device.
per-device scan doesn't make much sense for other busses, does it?
> > > If you keep bind/unbind in driver and rescan/reconnect/etc in device
> > > subdirectoty it will be rather messy. Please consider movin in the
> > > opposite directtion - have bind and unbind attributes of device, not
> > > driver.
> >
> > No, I put bind/unbind in the driver directory. There is no additions to
> > the device directory.
> >
>
> Could you give your rationale for putting it in driver?
The driver is the thing you want to have bound to a device. Putting it
in every device directory would make the 20K scsi device people very
unhappy as I take up even more of their 31bit memory :)
> > > Also, what about rolling bind_mode attribute into driver core as well?
> >
> > Um, I don't recall what you are referring to here. Have a
> > pointer/patch?
> >
>
> No patch at the moment, there were quite few changes since I sent it
> to you last time. You could take a look in serio for the usage though.
> Basically both drivers and devices get a new attribute "bind_mode"
> (auto|manual). When bind mode is set to manual devices are bound to
> driver only when user explicitely says so. This allows having 2+
> drivers for the same hardware at the same time. The preferred one has
> bind_mode=auto, secondary has bind_mode=manual. Take for example
> serio_raw. We really want psmouse be loaded by default but if user
> needs raw access to a specific serio port he can manually bind
> serio_raw module to that port.
Ah, ok, now I remember. I still think this is more complex than needed,
but don't have an alternative proposal right now :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-07-01 22:31 ` Greg KH
@ 2005-07-02 4:25 ` Dmitry Torokhov
2005-07-02 4:51 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-07-02 4:25 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Patrick Mochel
On Friday 01 July 2005 17:31, Greg KH wrote:
> On Thu, Jun 30, 2005 at 03:20:10PM -0500, Dmitry Torokhov wrote:
> >
> > Children devices access hardware thtough their parent, which has to be
> > functional at that time, otherwise if you initializing child device
> > while parent is half gone you'll get bunch of errors reported. And
> > again - historical reasons - when driver core did not allow adding
> > children from parents probe routines serio core had to work around it
> > and it required additional locking.
>
> Ok, that locking can now be removed :)
>
Yes and it is great. I just need some time to do it.
> > > are not hotpluggable devices, so it should be a lot easier :)
> >
> > Some of them are and some are not. Hot-plugging an PS/2 mouse or
> > keyboard usually works, although there are exceptions.
>
> hot-plugging a ps/2 device is a short trip to a burnt out motherboard.
> I've worked with the ps/2 specs long enough to know that :)
>
I am afraid this is somewhat old data. As far as I know modern PS/2 ports
allow hot-plugging just fine. Especially notebooks. Ask Vojtech.
> Anyway, you aren't discovering them on the fly, but I see how a rescan
> would help you out here, right?
>
It really depends. Normally, when a new PS/2 device is plugged we get
something in the port and this will internally (bus) schedule rescan,
which will detect the kindof device plugged and will load proper driver.
> > > > > > Btw, do we really need separate attributes for bind/unbind?
> > > > >
> > > > > Overloading a single file would be messier. The overhead for an
> > > > > additional attribute per driver is quite small (I move the unbind
> > > > > attribute to the driver, as it makes more sense there as Pat mentioned.)
> > > > >
> > > >
> > > > Let me ask again - what if we need more operations similar to [un]bind,
> > > > such as rescan?
> > >
> > > "rescan"? Like reprobe the bus address space? That sounds like a bus
> > > specific issue. But if you like I could add a general bus callback for
> > > that and an attribute for it. I know pci could use that for some odd
> > > cases (see the fakephp driver for an example of how to do rescan for pci
> > > devices from a driver itself.)
> > >
> >
> > No, it for entire bus space. Imagine you have a device that is marked
> > as "bind_mode=manual" because normally you don't want to have it
> > activated for some reason.
>
> I don't like "modes" like that. Just have the driver have no built in
> ids, then use the addition of a dynamic id from userspace do the bind,
> like pci.
>
This is a bit different. One can say that adding new device ID is similar
to overclocking - it may work but all bets are off. In bind mode case
driver explicitely specifies set of devices it supposed to support, the
only difference is that it is considered "secondary" and will require
user intervention to bind. But the driver's author "certified" that the
driver should work with given hardware.
> > Later you want to activate it. Right now in serio you can do:
> >
> > echo -n "rescan" > /sys/bus/serio/devices/serioX/drvctl
> >
> > and it will do the standard binding (match + probe) for that device
> > only. It is different from bus-wide rescan operation. Maybe rescan is
> > not the best name, but that what I have in serio for now.
>
> Sure, for this I think it should be a bus specific thing.
>
> > Reconnect is indeed bus-specific issue but it is very close to rescan.
> > We already know the driver, we just want to reinitialize hardware, if
> > possible. Helps to keep input devices the same when mouse goes crazy
> > for some reason.
>
> But rescan/reconnect is a bus thing. The driver core never kicks this
> off, nor should it.
>
Driver core never kicks off anything. Everything either originates from
a bus or userspace. Bind/unbind is not initiated by driver core itself
either - you have a user requesting it (or driver/device become available
during bus initialization). The same with rescan (when initiated by user).
> > > > They do not use a specific driver but work for device.
> > >
> > > Yes, and as such, rescan should be a bus attribute, not a driver or
> > > device one.
> >
> > See above, I want a per-device operation here. Bus-wide one could be
> > also useful, but I was talking about per-device.
>
> per-device scan doesn't make much sense for other busses, does it?
>
I am not sure. I guess if you also have bind_mode it might and it looks
like not only I want something like bind_mode.
> > > > If you keep bind/unbind in driver and rescan/reconnect/etc in device
> > > > subdirectoty it will be rather messy. Please consider movin in the
> > > > opposite directtion - have bind and unbind attributes of device, not
> > > > driver.
> > >
> > > No, I put bind/unbind in the driver directory. There is no additions to
> > > the device directory.
> > >
> >
> > Could you give your rationale for putting it in driver?
>
> The driver is the thing you want to have bound to a device.
You can argue it both ways (I like the view whan device is an object you
perform some operation on and therefore action attributes are better suited
in devices directtory).
> Putting it
> in every device directory would make the 20K scsi device people very
> unhappy as I take up even more of their 31bit memory :)
>
I see. That would be an argument for folding all such operationsinto one
attribute with bus-specific multiplexor. But really, 20K scsi people are
probably better off without sysfs (they should still have hotplug events
as far as I can see so hotplug/usev should still work).
Just to reiterate - by beef is that if you put [un]bind into separate
directory similar operations will be split across 2 subdirectories.
> > > > Also, what about rolling bind_mode attribute into driver core as well?
> > >
> > > Um, I don't recall what you are referring to here. Have a
> > > pointer/patch?
> > >
> >
> > No patch at the moment, there were quite few changes since I sent it
> > to you last time. You could take a look in serio for the usage though.
> > Basically both drivers and devices get a new attribute "bind_mode"
> > (auto|manual). When bind mode is set to manual devices are bound to
> > driver only when user explicitely says so. This allows having 2+
> > drivers for the same hardware at the same time. The preferred one has
> > bind_mode=auto, secondary has bind_mode=manual. Take for example
> > serio_raw. We really want psmouse be loaded by default but if user
> > needs raw access to a specific serio port he can manually bind
> > serio_raw module to that port.
>
> Ah, ok, now I remember. I still think this is more complex than needed,
> but don't have an alternative proposal right now :)
I think it is simplier and safer than adding a new device ID to a driver.
Plus, one might not want to bind that driver to all available devices -
imagine I have a MUX controller (4 AUX ports) and I have standard PS/2
mouse bound to serio1 and a special device I want to have raw access to
on seio4. All 4 serio ports have the same ID, so if I simply add this ID
to serio_raw it has a chance to bind to all 4 ports. With bind mode I
don't need to worry that it will "steal" port it I did not want it to
touch.
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-07-02 4:25 ` Dmitry Torokhov
@ 2005-07-02 4:51 ` Greg KH
2005-07-02 5:20 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-02 4:51 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, Patrick Mochel
On Fri, Jul 01, 2005 at 11:25:30PM -0500, Dmitry Torokhov wrote:
> On Friday 01 July 2005 17:31, Greg KH wrote:
> > Putting it
> > in every device directory would make the 20K scsi device people very
> > unhappy as I take up even more of their 31bit memory :)
> >
>
> I see. That would be an argument for folding all such operationsinto one
> attribute with bus-specific multiplexor. But really, 20K scsi people are
> probably better off without sysfs (they should still have hotplug events
> as far as I can see so hotplug/usev should still work).
The 20k scsi people need sysfs. They did the backing store patches for
it, to make it work sane on their boxes. They need persistant device
naming more than almost anyone else. udev previously would not work
without sysfs. For 2.6.12, it now almost can (haven't tried for sure,
but I think we are now there.)
> Just to reiterate - by beef is that if you put [un]bind into separate
> directory similar operations will be split across 2 subdirectories.
But I didn't. They are now both in the same directory. Look at Linus's
tree :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [RFC] bind and unbind drivers from userspace through sysfs
2005-07-02 4:51 ` Greg KH
@ 2005-07-02 5:20 ` Dmitry Torokhov
0 siblings, 0 replies; 70+ messages in thread
From: Dmitry Torokhov @ 2005-07-02 5:20 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Patrick Mochel
On Friday 01 July 2005 23:51, Greg KH wrote:
> On Fri, Jul 01, 2005 at 11:25:30PM -0500, Dmitry Torokhov wrote:
> > On Friday 01 July 2005 17:31, Greg KH wrote:
> > > Putting it
> > > in every device directory would make the 20K scsi device people very
> > > unhappy as I take up even more of their 31bit memory :)
> > >
> >
> > I see. That would be an argument for folding all such operationsinto one
> > attribute with bus-specific multiplexor. But really, 20K scsi people are
> > probably better off without sysfs (they should still have hotplug events
> > as far as I can see so hotplug/usev should still work).
>
> The 20k scsi people need sysfs. They did the backing store patches for
> it, to make it work sane on their boxes. They need persistant device
> naming more than almost anyone else. udev previously would not work
> without sysfs. For 2.6.12, it now almost can (haven't tried for sure,
> but I think we are now there.)
I believe you can make it work ;)
>
> > Just to reiterate - by beef is that if you put [un]bind into separate
> > directory similar operations will be split across 2 subdirectories.
>
> But I didn't. They are now both in the same directory. Look at Linus's
> tree :)
>
You misunderstood me. I know that both bind and unbind are in the same
directory. I am talking about reconnect/rescan being in one directory
while bind/unbind are in the other while they all perform related
operations.
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread
* [PATCH] driver core: add bus_find_device & driver_find_device functions
@ 2005-06-30 6:04 Greg KH
2005-06-30 6:04 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-06-30 6:04 UTC (permalink / raw)
To: linux-kernel; +Cc: cohuck
[PATCH] driver core: add bus_find_device & driver_find_device functions
Add bus_find_device() and driver_find_device() which allow searching for a
device in the bus's resp. the driver's klist and obtain a reference on it.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
commit 0edb586049e57c56e625536476931117a57671e9
tree 9d92bb9821d134d199d62de1ff3096ff2b73fdc7
parent fd782a4a99d2d3e818b9465c427b10f7f027d7da
author Cornelia Huck <cohuck@de.ibm.com> Wed, 22 Jun 2005 16:59:51 +0200
committer Greg Kroah-Hartman <gregkh@suse.de> Wed, 29 Jun 2005 22:48:03 -0700
drivers/base/bus.c | 34 ++++++++++++++++++++++++++++++++++
drivers/base/driver.c | 35 +++++++++++++++++++++++++++++++++++
include/linux/device.h | 5 +++++
3 files changed, 74 insertions(+), 0 deletions(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -177,6 +177,39 @@ int bus_for_each_dev(struct bus_type * b
return error;
}
+/**
+ * bus_find_device - device iterator for locating a particular device.
+ * @bus: bus type
+ * @start: Device to begin with
+ * @data: Data to pass to match function
+ * @match: Callback function to check device
+ *
+ * This is similar to the bus_for_each_dev() function above, but it
+ * returns a reference to a device that is 'found' for later use, as
+ * determined by the @match callback.
+ *
+ * The callback should return 0 if the device doesn't match and non-zero
+ * if it does. If the callback returns non-zero, this function will
+ * return to the caller and not iterate over any more devices.
+ */
+struct device * bus_find_device(struct bus_type *bus,
+ struct device *start, void *data,
+ int (*match)(struct device *, void *))
+{
+ struct klist_iter i;
+ struct device *dev;
+
+ if (!bus)
+ return NULL;
+
+ klist_iter_init_node(&bus->klist_devices, &i,
+ (start ? &start->knode_bus : NULL));
+ while ((dev = next_device(&i)))
+ if (match(dev, data) && get_device(dev))
+ break;
+ klist_iter_exit(&i);
+ return dev;
+}
static struct device_driver * next_driver(struct klist_iter * i)
@@ -557,6 +590,7 @@ int __init buses_init(void)
EXPORT_SYMBOL_GPL(bus_for_each_dev);
+EXPORT_SYMBOL_GPL(bus_find_device);
EXPORT_SYMBOL_GPL(bus_for_each_drv);
EXPORT_SYMBOL_GPL(bus_add_device);
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -56,6 +56,41 @@ EXPORT_SYMBOL_GPL(driver_for_each_device
/**
+ * driver_find_device - device iterator for locating a particular device.
+ * @driver: The device's driver
+ * @start: Device to begin with
+ * @data: Data to pass to match function
+ * @match: Callback function to check device
+ *
+ * This is similar to the driver_for_each_device() function above, but
+ * it returns a reference to a device that is 'found' for later use, as
+ * determined by the @match callback.
+ *
+ * The callback should return 0 if the device doesn't match and non-zero
+ * if it does. If the callback returns non-zero, this function will
+ * return to the caller and not iterate over any more devices.
+ */
+struct device * driver_find_device(struct device_driver *drv,
+ struct device * start, void * data,
+ int (*match)(struct device *, void *))
+{
+ struct klist_iter i;
+ struct device *dev;
+
+ if (!drv)
+ return NULL;
+
+ klist_iter_init_node(&drv->klist_devices, &i,
+ (start ? &start->knode_driver : NULL));
+ while ((dev = next_device(&i)))
+ if (match(dev, data) && get_device(dev))
+ break;
+ klist_iter_exit(&i);
+ return dev;
+}
+EXPORT_SYMBOL_GPL(driver_find_device);
+
+/**
* driver_create_file - create sysfs file for driver.
* @drv: driver.
* @attr: driver attribute descriptor.
diff --git a/include/linux/device.h b/include/linux/device.h
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -80,6 +80,8 @@ extern struct bus_type * find_bus(char *
int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
int (*fn)(struct device *, void *));
+struct device * bus_find_device(struct bus_type *bus, struct device *start,
+ void *data, int (*match)(struct device *, void *));
int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
void * data, int (*fn)(struct device_driver *, void *));
@@ -142,6 +144,9 @@ extern void driver_remove_file(struct de
extern int driver_for_each_device(struct device_driver * drv, struct device * start,
void * data, int (*fn)(struct device *, void *));
+struct device * driver_find_device(struct device_driver *drv,
+ struct device *start, void *data,
+ int (*match)(struct device *, void *));
/*
^ permalink raw reply [flat|nested] 70+ messages in thread* [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-30 6:04 [PATCH] driver core: add bus_find_device & driver_find_device functions Greg KH
@ 2005-06-30 6:04 ` Greg KH
2005-06-30 6:25 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-06-30 6:04 UTC (permalink / raw)
To: linux-kernel; +Cc: gregkh
[PATCH] driver core: Add the ability to unbind drivers to devices from userspace
This adds a single file, "unbind", to the sysfs directory of every
device that is currently bound to a driver. To unbind the driver from
the device, write anything to this file and they will be disconnected
from each other.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
commit 151ef38f7c0ec1b0420f04438b0316e3a30bf2e4
tree 3aa6504e12c08f70cacb7f9de6ef5858b45ee86d
parent 0edb586049e57c56e625536476931117a57671e9
author Greg Kroah-Hartman <gregkh@suse.de> Wed, 22 Jun 2005 16:09:05 -0700
committer Greg Kroah-Hartman <gregkh@suse.de> Wed, 29 Jun 2005 22:48:04 -0700
drivers/base/bus.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -133,6 +133,34 @@ static struct kobj_type ktype_bus = {
decl_subsys(bus, &ktype_bus, NULL);
+/* Manually detach a device from it's associated driver. */
+static int driver_helper(struct device *dev, void *data)
+{
+ const char *name = data;
+
+ if (strcmp(name, dev->bus_id) == 0)
+ return 1;
+ return 0;
+}
+
+static ssize_t driver_unbind(struct device_driver *drv,
+ const char *buf, size_t count)
+{
+ struct bus_type *bus = get_bus(drv->bus);
+ struct device *dev;
+ int err = -ENODEV;
+
+ dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
+ if ((dev) &&
+ (dev->driver == drv)) {
+ device_release_driver(dev);
+ err = count;
+ }
+ return err;
+}
+static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
+
+
static struct device * next_device(struct klist_iter * i)
{
struct klist_node * n = klist_next(i);
@@ -396,6 +424,7 @@ int bus_add_driver(struct device_driver
module_add_driver(drv->owner, drv);
driver_add_attrs(bus, drv);
+ driver_create_file(drv, &driver_attr_unbind);
}
return error;
}
@@ -413,6 +442,7 @@ int bus_add_driver(struct device_driver
void bus_remove_driver(struct device_driver * drv)
{
if (drv->bus) {
+ driver_remove_file(drv, &driver_attr_unbind);
driver_remove_attrs(drv->bus, drv);
klist_remove(&drv->knode_bus);
pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-30 6:04 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
@ 2005-06-30 6:25 ` Dmitry Torokhov
2005-06-30 6:29 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-06-30 6:25 UTC (permalink / raw)
To: linux-kernel, Greg K-H; +Cc: gregkh
On Thursday 30 June 2005 01:04, Greg KH wrote:
> [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
>
> This adds a single file, "unbind", to the sysfs directory of every
> device that is currently bound to a driver. To unbind the driver from
> the device, write anything to this file and they will be disconnected
> from each other.
>
Comment and the patch disagree with each other.
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> ---
> commit 151ef38f7c0ec1b0420f04438b0316e3a30bf2e4
> tree 3aa6504e12c08f70cacb7f9de6ef5858b45ee86d
> parent 0edb586049e57c56e625536476931117a57671e9
> author Greg Kroah-Hartman <gregkh@suse.de> Wed, 22 Jun 2005 16:09:05 -0700
> committer Greg Kroah-Hartman <gregkh@suse.de> Wed, 29 Jun 2005 22:48:04 -0700
>
> drivers/base/bus.c | 30 ++++++++++++++++++++++++++++++
> 1 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/base/bus.c b/drivers/base/bus.c
> --- a/drivers/base/bus.c
> +++ b/drivers/base/bus.c
> @@ -133,6 +133,34 @@ static struct kobj_type ktype_bus = {
> decl_subsys(bus, &ktype_bus, NULL);
>
>
> +/* Manually detach a device from it's associated driver. */
> +static int driver_helper(struct device *dev, void *data)
> +{
> + const char *name = data;
> +
> + if (strcmp(name, dev->bus_id) == 0)
> + return 1;
> + return 0;
> +}
> +
> +static ssize_t driver_unbind(struct device_driver *drv,
> + const char *buf, size_t count)
> +{
> + struct bus_type *bus = get_bus(drv->bus);
> + struct device *dev;
> + int err = -ENODEV;
> +
> + dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
> + if ((dev) &&
> + (dev->driver == drv)) {
> + device_release_driver(dev);
> + err = count;
> + }
> + return err;
> +}
> +static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
> +
> +
> static struct device * next_device(struct klist_iter * i)
> {
> struct klist_node * n = klist_next(i);
> @@ -396,6 +424,7 @@ int bus_add_driver(struct device_driver
> module_add_driver(drv->owner, drv);
>
> driver_add_attrs(bus, drv);
> + driver_create_file(drv, &driver_attr_unbind);
> }
> return error;
> }
> @@ -413,6 +442,7 @@ int bus_add_driver(struct device_driver
> void bus_remove_driver(struct device_driver * drv)
> {
> if (drv->bus) {
> + driver_remove_file(drv, &driver_attr_unbind);
> driver_remove_attrs(drv->bus, drv);
> klist_remove(&drv->knode_bus);
> pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-06-30 6:25 ` Dmitry Torokhov
@ 2005-06-30 6:29 ` Greg KH
0 siblings, 0 replies; 70+ messages in thread
From: Greg KH @ 2005-06-30 6:29 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, gregkh
On Thu, Jun 30, 2005 at 01:25:39AM -0500, Dmitry Torokhov wrote:
> On Thursday 30 June 2005 01:04, Greg KH wrote:
> > [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
> >
> > This adds a single file, "unbind", to the sysfs directory of every
> > device that is currently bound to a driver. To unbind the driver from
> > the device, write anything to this file and they will be disconnected
> > from each other.
> >
>
> Comment and the patch disagree with each other.
bleah, you are right, that was the old comment with the new patch. Oh
well...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
@ 2005-07-25 4:09 Jon Smirl
2005-07-25 4:58 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-25 4:09 UTC (permalink / raw)
To: Greg KH; +Cc: lkml
I just pulled from GIT to test bind/unbind. I couldn't get it to work;
it isn't taking into account the CR on the end of the input value of
the sysfs attribute. This patch will fix it but I'm sure there is a
cleaner solution.
--
Jon Smirl
jonsmirl@gmail.com
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -137,9 +137,11 @@ decl_subsys(bus, &ktype_bus, NULL);
static int driver_helper(struct device *dev, void *data)
{
const char *name = data;
-
- if (strcmp(name, dev->bus_id) == 0)
+printk(KERN_ERR "unbind: %s %s\n", name, dev->bus_id);
+ if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0) {
+printk(KERN_ERR "match\n");
return 1;
+ }
return 0;
}
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-25 4:09 Jon Smirl
@ 2005-07-25 4:58 ` Dmitry Torokhov
2005-07-25 14:28 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-07-25 4:58 UTC (permalink / raw)
To: linux-kernel, Jon Smirl; +Cc: Greg KH
On Sunday 24 July 2005 23:09, Jon Smirl wrote:
> I just pulled from GIT to test bind/unbind. I couldn't get it to work;
> it isn't taking into account the CR on the end of the input value of
> the sysfs attribute. This patch will fix it but I'm sure there is a
> cleaner solution.
>
"echo -n" should take care of this problem I think.
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-25 4:58 ` Dmitry Torokhov
@ 2005-07-25 14:28 ` Jon Smirl
2005-07-25 14:48 ` Dmitry Torokhov
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-25 14:28 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-kernel, Greg KH
On 7/25/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> On Sunday 24 July 2005 23:09, Jon Smirl wrote:
> > I just pulled from GIT to test bind/unbind. I couldn't get it to work;
> > it isn't taking into account the CR on the end of the input value of
> > the sysfs attribute. This patch will fix it but I'm sure there is a
> > cleaner solution.
> >
>
> "echo -n" should take care of this problem I think.
That will work around it but I think we should fix it. Changing to
strncmp() fixes most cases.
- if (strcmp(name, dev->bus_id) == 0)
+ if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0)
I work in this area and I couldn't figure out why it was silently not
working. I had to add the printk to the source before I could figure
it out. I suspect most people are going to have this trouble.
This has also made me realize that I have created other places in the
kernel where my sysfs attribute code is not going to work correctly.
Maybe we should adjust the sysfs driver to strip leading and trailing
white space before passing the string on.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-25 14:28 ` Jon Smirl
@ 2005-07-25 14:48 ` Dmitry Torokhov
2005-07-25 16:30 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Dmitry Torokhov @ 2005-07-25 14:48 UTC (permalink / raw)
To: Jon Smirl; +Cc: linux-kernel, Greg KH
On 7/25/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> On 7/25/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> > On Sunday 24 July 2005 23:09, Jon Smirl wrote:
> > > I just pulled from GIT to test bind/unbind. I couldn't get it to work;
> > > it isn't taking into account the CR on the end of the input value of
> > > the sysfs attribute. This patch will fix it but I'm sure there is a
> > > cleaner solution.
> > >
> >
> > "echo -n" should take care of this problem I think.
>
> That will work around it but I think we should fix it. Changing to
> strncmp() fixes most cases.
>
> - if (strcmp(name, dev->bus_id) == 0)
> + if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0)
>
This will produce "interesting results" if you have both "blah-1" and
"blah-10" devices on the bus.
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-25 14:48 ` Dmitry Torokhov
@ 2005-07-25 16:30 ` Jon Smirl
2005-07-26 0:00 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-25 16:30 UTC (permalink / raw)
To: dtor_core; +Cc: linux-kernel, Greg KH
On 7/25/05, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On 7/25/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> > On 7/25/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> > > On Sunday 24 July 2005 23:09, Jon Smirl wrote:
> > > > I just pulled from GIT to test bind/unbind. I couldn't get it to work;
> > > > it isn't taking into account the CR on the end of the input value of
> > > > the sysfs attribute. This patch will fix it but I'm sure there is a
> > > > cleaner solution.
> > > >
> > >
> > > "echo -n" should take care of this problem I think.
> >
> > That will work around it but I think we should fix it. Changing to
> > strncmp() fixes most cases.
> >
> > - if (strcmp(name, dev->bus_id) == 0)
> > + if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0)
> >
>
> This will produce "interesting results" if you have both "blah-1" and
> "blah-10" devices on the bus.
Then the better solution is to fix the generic attribute set code to
strip leading and trailing white space.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-25 16:30 ` Jon Smirl
@ 2005-07-26 0:00 ` Greg KH
2005-07-26 0:28 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-26 0:00 UTC (permalink / raw)
To: Jon Smirl; +Cc: dtor_core, linux-kernel
On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote:
> On 7/25/05, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > On 7/25/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> > > On 7/25/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> > > > On Sunday 24 July 2005 23:09, Jon Smirl wrote:
> > > > > I just pulled from GIT to test bind/unbind. I couldn't get it to work;
> > > > > it isn't taking into account the CR on the end of the input value of
> > > > > the sysfs attribute. This patch will fix it but I'm sure there is a
> > > > > cleaner solution.
> > > > >
> > > >
> > > > "echo -n" should take care of this problem I think.
> > >
> > > That will work around it but I think we should fix it. Changing to
> > > strncmp() fixes most cases.
> > >
> > > - if (strcmp(name, dev->bus_id) == 0)
> > > + if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0)
> > >
> >
> > This will produce "interesting results" if you have both "blah-1" and
> > "blah-10" devices on the bus.
Yes, not a good thing for USB devices specifically.
> Then the better solution is to fix the generic attribute set code to
> strip leading and trailing white space.
No, that might break other things as we have not been doing this from
day one. I'd rather just change these two places, if it's that big of a
deal. It was documented (in a lwn.net article) and the changelog entry,
that you should use "echo -n".
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-26 0:00 ` Greg KH
@ 2005-07-26 0:28 ` Jon Smirl
2005-07-26 0:30 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-26 0:28 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
On 7/25/05, Greg KH <greg@kroah.com> wrote:
> On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote:
> > On 7/25/05, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > > On 7/25/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> > > > On 7/25/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> > > > > On Sunday 24 July 2005 23:09, Jon Smirl wrote:
> > > > > > I just pulled from GIT to test bind/unbind. I couldn't get it to work;
> > > > > > it isn't taking into account the CR on the end of the input value of
> > > > > > the sysfs attribute. This patch will fix it but I'm sure there is a
> > > > > > cleaner solution.
> > > > > >
> > > > >
> > > > > "echo -n" should take care of this problem I think.
> > > >
> > > > That will work around it but I think we should fix it. Changing to
> > > > strncmp() fixes most cases.
> > > >
> > > > - if (strcmp(name, dev->bus_id) == 0)
> > > > + if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0)
> > > >
> > >
> > > This will produce "interesting results" if you have both "blah-1" and
> > > "blah-10" devices on the bus.
>
> Yes, not a good thing for USB devices specifically.
>
> > Then the better solution is to fix the generic attribute set code to
> > strip leading and trailing white space.
>
> No, that might break other things as we have not been doing this from
> day one. I'd rather just change these two places, if it's that big of a
> deal. It was documented (in a lwn.net article) and the changelog entry,
> that you should use "echo -n".
I didn't realize that echo was adding the CR, I thought that it always
appeared on the end of a sysfs attribute set. So now I have to go add
white space stripping to a dozen fbdev/drm sysfs attribute
implementations. Given that the param is const I may have to allocate
new buffers and copy. I also wonder how many other people have made
the same mistake.
Are you sure it would break other things? These are supposed to be
text attributes, not binary ones.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-26 0:28 ` Jon Smirl
@ 2005-07-26 0:30 ` Greg KH
2005-07-26 0:56 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-26 0:30 UTC (permalink / raw)
To: Jon Smirl; +Cc: dtor_core, linux-kernel
On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote:
> On 7/25/05, Greg KH <greg@kroah.com> wrote:
> > On Mon, Jul 25, 2005 at 12:30:43PM -0400, Jon Smirl wrote:
> > > On 7/25/05, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > > > On 7/25/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> > > > > On 7/25/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> > > > > > On Sunday 24 July 2005 23:09, Jon Smirl wrote:
> > > > > > > I just pulled from GIT to test bind/unbind. I couldn't get it to work;
> > > > > > > it isn't taking into account the CR on the end of the input value of
> > > > > > > the sysfs attribute. This patch will fix it but I'm sure there is a
> > > > > > > cleaner solution.
> > > > > > >
> > > > > >
> > > > > > "echo -n" should take care of this problem I think.
> > > > >
> > > > > That will work around it but I think we should fix it. Changing to
> > > > > strncmp() fixes most cases.
> > > > >
> > > > > - if (strcmp(name, dev->bus_id) == 0)
> > > > > + if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0)
> > > > >
> > > >
> > > > This will produce "interesting results" if you have both "blah-1" and
> > > > "blah-10" devices on the bus.
> >
> > Yes, not a good thing for USB devices specifically.
> >
> > > Then the better solution is to fix the generic attribute set code to
> > > strip leading and trailing white space.
> >
> > No, that might break other things as we have not been doing this from
> > day one. I'd rather just change these two places, if it's that big of a
> > deal. It was documented (in a lwn.net article) and the changelog entry,
> > that you should use "echo -n".
>
> I didn't realize that echo was adding the CR, I thought that it always
> appeared on the end of a sysfs attribute set. So now I have to go add
> white space stripping to a dozen fbdev/drm sysfs attribute
> implementations. Given that the param is const I may have to allocate
> new buffers and copy. I also wonder how many other people have made
> the same mistake.
Nah, just zero out that \n character :)
> Are you sure it would break other things? These are supposed to be
> text attributes, not binary ones.
I agree, I don't know what would break. Care to make a patch so we
could find out?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-26 0:30 ` Greg KH
@ 2005-07-26 0:56 ` Jon Smirl
2005-07-26 1:54 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-26 0:56 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
On 7/25/05, Greg KH <greg@kroah.com> wrote:
> On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote:
> > I didn't realize that echo was adding the CR, I thought that it always
> > appeared on the end of a sysfs attribute set. So now I have to go add
> > white space stripping to a dozen fbdev/drm sysfs attribute
> > implementations. Given that the param is const I may have to allocate
> > new buffers and copy. I also wonder how many other people have made
> > the same mistake.
>
> Nah, just zero out that \n character :)
The input buffer is "const char * buf". I will have to override the
const to zero it out.
>
> > Are you sure it would break other things? These are supposed to be
> > text attributes, not binary ones.
>
> I agree, I don't know what would break. Care to make a patch so we
> could find out?
I'll put one together to trim leading/trailing white space from the
buffer before it is passed into the attribute functions. Now that I
think about this I believe the attributes should have always had the
leading/trailing white space removed. If we don't do it in the sysfs
code then every driver has to do it.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-26 0:56 ` Jon Smirl
@ 2005-07-26 1:54 ` Greg KH
2005-07-26 3:15 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-26 1:54 UTC (permalink / raw)
To: Jon Smirl; +Cc: dtor_core, linux-kernel
On Mon, Jul 25, 2005 at 08:56:17PM -0400, Jon Smirl wrote:
> On 7/25/05, Greg KH <greg@kroah.com> wrote:
> > On Mon, Jul 25, 2005 at 08:28:10PM -0400, Jon Smirl wrote:
> > > I didn't realize that echo was adding the CR, I thought that it always
> > > appeared on the end of a sysfs attribute set. So now I have to go add
> > > white space stripping to a dozen fbdev/drm sysfs attribute
> > > implementations. Given that the param is const I may have to allocate
> > > new buffers and copy. I also wonder how many other people have made
> > > the same mistake.
> >
> > Nah, just zero out that \n character :)
>
> The input buffer is "const char * buf". I will have to override the
> const to zero it out.
Yeah, hence the ":)" above.
> > > Are you sure it would break other things? These are supposed to be
> > > text attributes, not binary ones.
> >
> > I agree, I don't know what would break. Care to make a patch so we
> > could find out?
>
> I'll put one together to trim leading/trailing white space from the
> buffer before it is passed into the attribute functions. Now that I
> think about this I believe the attributes should have always had the
> leading/trailing white space removed. If we don't do it in the sysfs
> code then every driver has to do it.
Ok, sounds good.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-26 1:54 ` Greg KH
@ 2005-07-26 3:15 ` Jon Smirl
2005-07-26 3:29 ` Dmitry Torokhov
2005-07-28 2:05 ` Jon Smirl
0 siblings, 2 replies; 70+ messages in thread
From: Jon Smirl @ 2005-07-26 3:15 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
On 7/25/05, Greg KH <greg@kroah.com> wrote:
> > I'll put one together to trim leading/trailing white space from the
> > buffer before it is passed into the attribute functions. Now that I
> > think about this I believe the attributes should have always had the
> > leading/trailing white space removed. If we don't do it in the sysfs
> > code then every driver has to do it.
>
> Ok, sounds good.
How does this look? This is a count based interface but a lot of
attributes don't work unless I add the terminating zero. This
interface should be documented: count or zero terminated, white space
stripped or not, etc. Are these strings ASCII, UTF8, Unicode?
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -6,6 +6,7 @@
#include <linux/fsnotify.h>
#include <linux/kobject.h>
#include <linux/namei.h>
+#include <linux/ctype.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
@@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr
struct attribute * attr = to_attr(dentry);
struct kobject * kobj = to_kobj(dentry->d_parent);
struct sysfs_ops * ops = buffer->ops;
+ char *x, *y, *z;
+
+ /* locate leading white space */
+ x = buffer->page;
+ while( isspace(*x) && (x - buffer->page < count))
+ x++;
+
+ /* locate trailng white space */
+ z = y = x;
+ while (y - buffer->page < count) {
+ y++;
+ z = y;
+ while( isspace(*y) && (y - buffer->page < count)) {
+ y++;
+ }
+ }
+ count = z - x;
+
+ /* strip the white space */
+ if (buffer->page != x)
+ memmove(buffer->page, x, count);
+ buffer->page[count] = '\0';
return ops->store(kobj,attr,buffer->page,count);
}
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-26 3:15 ` Jon Smirl
@ 2005-07-26 3:29 ` Dmitry Torokhov
2005-07-28 2:05 ` Jon Smirl
1 sibling, 0 replies; 70+ messages in thread
From: Dmitry Torokhov @ 2005-07-26 3:29 UTC (permalink / raw)
To: Jon Smirl; +Cc: Greg KH, linux-kernel
On Monday 25 July 2005 22:15, Jon Smirl wrote:
> + while( isspace(*x) && (x - buffer->page < count))
> + x++;
> +
> + /* locate trailng white space */
> + z = y = x;
> + while (y - buffer->page < count) {
> + y++;
> + z = y;
> + while( isspace(*y) && (y - buffer->page < count)) {
> + y++;
Can we have consistent space vs. paren placement, pretty please?
--
Dmitry
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-26 3:15 ` Jon Smirl
2005-07-26 3:29 ` Dmitry Torokhov
@ 2005-07-28 2:05 ` Jon Smirl
2005-07-28 3:46 ` Greg KH
1 sibling, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 2:05 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
Any comments on this? I'll fix up the whitespace issues if everyone
agrees that the code works.
This patch will break all of the fbdev attributes since I was making
wrong assumptions. I have another patch ready to fix them after this
one goes in.
On 7/25/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> On 7/25/05, Greg KH <greg@kroah.com> wrote:
> > > I'll put one together to trim leading/trailing white space from the
> > > buffer before it is passed into the attribute functions. Now that I
> > > think about this I believe the attributes should have always had the
> > > leading/trailing white space removed. If we don't do it in the sysfs
> > > code then every driver has to do it.
> >
> > Ok, sounds good.
>
> How does this look? This is a count based interface but a lot of
> attributes don't work unless I add the terminating zero. This
> interface should be documented: count or zero terminated, white space
> stripped or not, etc. Are these strings ASCII, UTF8, Unicode?
>
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -6,6 +6,7 @@
> #include <linux/fsnotify.h>
> #include <linux/kobject.h>
> #include <linux/namei.h>
> +#include <linux/ctype.h>
> #include <asm/uaccess.h>
> #include <asm/semaphore.h>
>
> @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr
> struct attribute * attr = to_attr(dentry);
> struct kobject * kobj = to_kobj(dentry->d_parent);
> struct sysfs_ops * ops = buffer->ops;
> + char *x, *y, *z;
> +
> + /* locate leading white space */
> + x = buffer->page;
> + while( isspace(*x) && (x - buffer->page < count))
> + x++;
> +
> + /* locate trailng white space */
> + z = y = x;
> + while (y - buffer->page < count) {
> + y++;
> + z = y;
> + while( isspace(*y) && (y - buffer->page < count)) {
> + y++;
> + }
> + }
> + count = z - x;
> +
> + /* strip the white space */
> + if (buffer->page != x)
> + memmove(buffer->page, x, count);
> + buffer->page[count] = '\0';
>
> return ops->store(kobj,attr,buffer->page,count);
> }
>
>
> --
> Jon Smirl
> jonsmirl@gmail.com
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 2:05 ` Jon Smirl
@ 2005-07-28 3:46 ` Greg KH
2005-07-28 3:59 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-28 3:46 UTC (permalink / raw)
To: Jon Smirl; +Cc: dtor_core, linux-kernel
On Wed, Jul 27, 2005 at 10:05:34PM -0400, Jon Smirl wrote:
> Any comments on this? I'll fix up the whitespace issues if everyone
> agrees that the code works.
I'll add the patch to my tree and -mm if you clean up the whitespace
issues :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 3:46 ` Greg KH
@ 2005-07-28 3:59 ` Jon Smirl
2005-07-28 4:05 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 3:59 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
New patch with fixed whitespace.
--
Jon Smirl
jonsmirl@gmail.com
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -6,6 +6,7 @@
#include <linux/fsnotify.h>
#include <linux/kobject.h>
#include <linux/namei.h>
+#include <linux/ctype.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
@@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr
struct attribute * attr = to_attr(dentry);
struct kobject * kobj = to_kobj(dentry->d_parent);
struct sysfs_ops * ops = buffer->ops;
+ char *x, *y, *z;
+
+ /* locate leading white space */
+ x = buffer->page;
+ while (isspace(*x) && (x - buffer->page < count))
+ x++;
+
+ /* locate trailng white space */
+ z = y = x;
+ while (y - buffer->page < count) {
+ y++;
+ z = y;
+ while (isspace(*y) && (y - buffer->page < count)) {
+ y++;
+ }
+ }
+ count = z - x;
+
+ /* strip the white space */
+ if (buffer->page != x)
+ memmove(buffer->page, x, count);
+ buffer->page[count] = '\0';
return ops->store(kobj,attr,buffer->page,count);
}
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 3:59 ` Jon Smirl
@ 2005-07-28 4:05 ` Greg KH
2005-07-28 4:49 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-28 4:05 UTC (permalink / raw)
To: Jon Smirl; +Cc: dtor_core, linux-kernel
On Wed, Jul 27, 2005 at 11:59:11PM -0400, Jon Smirl wrote:
> New patch with fixed whitespace.
But no changelog info or signed-off-by line :(
Care to try it again?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 4:05 ` Greg KH
@ 2005-07-28 4:49 ` Jon Smirl
2005-07-28 5:49 ` Greg KH
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 4:49 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
Change log and signed off
--
Jon Smirl
jonsmirl@gmail.com
Remove leading and trailing whitespace when text sysfs attributes are
assigned a value.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -6,6 +6,7 @@
#include <linux/fsnotify.h>
#include <linux/kobject.h>
#include <linux/namei.h>
+#include <linux/ctype.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
@@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr
struct attribute * attr = to_attr(dentry);
struct kobject * kobj = to_kobj(dentry->d_parent);
struct sysfs_ops * ops = buffer->ops;
+ char *x, *y, *z;
+
+ /* locate leading white space */
+ x = buffer->page;
+ while (isspace(*x) && (x - buffer->page < count))
+ x++;
+
+ /* locate trailng white space */
+ z = y = x;
+ while (y - buffer->page < count) {
+ y++;
+ z = y;
+ while (isspace(*y) && (y - buffer->page < count)) {
+ y++;
+ }
+ }
+ count = z - x;
+
+ /* strip the white space */
+ if (buffer->page != x)
+ memmove(buffer->page, x, count);
+ buffer->page[count] = '\0';
return ops->store(kobj,attr,buffer->page,count);
}
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 4:49 ` Jon Smirl
@ 2005-07-28 5:49 ` Greg KH
2005-07-28 7:04 ` Mitchell Blank Jr
2005-07-28 12:52 ` Jon Smirl
0 siblings, 2 replies; 70+ messages in thread
From: Greg KH @ 2005-07-28 5:49 UTC (permalink / raw)
To: Jon Smirl; +Cc: dtor_core, linux-kernel
On Thu, Jul 28, 2005 at 12:49:21AM -0400, Jon Smirl wrote:
> @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr
> struct attribute * attr = to_attr(dentry);
> struct kobject * kobj = to_kobj(dentry->d_parent);
> struct sysfs_ops * ops = buffer->ops;
> + char *x, *y, *z;
> +
> + /* locate leading white space */
> + x = buffer->page;
> + while (isspace(*x) && (x - buffer->page < count))
> + x++;
Ok, I can follow this. For example
buffer->page = " foo "
then x = "foo " at the end of that .
> + /* locate trailng white space */
> + z = y = x;
> + while (y - buffer->page < count) {
> + y++;
> + z = y;
> + while (isspace(*y) && (y - buffer->page < count)) {
> + y++;
> + }
> + }
> + count = z - x;
Hm, I _think_ this works, but I need someone else to verify this...
Anyone else?
> +
> + /* strip the white space */
> + if (buffer->page != x)
> + memmove(buffer->page, x, count);
> + buffer->page[count] = '\0';
Why move the buffer? Why not just pass in a pointer to the start of the
"non-whitespace filled" buffer to the store() function?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 5:49 ` Greg KH
@ 2005-07-28 7:04 ` Mitchell Blank Jr
2005-07-28 12:54 ` Jon Smirl
2005-07-28 12:52 ` Jon Smirl
1 sibling, 1 reply; 70+ messages in thread
From: Mitchell Blank Jr @ 2005-07-28 7:04 UTC (permalink / raw)
To: Greg KH; +Cc: Jon Smirl, dtor_core, linux-kernel
Greg KH wrote:
> > + /* locate trailng white space */
> > + z = y = x;
> > + while (y - buffer->page < count) {
> > + y++;
> > + z = y;
> > + while (isspace(*y) && (y - buffer->page < count)) {
> > + y++;
> > + }
> > + }
> > + count = z - x;
>
> Hm, I _think_ this works, but I need someone else to verify this...
> Anyone else?
It looks sane-ish to me, but also more complicated than need be. Why can't
you just do something like:
while (count > 0 && isspace(x[count - 1]))
count--;
-Mitch
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 7:04 ` Mitchell Blank Jr
@ 2005-07-28 12:54 ` Jon Smirl
2005-07-28 13:09 ` Oliver Neukum
` (3 more replies)
0 siblings, 4 replies; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 12:54 UTC (permalink / raw)
To: Mitchell Blank Jr; +Cc: Greg KH, dtor_core, linux-kernel
On 7/28/05, Mitchell Blank Jr <mitch@sfgoth.com> wrote:
> Greg KH wrote:
> > > + /* locate trailng white space */
> > > + z = y = x;
> > > + while (y - buffer->page < count) {
> > > + y++;
> > > + z = y;
> > > + while (isspace(*y) && (y - buffer->page < count)) {
> > > + y++;
> > > + }
> > > + }
> > > + count = z - x;
> >
> > Hm, I _think_ this works, but I need someone else to verify this...
> > Anyone else?
>
> It looks sane-ish to me, but also more complicated than need be. Why can't
> you just do something like:
>
> while (count > 0 && isspace(x[count - 1]))
> count--;
>
> -Mitch
>
Do we need to deal with UTF8 here? I did the forward loop because you
can't parse UTF8 backwards. If UTF8 is possible I need to change the
pointer inc function.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 12:54 ` Jon Smirl
@ 2005-07-28 13:09 ` Oliver Neukum
2005-07-28 13:16 ` Paulo Marques
` (2 subsequent siblings)
3 siblings, 0 replies; 70+ messages in thread
From: Oliver Neukum @ 2005-07-28 13:09 UTC (permalink / raw)
To: Jon Smirl; +Cc: Mitchell Blank Jr, Greg KH, dtor_core, linux-kernel
Am Donnerstag, 28. Juli 2005 14:54 schrieb Jon Smirl:
> On 7/28/05, Mitchell Blank Jr <mitch@sfgoth.com> wrote:
> > Greg KH wrote:
> > > > + /* locate trailng white space */
> > > > + z = y = x;
> > > > + while (y - buffer->page < count) {
> > > > + y++;
> > > > + z = y;
> > > > + while (isspace(*y) && (y - buffer->page < count)) {
> > > > + y++;
> > > > + }
> > > > + }
> > > > + count = z - x;
> > >
> > > Hm, I _think_ this works, but I need someone else to verify this...
> > > Anyone else?
> >
> > It looks sane-ish to me, but also more complicated than need be. Why can't
> > you just do something like:
> >
> > while (count > 0 && isspace(x[count - 1]))
> > count--;
> >
> > -Mitch
> >
>
> Do we need to deal with UTF8 here? I did the forward loop because you
> can't parse UTF8 backwards. If UTF8 is possible I need to change the
> pointer inc function.
This considerations show that having parsing code in kernel space is
a questionable idea. Are you absolutely sure that you cannot do with less?
Regards
Oliver
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 12:54 ` Jon Smirl
2005-07-28 13:09 ` Oliver Neukum
@ 2005-07-28 13:16 ` Paulo Marques
2005-07-28 18:09 ` Mitchell Blank Jr
2005-07-28 19:03 ` Greg KH
3 siblings, 0 replies; 70+ messages in thread
From: Paulo Marques @ 2005-07-28 13:16 UTC (permalink / raw)
To: Jon Smirl; +Cc: Mitchell Blank Jr, Greg KH, dtor_core, linux-kernel
Jon Smirl wrote:
> On 7/28/05, Mitchell Blank Jr <mitch@sfgoth.com> wrote:
>>[...]
>>It looks sane-ish to me, but also more complicated than need be. Why can't
>>you just do something like:
>>
>> while (count > 0 && isspace(x[count - 1]))
>> count--;
>
> Do we need to deal with UTF8 here? I did the forward loop because you
> can't parse UTF8 backwards. If UTF8 is possible I need to change the
> pointer inc function.
I don't think it matters here. Even with UTF8, any char that makes
isspace return true, can't be part of a multi-byte char, as every byte
in a multi-byte char in UTF8 has the MSB set, i.e., >= 0x80.
--
Paulo Marques - www.grupopie.com
It is a mistake to think you can solve any major problems
just with potatoes.
Douglas Adams
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 12:54 ` Jon Smirl
2005-07-28 13:09 ` Oliver Neukum
2005-07-28 13:16 ` Paulo Marques
@ 2005-07-28 18:09 ` Mitchell Blank Jr
2005-07-28 19:03 ` Greg KH
3 siblings, 0 replies; 70+ messages in thread
From: Mitchell Blank Jr @ 2005-07-28 18:09 UTC (permalink / raw)
To: Jon Smirl; +Cc: Greg KH, dtor_core, linux-kernel
Jon Smirl wrote:
> Do we need to deal with UTF8 here? I did the forward loop because you
> can't parse UTF8 backwards. If UTF8 is possible I need to change the
> pointer inc function.
As others have mentioned there shouldn't be a UTF8 problem with isspace().
However, even if you wanted to scan going forwards you can do it without
the complexity of a nested loop:
char *real_end;
for (real_end = x; x - buffer->page < count; x++)
if (!isspace(*x))
real_end = x + 1;
*real_end = '\0';
// then fix "count"
BTW, my code I posted yesterday is incomplete since I neglected to notice
that the "count = z - x" at the end is used to repair "count" damage from
both the leading and trailing whitespace stripping. Its actually easier
to strip the trailing whitespace first, like:
while (count > 0 && isspace(buffer->page[count - 1]))
count--; /* strip trailing whitespace */
if (count > 0 && isspace(buffer->page[0])) {
/*
* We have leading whitespace but also at least one
* non-whitespace character
*/
const char *x = buffer->page;
do {
x++;
count--;
} while (isspace(*x));
memmove(buffer->page, x, count);
}
buffer->page[count] = '\0';
-Mitch
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 12:54 ` Jon Smirl
` (2 preceding siblings ...)
2005-07-28 18:09 ` Mitchell Blank Jr
@ 2005-07-28 19:03 ` Greg KH
2005-07-28 19:57 ` Jon Smirl
3 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-07-28 19:03 UTC (permalink / raw)
To: Jon Smirl; +Cc: Mitchell Blank Jr, dtor_core, linux-kernel
On Thu, Jul 28, 2005 at 08:54:53AM -0400, Jon Smirl wrote:
> On 7/28/05, Mitchell Blank Jr <mitch@sfgoth.com> wrote:
> > Greg KH wrote:
> > > > + /* locate trailng white space */
> > > > + z = y = x;
> > > > + while (y - buffer->page < count) {
> > > > + y++;
> > > > + z = y;
> > > > + while (isspace(*y) && (y - buffer->page < count)) {
> > > > + y++;
> > > > + }
> > > > + }
> > > > + count = z - x;
> > >
> > > Hm, I _think_ this works, but I need someone else to verify this...
> > > Anyone else?
> >
> > It looks sane-ish to me, but also more complicated than need be. Why can't
> > you just do something like:
> >
> > while (count > 0 && isspace(x[count - 1]))
> > count--;
> >
> > -Mitch
> >
>
> Do we need to deal with UTF8 here? I did the forward loop because you
> can't parse UTF8 backwards. If UTF8 is possible I need to change the
> pointer inc function.
No, we don't need to handle UTF8. Or if we do, then we better not make
a general filter function, as it will be a mess.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 19:03 ` Greg KH
@ 2005-07-28 19:57 ` Jon Smirl
2005-07-28 20:22 ` Mitchell Blank Jr
2005-07-28 21:10 ` Oliver Neukum
0 siblings, 2 replies; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 19:57 UTC (permalink / raw)
To: Greg KH; +Cc: Mitchell Blank Jr, dtor_core, linux-kernel
New, simplified version of the sysfs whitespace strip patch...
--
Jon Smirl
jonsmirl@gmail.com
Remove leading and trailing whitespace when text sysfs attribute is set
signed-off-by: Jon Smirl <jonsmirl@gmail.com>
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -6,6 +6,7 @@
#include <linux/fsnotify.h>
#include <linux/kobject.h>
#include <linux/namei.h>
+#include <linux/ctype.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
@@ -207,8 +208,22 @@ flush_write_buffer(struct dentry * dentr
struct attribute * attr = to_attr(dentry);
struct kobject * kobj = to_kobj(dentry->d_parent);
struct sysfs_ops * ops = buffer->ops;
+ char *x;
- return ops->store(kobj,attr,buffer->page,count);
+ /* locate trailing white space */
+ while ((count > 0) && isspace(buffer->page[count - 1]))
+ count--;
+
+ /* locate leading white space */
+ x = buffer->page;
+ while (isspace(*x) && (x - buffer->page < count))
+ x++;
+ count -= (x - buffer->page);
+
+ /* terminate the string */
+ x[count] = '\0';
+
+ return ops->store(kobj, attr, x, count);
}
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 19:57 ` Jon Smirl
@ 2005-07-28 20:22 ` Mitchell Blank Jr
2005-07-28 20:27 ` Jon Smirl
2005-07-28 21:10 ` Oliver Neukum
1 sibling, 1 reply; 70+ messages in thread
From: Mitchell Blank Jr @ 2005-07-28 20:22 UTC (permalink / raw)
To: Jon Smirl; +Cc: Greg KH, dtor_core, linux-kernel
Still one nitpick:
Jon Smirl wrote:
> + while (isspace(*x) && (x - buffer->page < count))
> + x++;
I think you can just do:
if (count > 0)
while (isspace(*x))
x++;
If the passed-in string was fully whitespace then the trailing-whitespace
stripping would already reduce it to count==0. So as long as you check
for that case you can be sure that the while() will stop before x falls off
the end of the string.
Other than that it looks fine to me now.
-Mitch
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 20:22 ` Mitchell Blank Jr
@ 2005-07-28 20:27 ` Jon Smirl
2005-07-29 18:50 ` Jon Smirl
2005-08-21 22:21 ` Jon Smirl
0 siblings, 2 replies; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 20:27 UTC (permalink / raw)
To: Mitchell Blank Jr; +Cc: Greg KH, dtor_core, linux-kernel
Even simpler version....
--
Jon Smirl
jonsmirl@gmail.com
Remove leading and trailing whitespace when text sysfs attribute is set
signed-off-by: Jon Smirl <jonsmirl@gmail.com>
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -6,6 +6,7 @@
#include <linux/fsnotify.h>
#include <linux/kobject.h>
#include <linux/namei.h>
+#include <linux/ctype.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
@@ -207,8 +208,23 @@ flush_write_buffer(struct dentry * dentr
struct attribute * attr = to_attr(dentry);
struct kobject * kobj = to_kobj(dentry->d_parent);
struct sysfs_ops * ops = buffer->ops;
+ char *x;
- return ops->store(kobj,attr,buffer->page,count);
+ /* locate trailing white space */
+ while ((count > 0) && isspace(buffer->page[count - 1]))
+ count--;
+
+ /* locate leading white space */
+ x = buffer->page;
+ if (count > 0) {
+ while (isspace(*x))
+ x++;
+ count -= (x - buffer->page);
+ }
+ /* terminate the string */
+ x[count] = '\0';
+
+ return ops->store(kobj, attr, x, count);
}
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 20:27 ` Jon Smirl
@ 2005-07-29 18:50 ` Jon Smirl
2005-08-06 0:42 ` Greg KH
2005-08-21 22:21 ` Jon Smirl
1 sibling, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-07-29 18:50 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
Greg, is this ok for your tree now or does it need more work?
On 7/28/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> Even simpler version....
>
> --
> Jon Smirl
> jonsmirl@gmail.com
>
> Remove leading and trailing whitespace when text sysfs attribute is set
> signed-off-by: Jon Smirl <jonsmirl@gmail.com>
>
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -6,6 +6,7 @@
> #include <linux/fsnotify.h>
> #include <linux/kobject.h>
> #include <linux/namei.h>
> +#include <linux/ctype.h>
> #include <asm/uaccess.h>
> #include <asm/semaphore.h>
>
> @@ -207,8 +208,23 @@ flush_write_buffer(struct dentry * dentr
> struct attribute * attr = to_attr(dentry);
> struct kobject * kobj = to_kobj(dentry->d_parent);
> struct sysfs_ops * ops = buffer->ops;
> + char *x;
>
> - return ops->store(kobj,attr,buffer->page,count);
> + /* locate trailing white space */
> + while ((count > 0) && isspace(buffer->page[count - 1]))
> + count--;
> +
> + /* locate leading white space */
> + x = buffer->page;
> + if (count > 0) {
> + while (isspace(*x))
> + x++;
> + count -= (x - buffer->page);
> + }
> + /* terminate the string */
> + x[count] = '\0';
> +
> + return ops->store(kobj, attr, x, count);
> }
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-29 18:50 ` Jon Smirl
@ 2005-08-06 0:42 ` Greg KH
2005-08-06 3:48 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Greg KH @ 2005-08-06 0:42 UTC (permalink / raw)
To: Jon Smirl; +Cc: linux-kernel
On Fri, Jul 29, 2005 at 02:50:44PM -0400, Jon Smirl wrote:
> Greg, is this ok for your tree now or does it need more work?
It's in my queue, will add it to the tree next week. Sorry for the
delay, was at OSCON this week...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-06 0:42 ` Greg KH
@ 2005-08-06 3:48 ` Jon Smirl
0 siblings, 0 replies; 70+ messages in thread
From: Jon Smirl @ 2005-08-06 3:48 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
On 8/5/05, Greg KH <greg@kroah.com> wrote:
> On Fri, Jul 29, 2005 at 02:50:44PM -0400, Jon Smirl wrote:
> > Greg, is this ok for your tree now or does it need more work?
>
> It's in my queue, will add it to the tree next week. Sorry for the
> delay, was at OSCON this week...
Glad to see this. After it lands in the tree I'll fix up about ten
places where I have attribute processing wrong because of this. Is
there some place in the sysfs doc that this can be mentioned?
Another thing that should be cleared up is if the attributes are
described by length or zero termination. Right now they get both. I
suspect the right answer here is supposed to be by length.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 20:27 ` Jon Smirl
2005-07-29 18:50 ` Jon Smirl
@ 2005-08-21 22:21 ` Jon Smirl
1 sibling, 0 replies; 70+ messages in thread
From: Jon Smirl @ 2005-08-21 22:21 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
On 7/28/05, Jon Smirl <jonsmirl@gmail.com> wrote:
> Even simpler version....
>
> --
> Jon Smirl
> jonsmirl@gmail.com
>
> Remove leading and trailing whitespace when text sysfs attribute is set
> signed-off-by: Jon Smirl <jonsmirl@gmail.com>
>
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -6,6 +6,7 @@
> #include <linux/fsnotify.h>
> #include <linux/kobject.h>
> #include <linux/namei.h>
> +#include <linux/ctype.h>
> #include <asm/uaccess.h>
> #include <asm/semaphore.h>
>
> @@ -207,8 +208,23 @@ flush_write_buffer(struct dentry * dentr
> struct attribute * attr = to_attr(dentry);
> struct kobject * kobj = to_kobj(dentry->d_parent);
> struct sysfs_ops * ops = buffer->ops;
> + char *x;
>
> - return ops->store(kobj,attr,buffer->page,count);
> + /* locate trailing white space */
> + while ((count > 0) && isspace(buffer->page[count - 1]))
> + count--;
> +
> + /* locate leading white space */
> + x = buffer->page;
> + if (count > 0) {
> + while (isspace(*x))
> + x++;
> + count -= (x - buffer->page);
> + }
> + /* terminate the string */
> + x[count] = '\0';
Should we add a check for a NULL string here? It seems not all
drivers were prepared to handle a zero length store().
If (count == 0)
return 0;
> +
> + return ops->store(kobj, attr, x, count);
> }
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 19:57 ` Jon Smirl
2005-07-28 20:22 ` Mitchell Blank Jr
@ 2005-07-28 21:10 ` Oliver Neukum
2005-07-28 21:12 ` Jon Smirl
1 sibling, 1 reply; 70+ messages in thread
From: Oliver Neukum @ 2005-07-28 21:10 UTC (permalink / raw)
To: Jon Smirl; +Cc: Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl:
> New, simplified version of the sysfs whitespace strip patch...
Could you tell me why you don't just fail the operation if malformed
input is supplied?
Regards
Oliver
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 21:10 ` Oliver Neukum
@ 2005-07-28 21:12 ` Jon Smirl
2002-01-01 7:53 ` Pavel Machek
2005-07-28 21:17 ` Oliver Neukum
0 siblings, 2 replies; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 21:12 UTC (permalink / raw)
To: Oliver Neukum; +Cc: Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
On 7/28/05, Oliver Neukum <oliver@neukum.org> wrote:
> Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl:
> > New, simplified version of the sysfs whitespace strip patch...
>
> Could you tell me why you don't just fail the operation if malformed
> input is supplied?
Leading/trailing white space should be allowed. For example echo
appends '\n' unless you know to use -n. It is easier to fix the kernel
than to teach everyone to use -n.
>
> Regards
> Oliver
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 21:12 ` Jon Smirl
@ 2002-01-01 7:53 ` Pavel Machek
2005-08-05 13:32 ` Jon Smirl
2005-08-05 22:31 ` David Weinehall
2005-07-28 21:17 ` Oliver Neukum
1 sibling, 2 replies; 70+ messages in thread
From: Pavel Machek @ 2002-01-01 7:53 UTC (permalink / raw)
To: Jon Smirl
Cc: Oliver Neukum, Greg KH, Mitchell Blank Jr, dtor_core,
linux-kernel
Hi!
> > > New, simplified version of the sysfs whitespace strip patch...
> >
> > Could you tell me why you don't just fail the operation if malformed
> > input is supplied?
>
> Leading/trailing white space should be allowed. For example echo
> appends '\n' unless you know to use -n. It is easier to fix the kernel
> than to teach everyone to use -n.
Please, NO! echo -n is the right thing to do, and users will eventually learn.
We are not going to add such workarounds all over the kernel...
Pavel
--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2002-01-01 7:53 ` Pavel Machek
@ 2005-08-05 13:32 ` Jon Smirl
2005-08-05 18:01 ` Oliver Neukum
2005-08-07 18:47 ` Pavel Machek
2005-08-05 22:31 ` David Weinehall
1 sibling, 2 replies; 70+ messages in thread
From: Jon Smirl @ 2005-08-05 13:32 UTC (permalink / raw)
To: Pavel Machek
Cc: Oliver Neukum, Greg KH, Mitchell Blank Jr, dtor_core,
linux-kernel
On 1/1/02, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > > > New, simplified version of the sysfs whitespace strip patch...
> > >
> > > Could you tell me why you don't just fail the operation if malformed
> > > input is supplied?
> >
> > Leading/trailing white space should be allowed. For example echo
> > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > than to teach everyone to use -n.
>
> Please, NO! echo -n is the right thing to do, and users will eventually learn.
> We are not going to add such workarounds all over the kernel...
It is not a work around. These are text attributes meant for human
use. Humans have a hard time cleaning up things they can't see. And
the failure mode for this is awful, your attribute won't set but
everything on the screen looks fine.
echo is not the only source of problems. I had some trailing
whitespace in a shell script and it took me a couple of hours to
discover why the attribute set was failing. I finally had to add debug
code to the kernel and reboot to located the problem. Normal users are
never going to figure this out.
Binary attributes are for program use, they should not get cleaned up.
If you dont want the whitespace cleaning switch to a binary one.
> Pavel
> --
> 64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
>
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 13:32 ` Jon Smirl
@ 2005-08-05 18:01 ` Oliver Neukum
2005-08-05 18:14 ` Jon Smirl
2005-08-07 18:47 ` Pavel Machek
1 sibling, 1 reply; 70+ messages in thread
From: Oliver Neukum @ 2005-08-05 18:01 UTC (permalink / raw)
To: Jon Smirl
Cc: Pavel Machek, Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl:
> On 1/1/02, Pavel Machek <pavel@ucw.cz> wrote:
> > Hi!
> >
> > > > > New, simplified version of the sysfs whitespace strip patch...
> > > >
> > > > Could you tell me why you don't just fail the operation if malformed
> > > > input is supplied?
> > >
> > > Leading/trailing white space should be allowed. For example echo
> > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > than to teach everyone to use -n.
> >
> > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > We are not going to add such workarounds all over the kernel...
>
> It is not a work around. These are text attributes meant for human
> use. Humans have a hard time cleaning up things they can't see. And
> the failure mode for this is awful, your attribute won't set but
> everything on the screen looks fine.
The average user has no place poking sysfs. Root should know when
to use -n, as should shell scripts.
Regards
Oliver
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 18:01 ` Oliver Neukum
@ 2005-08-05 18:14 ` Jon Smirl
2005-08-05 18:20 ` Oliver Neukum
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-08-05 18:14 UTC (permalink / raw)
To: Oliver Neukum
Cc: Pavel Machek, Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl:
> > On 1/1/02, Pavel Machek <pavel@ucw.cz> wrote:
> > > Hi!
> > >
> > > > > > New, simplified version of the sysfs whitespace strip patch...
> > > > >
> > > > > Could you tell me why you don't just fail the operation if malformed
> > > > > input is supplied?
> > > >
> > > > Leading/trailing white space should be allowed. For example echo
> > > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > > than to teach everyone to use -n.
> > >
> > > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > > We are not going to add such workarounds all over the kernel...
> >
> > It is not a work around. These are text attributes meant for human
> > use. Humans have a hard time cleaning up things they can't see. And
> > the failure mode for this is awful, your attribute won't set but
> > everything on the screen looks fine.
>
> The average user has no place poking sysfs. Root should know when
> to use -n, as should shell scripts.
So the average user never needs to change their console mode? Check
out /sys/class/graphics/fb/modes and mode.
>
> Regards
> Oliver
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 18:14 ` Jon Smirl
@ 2005-08-05 18:20 ` Oliver Neukum
2005-08-05 18:47 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Oliver Neukum @ 2005-08-05 18:20 UTC (permalink / raw)
To: Jon Smirl
Cc: Pavel Machek, Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl:
> On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl:
> > > On 1/1/02, Pavel Machek <pavel@ucw.cz> wrote:
> > > > Hi!
> > > >
> > > > > > > New, simplified version of the sysfs whitespace strip patch...
> > > > > >
> > > > > > Could you tell me why you don't just fail the operation if malformed
> > > > > > input is supplied?
> > > > >
> > > > > Leading/trailing white space should be allowed. For example echo
> > > > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > > > than to teach everyone to use -n.
> > > >
> > > > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > > > We are not going to add such workarounds all over the kernel...
> > >
> > > It is not a work around. These are text attributes meant for human
> > > use. Humans have a hard time cleaning up things they can't see. And
> > > the failure mode for this is awful, your attribute won't set but
> > > everything on the screen looks fine.
> >
> > The average user has no place poking sysfs. Root should know when
> > to use -n, as should shell scripts.
>
> So the average user never needs to change their console mode? Check
> out /sys/class/graphics/fb/modes and mode.
That is what we have helper scripts for.
Regards
Oliver
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 18:20 ` Oliver Neukum
@ 2005-08-05 18:47 ` Jon Smirl
2005-08-05 20:07 ` Oliver Neukum
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-08-05 18:47 UTC (permalink / raw)
To: Oliver Neukum
Cc: Pavel Machek, Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl:
> > On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> > > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl:
> > > > On 1/1/02, Pavel Machek <pavel@ucw.cz> wrote:
> > > > > Hi!
> > > > >
> > > > > > > > New, simplified version of the sysfs whitespace strip patch...
> > > > > > >
> > > > > > > Could you tell me why you don't just fail the operation if malformed
> > > > > > > input is supplied?
> > > > > >
> > > > > > Leading/trailing white space should be allowed. For example echo
> > > > > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > > > > than to teach everyone to use -n.
> > > > >
> > > > > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > > > > We are not going to add such workarounds all over the kernel...
> > > >
> > > > It is not a work around. These are text attributes meant for human
> > > > use. Humans have a hard time cleaning up things they can't see. And
> > > > the failure mode for this is awful, your attribute won't set but
> > > > everything on the screen looks fine.
> > >
> > > The average user has no place poking sysfs. Root should know when
> > > to use -n, as should shell scripts.
> >
> > So the average user never needs to change their console mode? Check
> > out /sys/class/graphics/fb/modes and mode.
>
> That is what we have helper scripts for.
If we are going back to needing helper scripts then I should just
remove the entire sysfs graphics interface and switch back to using
ioctls and a helper app. Of could no one can ever find the helper app
or remember how it works. I thought one of the main reasons behind the
sysfs interface was to eliminate these helper apps.
Without doing whitespace cleanup there is a 100% probability that this
will generate bug reports. I know this for a fact because I am already
getting them.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 18:47 ` Jon Smirl
@ 2005-08-05 20:07 ` Oliver Neukum
2005-08-05 20:33 ` Jon Smirl
0 siblings, 1 reply; 70+ messages in thread
From: Oliver Neukum @ 2005-08-05 20:07 UTC (permalink / raw)
To: Jon Smirl
Cc: Pavel Machek, Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
Am Freitag, 5. August 2005 20:47 schrieb Jon Smirl:
> On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> > Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl:
> > > On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> > > > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl:
> > > > > On 1/1/02, Pavel Machek <pavel@ucw.cz> wrote:
> > > > > > Hi!
> > > > > >
> > > > > > > > > New, simplified version of the sysfs whitespace strip patch...
> > > > > > > >
> > > > > > > > Could you tell me why you don't just fail the operation if malformed
> > > > > > > > input is supplied?
> > > > > > >
> > > > > > > Leading/trailing white space should be allowed. For example echo
> > > > > > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > > > > > than to teach everyone to use -n.
> > > > > >
> > > > > > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > > > > > We are not going to add such workarounds all over the kernel...
> > > > >
> > > > > It is not a work around. These are text attributes meant for human
> > > > > use. Humans have a hard time cleaning up things they can't see. And
> > > > > the failure mode for this is awful, your attribute won't set but
> > > > > everything on the screen looks fine.
> > > >
> > > > The average user has no place poking sysfs. Root should know when
> > > > to use -n, as should shell scripts.
> > >
> > > So the average user never needs to change their console mode? Check
> > > out /sys/class/graphics/fb/modes and mode.
> >
> > That is what we have helper scripts for.
>
> If we are going back to needing helper scripts then I should just
> remove the entire sysfs graphics interface and switch back to using
> ioctls and a helper app. Of could no one can ever find the helper app
> or remember how it works. I thought one of the main reasons behind the
> sysfs interface was to eliminate these helper apps.
The point is that you _can_ do it with echo, not that it is _easy_.
Nor is sysfs a solution in any case.
> Without doing whitespace cleanup there is a 100% probability that this
> will generate bug reports. I know this for a fact because I am already
> getting them.
Stupid users are not a reason for kernel bloat.
Regards
Oliver
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 20:07 ` Oliver Neukum
@ 2005-08-05 20:33 ` Jon Smirl
2005-08-06 9:39 ` Oliver Neukum
2005-08-07 18:50 ` Pavel Machek
0 siblings, 2 replies; 70+ messages in thread
From: Jon Smirl @ 2005-08-05 20:33 UTC (permalink / raw)
To: Oliver Neukum
Cc: Pavel Machek, Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> Am Freitag, 5. August 2005 20:47 schrieb Jon Smirl:
> > On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> > > Am Freitag, 5. August 2005 20:14 schrieb Jon Smirl:
> > > > On 8/5/05, Oliver Neukum <oliver@neukum.org> wrote:
> > > > > Am Freitag, 5. August 2005 15:32 schrieb Jon Smirl:
> > > > > > On 1/1/02, Pavel Machek <pavel@ucw.cz> wrote:
> > > > > > > Hi!
> > > > > > >
> > > > > > > > > > New, simplified version of the sysfs whitespace strip patch...
> > > > > > > > >
> > > > > > > > > Could you tell me why you don't just fail the operation if malformed
> > > > > > > > > input is supplied?
> > > > > > > >
> > > > > > > > Leading/trailing white space should be allowed. For example echo
> > > > > > > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > > > > > > than to teach everyone to use -n.
> > > > > > >
> > > > > > > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > > > > > > We are not going to add such workarounds all over the kernel...
> > > > > >
> > > > > > It is not a work around. These are text attributes meant for human
> > > > > > use. Humans have a hard time cleaning up things they can't see. And
> > > > > > the failure mode for this is awful, your attribute won't set but
> > > > > > everything on the screen looks fine.
> > > > >
> > > > > The average user has no place poking sysfs. Root should know when
> > > > > to use -n, as should shell scripts.
> > > >
> > > > So the average user never needs to change their console mode? Check
> > > > out /sys/class/graphics/fb/modes and mode.
> > >
> > > That is what we have helper scripts for.
> >
> > If we are going back to needing helper scripts then I should just
> > remove the entire sysfs graphics interface and switch back to using
> > ioctls and a helper app. Of could no one can ever find the helper app
> > or remember how it works. I thought one of the main reasons behind the
> > sysfs interface was to eliminate these helper apps.
>
> The point is that you _can_ do it with echo, not that it is _easy_.
> Nor is sysfs a solution in any case.
>
> > Without doing whitespace cleanup there is a 100% probability that this
> > will generate bug reports. I know this for a fact because I am already
> > getting them.
>
> Stupid users are not a reason for kernel bloat.
You have a very wrapped sense of kernel bloat. This is nine lines of
code whose absence is guaranteed to generate a bunch of bug reports.
Not having it is also causing various implementers to implement
attribute processing differently. Some are stripping white space in
their implementations and some are not. If you want to attack kernel
bloat there are much more productive areas.
If whitespace cleanup is rejected I believe we should eliminate text
based sysfs attributes in general and make them all binary. I'll
probably remove the fbdev sysfs interface because I don't want to deal
with the bug reports reporting the same problem over and over.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 20:33 ` Jon Smirl
@ 2005-08-06 9:39 ` Oliver Neukum
2005-08-07 18:50 ` Pavel Machek
1 sibling, 0 replies; 70+ messages in thread
From: Oliver Neukum @ 2005-08-06 9:39 UTC (permalink / raw)
To: Jon Smirl
Cc: Pavel Machek, Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
> > Stupid users are not a reason for kernel bloat.
>
> You have a very wrapped sense of kernel bloat. This is nine lines of
> code whose absence is guaranteed to generate a bunch of bug reports.
They are supposed to be present, but not in the kernel.
> Not having it is also causing various implementers to implement
> attribute processing differently. Some are stripping white space in
> their implementations and some are not. If you want to attack kernel
> bloat there are much more productive areas.
If somebody is stripping whitespace in the kernel, find and destroy.
> If whitespace cleanup is rejected I believe we should eliminate text
> based sysfs attributes in general and make them all binary. I'll
> probably remove the fbdev sysfs interface because I don't want to deal
> with the bug reports reporting the same problem over and over.
You are seeing this wrong. The problem is not binary vs. text.
If binary were the problem we'd have a generic ioctl tool that takes
arguments in any number format you'd want. The problem is untyped
data. ASCII-strings without leading or trailing whitespece is a clearly
defined datatype. Requiring a tool ensuring this format is met or care
is used if other tools are used is perfectly in order. The kernel does
not guess what an input is supposed to mean. Anything else is bloat.
Regards
Oliver
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 20:33 ` Jon Smirl
2005-08-06 9:39 ` Oliver Neukum
@ 2005-08-07 18:50 ` Pavel Machek
1 sibling, 0 replies; 70+ messages in thread
From: Pavel Machek @ 2005-08-07 18:50 UTC (permalink / raw)
To: Jon Smirl
Cc: Oliver Neukum, Pavel Machek, Greg KH, Mitchell Blank Jr,
dtor_core, linux-kernel
Hi!
> > > If we are going back to needing helper scripts then I should just
> > > remove the entire sysfs graphics interface and switch back to using
> > > ioctls and a helper app. Of could no one can ever find the helper app
> > > or remember how it works. I thought one of the main reasons behind the
> > > sysfs interface was to eliminate these helper apps.
> >
> > The point is that you _can_ do it with echo, not that it is _easy_.
> > Nor is sysfs a solution in any case.
> >
> > > Without doing whitespace cleanup there is a 100% probability that this
> > > will generate bug reports. I know this for a fact because I am already
> > > getting them.
> >
> > Stupid users are not a reason for kernel bloat.
>
> You have a very wrapped sense of kernel bloat. This is nine lines of
> code whose absence is guaranteed to generate a bunch of bug reports.
> Not having it is also causing various implementers to implement
> attribute processing differently. Some are stripping white space in
> their implementations and some are not. If you want to attack kernel
Can you point place where we do strip whitespace in kernel sysfs handlers?
Pavel
--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-05 13:32 ` Jon Smirl
2005-08-05 18:01 ` Oliver Neukum
@ 2005-08-07 18:47 ` Pavel Machek
2005-08-07 20:17 ` Jon Smirl
1 sibling, 1 reply; 70+ messages in thread
From: Pavel Machek @ 2005-08-07 18:47 UTC (permalink / raw)
To: Jon Smirl
Cc: Pavel Machek, Oliver Neukum, Greg KH, Mitchell Blank Jr,
dtor_core, linux-kernel
Hi!
> > > > Could you tell me why you don't just fail the operation if malformed
> > > > input is supplied?
> > >
> > > Leading/trailing white space should be allowed. For example echo
> > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > than to teach everyone to use -n.
> >
> > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > We are not going to add such workarounds all over the kernel...
>
> It is not a work around. These are text attributes meant for human
> use. Humans have a hard time cleaning up things they can't see. And
> the failure mode for this is awful, your attribute won't set but
> everything on the screen looks fine.
Kernel is not a place to be user friendly. Or do you propose stripping whitespace
for open(), too? File called "foo.txt " certainly *is* going to be confusing, but it should be allowed at kernel level.
Now... echo foo > /sys/var does not properly report errors. Thats bad, but it needs to
be fixed in bash.
--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-07 18:47 ` Pavel Machek
@ 2005-08-07 20:17 ` Jon Smirl
2005-08-07 21:06 ` Pavel Machek
0 siblings, 1 reply; 70+ messages in thread
From: Jon Smirl @ 2005-08-07 20:17 UTC (permalink / raw)
To: Pavel Machek
Cc: Oliver Neukum, Greg KH, Mitchell Blank Jr, dtor_core,
linux-kernel
On 8/7/05, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
> > > > > Could you tell me why you don't just fail the operation if malformed
> > > > > input is supplied?
> > > >
> > > > Leading/trailing white space should be allowed. For example echo
> > > > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > > > than to teach everyone to use -n.
> > >
> > > Please, NO! echo -n is the right thing to do, and users will eventually learn.
> > > We are not going to add such workarounds all over the kernel...
> >
> > It is not a work around. These are text attributes meant for human
> > use. Humans have a hard time cleaning up things they can't see. And
> > the failure mode for this is awful, your attribute won't set but
> > everything on the screen looks fine.
>
> Kernel is not a place to be user friendly. Or do you propose stripping whitespace
> for open(), too? File called "foo.txt " certainly *is* going to be confusing, but it should be allowed at kernel level.
open is not made for human use, it is used by programs and only
indirectly by humans. sysfs variables are used by directly humans.
>
> Now... echo foo > /sys/var does not properly report errors. Thats bad, but it needs to
> be fixed in bash.
It is going to take a lot more code to return an error that a
parameter didn't match because of extra white space that it would take
to simply remove the whitespace.
> --
> 64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
>
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-08-07 20:17 ` Jon Smirl
@ 2005-08-07 21:06 ` Pavel Machek
0 siblings, 0 replies; 70+ messages in thread
From: Pavel Machek @ 2005-08-07 21:06 UTC (permalink / raw)
To: Jon Smirl
Cc: Oliver Neukum, Greg KH, Mitchell Blank Jr, dtor_core,
linux-kernel
Hi!
> > > It is not a work around. These are text attributes meant for human
> > > use. Humans have a hard time cleaning up things they can't see. And
> > > the failure mode for this is awful, your attribute won't set but
> > > everything on the screen looks fine.
> >
> > Kernel is not a place to be user friendly. Or do you propose stripping whitespace
> > for open(), too? File called "foo.txt " certainly *is* going to be confusing, but it should be allowed at kernel level.
>
> open is not made for human use, it is used by programs and only
> indirectly by humans. sysfs variables are used by directly humans.
Both are kernel interfaces; I can use open() by hand just fine...
> > Now... echo foo > /sys/var does not properly report errors. Thats bad, but it needs to
> > be fixed in bash.
>
> It is going to take a lot more code to return an error that a
> parameter didn't match because of extra white space that it would take
> to simply remove the whitespace.
I believe we do correctly report errors in write() calls already. Bash
not reporting them to the user is different problem.
Pavel
--
if you have sharp zaurus hardware you don't need... you know my address
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2002-01-01 7:53 ` Pavel Machek
2005-08-05 13:32 ` Jon Smirl
@ 2005-08-05 22:31 ` David Weinehall
1 sibling, 0 replies; 70+ messages in thread
From: David Weinehall @ 2005-08-05 22:31 UTC (permalink / raw)
To: Pavel Machek
Cc: Jon Smirl, Oliver Neukum, Greg KH, Mitchell Blank Jr, dtor_core,
linux-kernel
On Tue, Jan 01, 2002 at 08:53:39AM +0100, Pavel Machek wrote:
> Hi!
>
> > > > New, simplified version of the sysfs whitespace strip patch...
> > >
> > > Could you tell me why you don't just fail the operation if malformed
> > > input is supplied?
> >
> > Leading/trailing white space should be allowed. For example echo
> > appends '\n' unless you know to use -n. It is easier to fix the kernel
> > than to teach everyone to use -n.
>
> Please, NO! echo -n is the right thing to do, and users will eventually learn.
> We are not going to add such workarounds all over the kernel...
Ahhh, this would be so much easier if people just got used to using
printf instead of echo when doing text output. =)
Regards: David Weinehall
--
/) David Weinehall <tao@acc.umu.se> /) Northern lights wander (\
// Maintainer of the v2.0 kernel // Dance across the winter sky //
\) http://www.acc.umu.se/~tao/ (/ Full colour fire (/
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 21:12 ` Jon Smirl
2002-01-01 7:53 ` Pavel Machek
@ 2005-07-28 21:17 ` Oliver Neukum
1 sibling, 0 replies; 70+ messages in thread
From: Oliver Neukum @ 2005-07-28 21:17 UTC (permalink / raw)
To: Jon Smirl; +Cc: Greg KH, Mitchell Blank Jr, dtor_core, linux-kernel
Am Donnerstag, 28. Juli 2005 23:12 schrieb Jon Smirl:
> On 7/28/05, Oliver Neukum <oliver@neukum.org> wrote:
> > Am Donnerstag, 28. Juli 2005 21:57 schrieb Jon Smirl:
> > > New, simplified version of the sysfs whitespace strip patch...
> >
> > Could you tell me why you don't just fail the operation if malformed
> > input is supplied?
>
> Leading/trailing white space should be allowed. For example echo
> appends '\n' unless you know to use -n. It is easier to fix the kernel
> than to teach everyone to use -n.
Why? If you can do it in user space, do so.
Regards
Oliver
^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] driver core: Add the ability to unbind drivers to devices from userspace
2005-07-28 5:49 ` Greg KH
2005-07-28 7:04 ` Mitchell Blank Jr
@ 2005-07-28 12:52 ` Jon Smirl
1 sibling, 0 replies; 70+ messages in thread
From: Jon Smirl @ 2005-07-28 12:52 UTC (permalink / raw)
To: Greg KH; +Cc: dtor_core, linux-kernel
On 7/28/05, Greg KH <greg@kroah.com> wrote:
> On Thu, Jul 28, 2005 at 12:49:21AM -0400, Jon Smirl wrote:
> > @@ -207,6 +208,28 @@ flush_write_buffer(struct dentry * dentr
> > struct attribute * attr = to_attr(dentry);
> > struct kobject * kobj = to_kobj(dentry->d_parent);
> > struct sysfs_ops * ops = buffer->ops;
> > + char *x, *y, *z;
> > +
> > + /* locate leading white space */
> > + x = buffer->page;
> > + while (isspace(*x) && (x - buffer->page < count))
> > + x++;
>
> Ok, I can follow this. For example
> buffer->page = " foo "
>
> then x = "foo " at the end of that .
>
> > + /* locate trailng white space */
> > + z = y = x;
> > + while (y - buffer->page < count) {
> > + y++;
> > + z = y;
> > + while (isspace(*y) && (y - buffer->page < count)) {
> > + y++;
> > + }
> > + }
> > + count = z - x;
>
> Hm, I _think_ this works, but I need someone else to verify this...
> Anyone else?
>
>
> > +
> > + /* strip the white space */
> > + if (buffer->page != x)
> > + memmove(buffer->page, x, count);
> > + buffer->page[count] = '\0';
>
> Why move the buffer? Why not just pass in a pointer to the start of the
> "non-whitespace filled" buffer to the store() function?
That will work if you say it does. I didn't know what happens with
buffer->page in other parts of the code.
>
> thanks,
>
> greg k-h
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 70+ messages in thread
end of thread, other threads:[~2005-08-21 22:21 UTC | newest]
Thread overview: 70+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-24 5:12 [RFC] bind and unbind drivers from userspace through sysfs Greg KH
2005-06-24 5:14 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-24 5:15 ` [PATCH] driver core: Add the ability to bind " Greg KH
2005-06-24 15:57 ` [PATCH] driver core: Add the ability to unbind " Patrick Mochel
2005-06-25 3:27 ` Greg KH
2005-06-25 4:16 ` Dmitry Torokhov
2005-06-25 9:39 ` Michael Tokarev
2005-06-25 3:05 ` [RFC] bind and unbind drivers from userspace through sysfs Bill Nottingham
2005-06-25 3:26 ` Greg KH
2005-06-25 4:22 ` Dmitry Torokhov
2005-06-29 23:47 ` Greg KH
2005-06-30 6:13 ` Dmitry Torokhov
2005-06-30 16:01 ` Greg KH
2005-06-30 20:20 ` Dmitry Torokhov
2005-07-01 22:31 ` Greg KH
2005-07-02 4:25 ` Dmitry Torokhov
2005-07-02 4:51 ` Greg KH
2005-07-02 5:20 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2005-06-30 6:04 [PATCH] driver core: add bus_find_device & driver_find_device functions Greg KH
2005-06-30 6:04 ` [PATCH] driver core: Add the ability to unbind drivers to devices from userspace Greg KH
2005-06-30 6:25 ` Dmitry Torokhov
2005-06-30 6:29 ` Greg KH
2005-07-25 4:09 Jon Smirl
2005-07-25 4:58 ` Dmitry Torokhov
2005-07-25 14:28 ` Jon Smirl
2005-07-25 14:48 ` Dmitry Torokhov
2005-07-25 16:30 ` Jon Smirl
2005-07-26 0:00 ` Greg KH
2005-07-26 0:28 ` Jon Smirl
2005-07-26 0:30 ` Greg KH
2005-07-26 0:56 ` Jon Smirl
2005-07-26 1:54 ` Greg KH
2005-07-26 3:15 ` Jon Smirl
2005-07-26 3:29 ` Dmitry Torokhov
2005-07-28 2:05 ` Jon Smirl
2005-07-28 3:46 ` Greg KH
2005-07-28 3:59 ` Jon Smirl
2005-07-28 4:05 ` Greg KH
2005-07-28 4:49 ` Jon Smirl
2005-07-28 5:49 ` Greg KH
2005-07-28 7:04 ` Mitchell Blank Jr
2005-07-28 12:54 ` Jon Smirl
2005-07-28 13:09 ` Oliver Neukum
2005-07-28 13:16 ` Paulo Marques
2005-07-28 18:09 ` Mitchell Blank Jr
2005-07-28 19:03 ` Greg KH
2005-07-28 19:57 ` Jon Smirl
2005-07-28 20:22 ` Mitchell Blank Jr
2005-07-28 20:27 ` Jon Smirl
2005-07-29 18:50 ` Jon Smirl
2005-08-06 0:42 ` Greg KH
2005-08-06 3:48 ` Jon Smirl
2005-08-21 22:21 ` Jon Smirl
2005-07-28 21:10 ` Oliver Neukum
2005-07-28 21:12 ` Jon Smirl
2002-01-01 7:53 ` Pavel Machek
2005-08-05 13:32 ` Jon Smirl
2005-08-05 18:01 ` Oliver Neukum
2005-08-05 18:14 ` Jon Smirl
2005-08-05 18:20 ` Oliver Neukum
2005-08-05 18:47 ` Jon Smirl
2005-08-05 20:07 ` Oliver Neukum
2005-08-05 20:33 ` Jon Smirl
2005-08-06 9:39 ` Oliver Neukum
2005-08-07 18:50 ` Pavel Machek
2005-08-07 18:47 ` Pavel Machek
2005-08-07 20:17 ` Jon Smirl
2005-08-07 21:06 ` Pavel Machek
2005-08-05 22:31 ` David Weinehall
2005-07-28 21:17 ` Oliver Neukum
2005-07-28 12:52 ` Jon Smirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox