Re: [RFD driver-core] Lifetime problems of the current driver model

Dmitry Torokhov
2007-03-30T18:18:30Z

On 3/30/07, James Bottomley <James.Bottomley@steeleye.com> wrote:
> On Fri, 2007-03-30 at 09:15 -0400, Dmitry Torokhov wrote:
> > If you want to manage lifetime rules independently you might want to
> > not embed struct device into you subsystems objects but attach them
> > via pointers and use device_create(). Now that we orphan sysfs access
> > upon unregistering device this will severe all ties from driver core
> > to your system once you start teardown of a device and you should be
> > in clear.
>
> But that wouldn't really help ... all objects have lifetimes. What
> Tejun is pointing out is that we have two different lifetime
> requirements: driver internal (and subsystem) objects and sysfs
> objects ...

Exactly. If driver-private data structures have different lifetime
than device abstractions (like they seem to have with scsi and ide)
then you split them and refcount separately. We are just arguing where
to put the line. You want to split devices and kobjects and rework
infrastructure and I am saying that we already have infrastructure we
need and that split shoud be between generic device structure and
driver-managed device structure.

--
Dmitry