exporting CARD_INFO_GET to user space

Roman Kagan rkagan at mail.ru
Sun Feb 27 10:48:57 EST 2005

On Sat, Feb 26, 2005 at 11:29:16PM +0100, Marco d'Itri wrote:
> On Feb 26, Roman Kagan <rkagan at mail.ru> wrote:
> > Besides, sysfs imposes certain lifetime management constraints.  For
> > usbatm subdrivers, cxacru in particular, lifetime is controlled by the
> > usbatm core.  Thus having per subdriver sysfs data will need extra
> > interactions with the usbatm core; maintaining the stats in the core
> > itself will make it much easier.
> Why? The patch which I have sent to the list is trivial, it would be
> hard to do something simpler

Right...  Except that it is not quite correct (sorry I should have
commented it earlier).  If you do

(sleep 60; cat) < /sys/your/sysfs/file &

and unplug the modem you can expect an OOPS because when read() is
performed the instance data would have been deallocated.  If you unload
the module instead, not only the instance data but the code to fill in
this file would've been removed from the kernel.

For that reason any driver which wants to put something into sysfs needs
to coordinate its lifetime with the sysfs core.  Since usbatm
subdriver's lifetime is controlled by the usbatm core, subdrivers which
maintain their own sysfs stuff will need additional interactions with


More information about the Usbatm mailing list