All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elson Roy Serrao <quic_eserrao@quicinc.com>
To: balbi@kernel.org, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	quic_wcheng@quicinc.com, quic_jackp@quicinc.com,
	quic_mrana@quicinc.com, Thinh.Nguyen@synopsys.com,
	Elson Roy Serrao <quic_eserrao@quicinc.com>
Subject: [PATCH 0/5] Add function suspend/resume and remote wakeup support
Date: Tue,  2 Aug 2022 12:18:35 -0700	[thread overview]
Message-ID: <1659467920-9095-1-git-send-email-quic_eserrao@quicinc.com> (raw)

An usb device can initate a remote wakeup and bring the link out of
suspend as dictated by the DEVICE_REMOTE_WAKEUP feature selector.
To achieve this an interface can invoke gadget_wakeup op and wait for the
device to come out of LPM. But the current polling based implementation
fails if the host takes a long time to drive the resume signaling specially
in high speed capable devices. Switching to an interrupt based approach is
more robust and efficient. This can be leveraged by enabling link status
change events and triggering a gadget resume when the link comes to active
state.

If the device is super-speed/super-speed-plus capable, individual
interfaces can also be put into suspend state. An interface can be
in function suspend state even when the device is not in suspend state.
Function suspend state is retained throughout the device suspend entry
and exit process. A function can be put to function suspend through
FUNCTION_SUSPEND feature selector sent by the host. This setup packet also
decides whether that function is capable of initiating a function remote
wakeup. When the function sends a wakeup notification to the host the link
must be first brought to a non-U0 state and then this notification
is sent.

This change adds the infrastructure needed to support the above
functionalities.

Elson Roy Serrao (5):
  usb: dwc3: Add remote wakeup handling
  usb: gadget: Add function wakeup support
  usb: dwc3: Add function suspend and function wakeup support
  usb: gadget: f_ecm: Add suspend/resume and remote wakeup support
  usb: gadget: f_ecm: Add function suspend and wakeup support

 drivers/usb/dwc3/core.h               |  5 ++
 drivers/usb/dwc3/ep0.c                | 16 +++---
 drivers/usb/dwc3/gadget.c             | 99 +++++++++++++++++++++++++++++++++--
 drivers/usb/gadget/composite.c        | 32 +++++++++++
 drivers/usb/gadget/function/f_ecm.c   | 67 ++++++++++++++++++++++++
 drivers/usb/gadget/function/u_ether.c | 98 ++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/function/u_ether.h |  6 +++
 drivers/usb/gadget/udc/core.c         |  9 ++++
 include/linux/usb/composite.h         |  1 +
 include/linux/usb/gadget.h            |  2 +
 10 files changed, 324 insertions(+), 11 deletions(-)

-- 
2.7.4


             reply	other threads:[~2022-08-02 19:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 19:18 Elson Roy Serrao [this message]
2022-08-02 19:18 ` [PATCH 1/5] usb: dwc3: Add remote wakeup handling Elson Roy Serrao
2022-08-03  0:01   ` Thinh Nguyen
2022-08-02 19:18 ` [PATCH 2/5] usb: gadget: Add function wakeup support Elson Roy Serrao
2022-08-02 23:51   ` Thinh Nguyen
2022-08-04 21:42     ` Elson Serrao
2022-08-05  1:26       ` Thinh Nguyen
2022-08-09 19:42         ` Elson Serrao
2022-08-10  1:08           ` Thinh Nguyen
2022-08-11 20:31             ` Elson Serrao
2022-08-12  2:00               ` Thinh Nguyen
2022-08-12  2:19                 ` Thinh Nguyen
2022-08-13  0:46                   ` Thinh Nguyen
2022-08-16 19:57                     ` Elson Serrao
2022-08-16 23:51                       ` Thinh Nguyen
2022-08-18 18:17                         ` Elson Serrao
2022-08-18 19:41                           ` Elson Serrao
2022-08-23  1:01                           ` Thinh Nguyen
2022-08-23 22:06                             ` Elson Serrao
2022-08-26  1:30                               ` Thinh Nguyen
2022-09-13 20:13                                 ` Elson Serrao
2022-09-15  2:06                                   ` Thinh Nguyen
2022-08-11 21:03             ` Elson Serrao
2022-08-12  2:07               ` Thinh Nguyen
2022-08-02 19:18 ` [PATCH 3/5] usb: dwc3: Add function suspend and " Elson Roy Serrao
2022-08-02 23:44   ` Thinh Nguyen
2022-08-02 19:18 ` [PATCH 4/5] usb: gadget: f_ecm: Add suspend/resume and remote " Elson Roy Serrao
2022-08-02 19:18 ` [PATCH 5/5] usb: gadget: f_ecm: Add function suspend and " Elson Roy Serrao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1659467920-9095-1-git-send-email-quic_eserrao@quicinc.com \
    --to=quic_eserrao@quicinc.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_mrana@quicinc.com \
    --cc=quic_wcheng@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.