public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Support dwc3 runtime suspend during bus suspend
@ 2023-07-11 17:43 Elson Roy Serrao
  2023-07-11 17:43 ` [PATCH v3 1/3] usb: function: u_ether: Handle rx requests during suspend/resume Elson Roy Serrao
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Elson Roy Serrao @ 2023-07-11 17:43 UTC (permalink / raw)
  To: Thinh.Nguyen, stern
  Cc: gregkh, rogerq, linux-kernel, linux-usb, quic_wcheng, quic_jackp,
	Elson Roy Serrao

Changes in v3
 - Added a dt property 'snps,allow-rtsusp-on-u3' to make this feature platform
   dependent as per the feedback from Thinh N.
 - Changed the RT idle/suspend/resume handling to device mode specific and dt
   property dependent.
 - Modified the cover letter to document how resume is handled on qcom platforms.
 
Changes in v2
 - Used pm_runtime_resume_and_get() API instead of pm_runtime_get_sync()
   as suggested by Dan.
 - Handled the return value in ether_wakeup_host to print error message.

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 assumption here is that the dwc3 hibernation feature is not
enabled and the platform is responsible in detecting the resume events to
bring the controller out of suspend.

On Qualcomm platforms the bus resume is handled through Phy and informed to
software through wakeup capable phy interrupts.
usb2 PHY is configured to detect the Resume K event and sends an interrupt
when this event is detected. This would trigger the runtime resume of the
glue driver which would intrinsically wakeup the dwc3 child. In case of usb3 PHY,
it is configured to detect the LFPS wake signal during bus resume and the
corresponding interrupt triggers the runtime resume of the glue driver.

The series is organized in below fashion:
Patch 1: This includes the modification needed from function drivers to let
UDC enter low power mode with u_ether as an example.
Patch 2: New dt property to allow dwc3 runtime suspedn during bus suspend scenario. 
Patch 3: This has the modification needed in the UDC driver to trigger runtime
suspend whene a bus suspend interrupt is received. Since this is a platform
dependent change it is made applicable through a dt property. This also handles
resume and remote wakeup modifications from power management perspective.

Elson Roy Serrao (3):
  usb: function: u_ether: Handle rx requests during suspend/resume
  dt-bindings: usb: snps,dwc3: Add allow-rtsusp-on-u3 property
  usb: dwc3: Modify runtime pm ops to handle bus suspend

 .../devicetree/bindings/usb/snps,dwc3.yaml    |  5 ++
 drivers/usb/dwc3/core.c                       | 26 ++++++++--
 drivers/usb/dwc3/core.h                       |  3 ++
 drivers/usb/dwc3/gadget.c                     | 40 +++++++++++++---
 drivers/usb/gadget/function/u_ether.c         | 47 +++++++++++++++----
 5 files changed, 102 insertions(+), 19 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-07-14 20:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11 17:43 [PATCH v3 0/3] Support dwc3 runtime suspend during bus suspend Elson Roy Serrao
2023-07-11 17:43 ` [PATCH v3 1/3] usb: function: u_ether: Handle rx requests during suspend/resume Elson Roy Serrao
2023-07-11 17:43 ` [PATCH v3 2/3] dt-bindings: usb: snps,dwc3: Add allow-rtsusp-on-u3 property Elson Roy Serrao
2023-07-11 21:56   ` Thinh Nguyen
2023-07-11 22:38     ` Elson Serrao
2023-07-12 11:53     ` Roger Quadros
2023-07-12 22:34       ` Thinh Nguyen
2023-07-12  5:47   ` Krzysztof Kozlowski
2023-07-11 17:43 ` [PATCH v3 3/3] usb: dwc3: Modify runtime pm ops to handle bus suspend Elson Roy Serrao
2023-07-11 22:07   ` Thinh Nguyen
2023-07-11 22:51     ` Elson Serrao
2023-07-11 23:22       ` Elson Serrao
2023-07-12 13:46   ` Roger Quadros
2023-07-12 22:57     ` Elson Serrao
2023-07-13 12:56       ` Roger Quadros
2023-07-13 22:31         ` Elson Serrao
2023-07-14 12:23           ` Roger Quadros
2023-07-14 20:34             ` Elson Serrao
2023-07-11 21:58 ` [PATCH v3 0/3] Support dwc3 runtime suspend during " Thinh Nguyen
2023-07-12 12:16 ` Roger Quadros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox