Re: regarding usb reset of an interface while probe is happening

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 18, 2011 at 8:46 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 18 Nov 2011, Amit Nagal wrote:
>
>> Hi ,
>>
>> If an USB interface is currently being probed ( usb driver probe
>> routine is executing  ),
>> and another driver or userspace program triggers a usb reset on the
>> device containing this interface ,
>> during this time :
>>
>> 1) how a usb interface driver can handle such  usb reset requests
>> while currently being probed  ?
>
> It can't.  It will get messed up.
>
>> 2)  will linux usb subsystem execute probe routine completely first
>> and then then do usb reset the device ?
>
> That depends.  If the reset is triggered directly by another driver
> then it will occur during the probe.  But if it is triggered by a user
> program then it will wait for the probe to finish.
>
> However...  If the other driver is written correctly, it will always
> call usb_lock_device_for_reset() before issuing the reset.  That
> routine will wait for the probe to finish before returning.  Therefore
> the probe won't get messed up.
>
> You should read the kerneldoc for usb_reset_and_verify_device() and
> usb_lock_device_for_reset().
>
>> 3) if a usb interface is already claimed , why is  usb reset of this
>> interface  allowed by another driver  or userspace program .
>
> There is no such thing as a USB reset of an interface, there is only a
> USB reset of an entire device.  Another driver might own one of the
> other interfaces on the same device and might need to reset it.
>
> Alan Stern
>
>

Thank you for sharing very useful insights .
Actually in my embedded target , usb audio modules after probe is
finished , gets unbind .
when i investigated , the reason is usb reset .
i am  debugging now to know whether  this usb reset has come from
userspace or from some other driver .


Thanks and Regards
Amit Nagal
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux