Re: some question about unbind and rebind usb interfaces

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

 



On Sun, 24 Aug 2014, vichy wrote:

> hi all:
> below patch introduce unbind and rebind interfaces during usb reset
> https://lists.ubuntu.com/archives/kernel-team/2014-April/042177.html
> "If a driver claims additional interfaces, the
> claim may fail because the old binding instance may still own the
> additional interface when the new instance tries to claim it. "
> 
> After usb_reset_device, the whole enumeration will run again,

No, only part of the enumeration.  The kernel does read the device and
config descriptors again.  But if the reset succeeded, the kernel
doesn't carry out any of the other parts of enumeration.

> why this
> patch say the previous solution will be fail to claim additional
> interface?

Suppose a driver claims interfaces 0 and 1, and then they have to be 
unbound and rebound.  The old code would unbind interface 0, then 
rebind it, then unbind interface 1, and then rebind it.

Suppose the driver's probe routine for interface 0 tries to claim 
interface 1?  The probe routine runs when interface 0 is rebound.  At 
that time interface 1 hasn't been unbound yet.  Since interface 1 is 
still owned, the driver will not be able to claim it.

On the other hand, the new code will unbind interface 0, then unbind 
interface 1, then rebind interface 0, and then rebind interface 1.  Now 
if the driver's probe routine for interface 0 tries to claim interface 
1, the claim will succeed because interface has already been unbound.

Alan Stern

--
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