Re: dwc3: Power management for cable disconnect

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

 



Hi,

Wesley Cheng wrote:
> Hi linux-usb members!
>
> I was looking at seeing how the DWC3 drivers are handling the USB cable
> disconnect routine (VBUS low situation) when there is no UDC binded.  Is
> the below behavior expected?
>
> 1.  Enumerate device w/ host.
> 2.  Gadget is unbinded
> 	- echo "" > /sys/kernel/config/usb_gadget/g1/UDC
> 3.  Disconnect the USB cable (VBUS low)
> 4.  No dwc3_gadget_disconnect_interrupt() seen (since controller is
>    halted from step#1)

I think you mean after step#2?

> 5.  Runtime PM autosuspend fails due to "dwc->connected" being true
> (cleared in dwc3_gadget_disconnect_interrupt())

This is probably a mishap in the dwc3 driver. When the function driver
is unregistered, the pullup() callback will halt the controller. This is
a soft-disconnect, and dwc->connected should be false.

> 6.  Gadget binded
> 	- echo udc_name > /sys/kernel/config/usb_gadget/g1/UDC

After this step, the device will still remain disconnected.

> 7.  No runtime suspend until cable is plugged in and out

... until the reset and connection done interrupt telling the driver
that the device is now connected.

>
> This would be problematic for devices which have to reliably enter
> suspend.  I just wanted to see if this is a scenario which has been
> considered?  Seems odd that we would still keep the controller out of
> low power if there was no cable connected.
>

This should be a simple fix. Would you create a patch for this?

Thanks,
Thinh




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

  Powered by Linux