Re: [RFT/C 2.5.70] Input class hook up to driver model/sysfs

viro@parcelfarce.linux.theplanet.co.uk
Fri, 6 Jun 2003 00:41:50 +0100


On Thu, Jun 05, 2003 at 03:56:42PM -0700, Andrew Morton wrote:

> Al Viro has asked that sysfs conversions such as this be placed on hold
> until we sort through the newly-added bugs arising from the sysfsification
> of netdevs and request queues.
>
> So yeah, do the work, but please make sure that you understand what went
> wrong with netdevs and queues, and make sure that the input sysfsification
> addresses those problems. Preferably in the same way...

It doesn't - note the absense of ->release() in the introduced objects,
lack of refcount in current ones and chunks like
+ class_device_unregister(&dev->class_dev);
+ kfree(dev);
in the patch. The last one is obvious breakage, no matter what else is
going on - if ->class_dev is registered, it could be held by opened
sysfs file and we are doing kfree() of a busy object. If it is not,
unregister will be unhappy _and_ we still might have it held by opened
sysfs file since the time when it used to be registered.

IOW, before something like that we'd need to make lifetime rules
for evdev et.al. refcounting-based, make drivers/input/* OK with
zombies ("I want it gone, but sysfs holds it") and when that is
done - have freeing done from ->release() of kobject.

Note that things like evdev->open are _not_ immediately usable for
refcounts - the lifetime is controlled by combination of ->exist
and ->open and we do non-trivial work when current ->open hits
zero, so just adding offset to ->open won't do.
-
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/