devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] Support dwc3 runtime suspend during bus suspend
@ 2023-08-14 18:50 Elson Roy Serrao
  2023-08-14 18:50 ` [PATCH v4 1/3] usb: function: u_ether: Handle rx requests during suspend/resume Elson Roy Serrao
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Elson Roy Serrao @ 2023-08-14 18:50 UTC (permalink / raw)
  To: gregkh, Thinh.Nguyen, rogerq, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, devicetree
  Cc: linux-kernel, linux-usb, Elson Roy Serrao

Changes in v4
 - Changed the dt property name to 'snps,runtime-suspend-on-usb-suspend' as per
   the feedback received.
 - Separated the pending events handling to a different patch as it is an
   independent fix
   https://lore.kernel.org/all/b2ab8803-d4e0-bd63-7a64-bcc411e04cfe@kernel.org/
 - Moved the bus suspend checks to runtime_checks() API to make it more relevant
   to runtime ops. Also added explicit run time check in resume common function.
 - Instead of checking the link state for bus suspend, used dwc->suspended flag
   as it directly reflects the gadget suspend/resume operations.
 
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 to detect resume events to bring the controller out of
suspend. On Qualcomm platforms the resume is handled through PHY sideband signalling.


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 (3):
  usb: function: u_ether: Handle rx requests during suspend/resume
  dt-bindings: usb: snps,dwc3: Add runtime-suspend-on-usb-suspend
    property
  usb: dwc3: Modify runtime pm ops to handle bus suspend

 .../devicetree/bindings/usb/snps,dwc3.yaml    |  5 ++
 drivers/usb/dwc3/core.c                       | 28 ++++++++++-
 drivers/usb/dwc3/core.h                       |  3 ++
 drivers/usb/dwc3/gadget.c                     | 32 ++++++++++---
 drivers/usb/gadget/function/u_ether.c         | 47 +++++++++++++++----
 5 files changed, 97 insertions(+), 18 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2023-10-30 18:41 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14 18:50 [PATCH v4 0/3] Support dwc3 runtime suspend during bus suspend Elson Roy Serrao
2023-08-14 18:50 ` [PATCH v4 1/3] usb: function: u_ether: Handle rx requests during suspend/resume Elson Roy Serrao
2023-08-14 18:50 ` [PATCH v4 2/3] dt-bindings: usb: snps,dwc3: Add runtime-suspend-on-usb-suspend property Elson Roy Serrao
2023-08-14 19:13   ` Rob Herring
2023-08-16  5:44   ` Krzysztof Kozlowski
2023-08-18 19:16     ` Elson Serrao
2023-08-19  0:42       ` Thinh Nguyen
2023-08-19  9:35       ` Krzysztof Kozlowski
2023-08-22 23:58         ` Elson Serrao
2023-08-23  6:34           ` Krzysztof Kozlowski
2023-08-23  8:04             ` Roger Quadros
2023-08-26  1:53               ` Thinh Nguyen
2023-08-26  8:39                 ` Krzysztof Kozlowski
2023-08-28 21:34                   ` Elson Serrao
2023-08-30  1:37                     ` Thinh Nguyen
2023-08-30  4:31                       ` Elson Serrao
2023-08-30  7:05                         ` Krzysztof Kozlowski
2023-08-31  3:01                           ` Thinh Nguyen
2023-08-31  6:29                             ` Krzysztof Kozlowski
2023-09-21 17:09                               ` Elson Serrao
2023-10-02 18:56                                 ` Thinh Nguyen
2023-10-17 22:59                                   ` Elson Serrao
2023-10-20 22:26                                     ` Thinh Nguyen
2023-08-14 18:50 ` [PATCH v4 3/3] usb: dwc3: Modify runtime pm ops to handle bus suspend Elson Roy Serrao
2023-10-24 10:14   ` Roger Quadros
2023-10-24 18:41     ` Elson Serrao
2023-10-25  8:02       ` Roger Quadros
2023-10-25 22:21         ` Elson Serrao
2023-10-26  8:29           ` Roger Quadros
2023-10-27  0:07             ` Elson Serrao
2023-10-27  6:37               ` Roger Quadros
2023-10-30 18:41                 ` Elson Serrao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).