* [BUG] cdc-acm driver module
@ 2008-05-21 13:01 vijay anand
2008-05-21 13:25 ` Oliver Neukum
0 siblings, 1 reply; 5+ messages in thread
From: vijay anand @ 2008-05-21 13:01 UTC (permalink / raw)
To: linux-kernel, dave
Hi All,
This is vijay and new to this group. Normally I use to go through the
Linux kernel source and try to understand how things work.
Last week I was going through the cdc-acm driver source(linux-2.6.25).
I think there is a bug with that driver and I am not sure about it. So
I decided to post you guys and get your views on that.
The interface is claimed in 'acm_probe' using 'usb_driver_claim_interface' and
it has been released in 'acm_disconnect' using 'usb_driver_release_interface'.
This works fine as long as the control reaches 'acm_disconnect'.
What happens when the control never reaches the 'acm_disconnect'. Like simply
loading the driver and unloading the driver when the device is still in use.
In this case I hope the 'usb_driver_release_interface' never gets called.
Is it a bug? Do we have to do a 'usb_driver_release_interface' in 'acm_exit'.
Please clarify.
Thanks,
VJ
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUG] cdc-acm driver module
2008-05-21 13:01 [BUG] cdc-acm driver module vijay anand
@ 2008-05-21 13:25 ` Oliver Neukum
2008-05-22 4:59 ` vijay anand
0 siblings, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2008-05-21 13:25 UTC (permalink / raw)
To: vijay anand; +Cc: linux-kernel, dave
Am Mittwoch 21 Mai 2008 15:01:21 schrieb vijay anand:
> What happens when the control never reaches the 'acm_disconnect'. Like simply
> loading the driver and unloading the driver when the device is still in use.
Even in this case disconnect() will be called.
The only time it will not be called is if probe() was never called. But
in that case no interface has been claimed. All is well.
Regards
Oliver
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUG] cdc-acm driver module
2008-05-21 13:25 ` Oliver Neukum
@ 2008-05-22 4:59 ` vijay anand
2008-05-22 11:21 ` Oliver Neukum
0 siblings, 1 reply; 5+ messages in thread
From: vijay anand @ 2008-05-22 4:59 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-kernel
Hi Oliver,
Thank you very much for replying.
Given below is the snip from '\linux-2.6.25\drivers\usb\core\driver.c'
for 'usb_driver_release_interface'
****SNIP*****
* This can be used by drivers to release an interface without waiting
* for their disconnect() methods to be called. In typical cases this
* also causes the driver disconnect() method to be called.
****END*****
What happens when the function 'usb_deregister' in 'acm_exit' gets
called before the control reaches the 'acm_disconnect'? Is there any
possibility for this? If yes what happens during this scenario?
Thanks,
VJ
On Wed, May 21, 2008 at 6:55 PM, Oliver Neukum <oliver@neukum.org> wrote:
> Am Mittwoch 21 Mai 2008 15:01:21 schrieb vijay anand:
>> What happens when the control never reaches the 'acm_disconnect'. Like simply
>> loading the driver and unloading the driver when the device is still in use.
>
> Even in this case disconnect() will be called.
> The only time it will not be called is if probe() was never called. But
> in that case no interface has been claimed. All is well.
>
> Regards
> Oliver
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUG] cdc-acm driver module
2008-05-22 4:59 ` vijay anand
@ 2008-05-22 11:21 ` Oliver Neukum
2008-05-22 13:24 ` vijay anand
0 siblings, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2008-05-22 11:21 UTC (permalink / raw)
To: vijay anand; +Cc: linux-kernel
Am Donnerstag 22 Mai 2008 06:59:50 schrieb vijay anand:
> What happens when the function 'usb_deregister' in 'acm_exit' gets
> called before the control reaches the 'acm_disconnect'? Is there any
> possibility for this? If yes what happens during this scenario?
This cannot happen. The driver core will disconnect all devices bound
to a driver to be unloaded.
Regards
Oliver
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [BUG] cdc-acm driver module
2008-05-22 11:21 ` Oliver Neukum
@ 2008-05-22 13:24 ` vijay anand
0 siblings, 0 replies; 5+ messages in thread
From: vijay anand @ 2008-05-22 13:24 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-kernel
Thank you very much !!
On Thu, May 22, 2008 at 4:51 PM, Oliver Neukum <oliver@neukum.org> wrote:
> Am Donnerstag 22 Mai 2008 06:59:50 schrieb vijay anand:
>> What happens when the function 'usb_deregister' in 'acm_exit' gets
>> called before the control reaches the 'acm_disconnect'? Is there any
>> possibility for this? If yes what happens during this scenario?
>
> This cannot happen. The driver core will disconnect all devices bound
> to a driver to be unloaded.
>
> Regards
> Oliver
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-22 13:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-21 13:01 [BUG] cdc-acm driver module vijay anand
2008-05-21 13:25 ` Oliver Neukum
2008-05-22 4:59 ` vijay anand
2008-05-22 11:21 ` Oliver Neukum
2008-05-22 13:24 ` vijay anand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®