Re: Should usb_gadget_disconnect() call driver's ->disconnect?

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

 



Hi,

Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes:
> Felipe:
>
> The documentation doesn't state whether a gadget driver's 
> ->disconnect() callback will be invoked when usb_gadget_disconnect() 
> runs.  Probably the UDC drivers' behavior has changed over the years.
>
> In any case, it's likely that various UDC drivers do behave
> differently.  My current feeling is that ->disconnect() should be
> invoked only when Vbus turns off, but I can't guarantee that all UDCs 
> will do this.

my feeling is that ->disconnect() should be called everytime we cause
the session to be killed. VBUS Turning off is a guaratee that session is
gone, but so is disconnecting data pullup, which is what
usb_gadget_disconnect() does.

> How do you feel about documenting this ambiguity as in the patch below?
> If you think this is okay, I'll submit it formally.

Perhaps a better approach would be to start auditing all UDCs to make
sure that ->disconnect() is called when pullup is disconnected. Then we
can move ->disconnect() to usb_gadget_disconnect() itself. No?

-- 
balbi

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux