usbatm : modprobe & rmmod

matthieu castet castet.matthieu at free.fr
Sun Jan 23 17:22:54 EST 2005


Hi,

Roman Kagan wrote:
>   Hi Duncan,
> 
> On Sat, 2005-01-22 at 16:19 +0100, Duncan Sands wrote:
> 
>>>It looks like there's a bug in usb_atm.c reference counting:
>>>udsl_destroy_instance kfrees udsl_instance_data, while the latter is
>>>is a member of {speedtch,cxacru,...}_instance_data and not kmalloced
>>>separately.  I'll try to come up with a proper fix tomorrow (I'll have
>>>to check if simply removing kfree in udsl_destroy_instance is enough).
> 
>                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> What a bullshit I can write when I'm falling asleep.  Strangely enough
> another message I wrote this morning with a better wording didn't get to
> the list.
> 
> 
>>For what it's worth, this is fixed (I think) in the new driver organisation
>>I'm playing with.
> 
> 
> I can't tell since the code to store the minidriver instance data hasn't
> hit CVS yet.  You'll probably need a release function for the
> minidrivers whose instance data can't be destroyed synchronously though,
> and call it in udsl_destroy_instance.
> 
> Meanwhile, if you don't mind, I'll keep trying with the split up
> usb_atm.  In particular, I'm going to change the interface so that
> 
> 1) modem driver instance owns a pointer to udsl_instance, rather than
> the struct itself.  It's allocated in udsl_instance_setup, and freed in
> udsl_instance_disconnect.
> 
> 2) udsl_instance_{setup,disconnect} calls usb_{get,put}_dev (already
> there) so that usb_atm can continue after driver instance is destroyed.
> In future it'll also need to call usb_{get,put}_interface to support the
> drivers like eagle-usb, which AFAICS uses different interfaces to send
> and to receive data.
> 
> 3) usb_atm refcount counts atm references only, and
> udsl_{get,put}_instance become internal to usb_atm.  The drivers do
> their own bookkeeping, if needed.
> 
Why not in actual usb_atm :
udsl_instance_setup has a structure as a parameter, this struct contain 
all the parameters the user of the library can touch (usb_dev, endpoint,...)
udsl_instance_setup kmalloc udsl_instance_data and fill it with the 
parameters.Then it return a pointer to the udsl_instance_data.

udsl_instance_disconnect isn't changed.

Matthieu




More information about the Usbatm mailing list