Re: refcounting drivers' data structures used in sysfs buffers

Oliver Neukum
2007-03-09T20:39:46Z

Am Freitag, 9. März 2007 21:27 schrieb Alan Stern:
> On Fri, 9 Mar 2007, Oliver Neukum wrote:
>
> > > Adding a new release() callback would solve the problem by creating
> > > another. Drivers need to release their data as soon as possible after
> > > they unbind from a device, not when the device itself goes away. Think
> >
> > Wait, the callback from closing the file in sysfs is the earliest we can safely
> > free the data structure. How do you want to free earlier?
>
> It is _not_ the earliest we can safely free the data structure.
>
> Dmitry's callback occurs when _all_ the sysfs attributes have been
> released -- including ones that don't have anything to do with the
> driver's private data structure. Think of the bInterfaceClass attribute,
> for example.

Ok, yes I see. It is by far too late.

Regards
Oliver