mbox series

[0/2] Allow dwc3 runtime suspend during bus suspend event

Message ID 1683827311-1462-1-git-send-email-quic_eserrao@quicinc.com
Headers show
Series Allow dwc3 runtime suspend during bus suspend event | expand

Message

Elson Roy Serrao May 11, 2023, 5:48 p.m. UTC
When a USB link is idle, the host sends a bus suspend event to the device
so that the device can save power. But true power savings during bus
suspend can be seen only if we let the USB controller enter low power
mode and turn off the clocks. Vendor drivers may have their own runtime
power management framework to power up/down the controller. But since
vendor drivers' runtime suspend/resume routines depend on the dwc3 child
node we would need a framework to trigger dwc3 runtime pm ops whenever a
bus suspend is received. If the device wants to exit from bus suspend
state it can send a wakeup signal to the host by first bringing out the
controller from low power mode. This series implements the needed
framework to achieve this functionality when a bus suspend interupt is
received.

The series is organized in below fashion:
Patch 1: This includes the modification needed from function drivers to let
UDC enter low power mode. 
Patch 2: This has the modification needed in the UDC driver to trigger runtime
suspend whene a bus suspend interrupt is received. This also handles resume
and remote wakeup features from power management perspective.

Elson Roy Serrao (2):
  usb: function: u_ether: Handle rx requests during suspend/resume
  usb: dwc3: Modify runtime pm ops to handle bus suspend

 drivers/usb/dwc3/core.c               | 19 ++++++++++++++
 drivers/usb/dwc3/gadget.c             | 40 +++++++++++++++++++++++------
 drivers/usb/gadget/function/u_ether.c | 47 +++++++++++++++++++++++++++--------
 3 files changed, 89 insertions(+), 17 deletions(-)