Re: Probe function question

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

 



On Tue, 2014-06-17 at 12:19 +0200, Vlad Ungureanu wrote:
> > On Tue, 2014-06-17 at 11:18 +0200, Vlad Ungureanu wrote:
> > > > 
> > 
> > > > If that is not your intention, then you need to be more specific in the match table.
> > > Yes, it matches the whole device so that is why every interface gets probed. I
> > > will change that.
> > 
> > That's problematic. You need to find out what happens if both interfaces
> > are used at the same time.
> 
> My device has 2 interfaces in normal mode and 2 interfaces in ADK mode.
> Interface 0 has just ep0 which is control endpoint. Interface 1 has 2 bulk EPs:
> IN, OUT. I should check the macro how to define them nicely in the device
> table.

No, don't do that.

First of all, you are conflating two issues.
Switching between normal and ADK mode should indeed be done in user
space. How is it done in fact?

Secondly the interfaces. Restricting the matching creates a problem
in cooperation with usbfs. At least if you both need them, like btusb
or the CDC drivers.

Suppose you need both interfaces. Then you need to claim both interfaces
in probe(). However interfaces can be claimed from user space also
and freed in arbitrary order.
Now, if you change your matching so that you match only on the first
interface, binding will fail if user spaces unclaims the first
interface before the second. That's because your probe needs to fail
as the second interface is still claimed by user space. You can solve
this issue by matching on both interfaces and claiming the corresponding
interface in probe()

	Regards
		Oliver


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