From: Alan Stern <stern@rowland.harvard.edu>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Roger Quadros <rogerq@kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: dwc3: gadget suspend/resume vs system suspend/resume
Date: Thu, 16 Feb 2023 15:03:51 -0500 [thread overview]
Message-ID: <Y+6MJ2juVmPdp15q@rowland.harvard.edu> (raw)
In-Reply-To: <20230216181132.k2jate2uwqadpqfh@synopsys.com>
On Thu, Feb 16, 2023 at 06:11:36PM +0000, Thinh Nguyen wrote:
> On Thu, Feb 16, 2023, Roger Quadros wrote:
> > I could not find any reference to 500ms time limit for suspend/resume case.
> > The only mention of 500ms in USB2.0 spec is:
> >
> > 9.2.6.4 Standard Device Requests
> > ...
> > For standard device requests that require data stage transfer
> > to the host, the device must be able to return the first data
> > packet to the host within 500 ms of receipt of the request.
> > For subsequent data packets, if any, the device must be able to
> > return them within 500 ms of successful completion of the
> > transmission of the previous packet. The device must then be
> > able to successfully complete the status stage within 50 ms after
> > returning the last data packet.
> >
> > I don't think this applies to suspend/resume.
It's not specific to suspend/resume; it's a generic time limit. It can
vary depending on the application or the driver.
> Are you referring to the handshake timeout when the host tries to
> initiate resume at the link layer? It's relatively short compare to the
> software timeout and will vary depending on how many hub tiers in the
> topology. Also, that's handled by the host and device controller. We
> should care more about the software timeout after resume completed. The
> 500ms here applies if the device couldn't resume fast enough for the
> driver to prepare a transfer response to the host.
Also, keep in mind that we can increase the initial timeout limit
following a resume, if necessary (on Linux hosts with a recent kernel --
obviously not on other kinds of hosts). Or make it an adjustable
parameter.
> > > IMO, the system suspend on the gadget side should take precedence. That
> > > is, it shouldn't depend on whether the usb gadget is in suspend or not
> > > to go through system suspend. For that to happen, the gadget must
> > > initiate soft-disconnect. Otherwise I can see we may run into
> > > complications from the delay from the system suspend. For example, what
> > > if the host initiates resume right after suspend while the gadget side
> > > is still suspending?
> >
> > In this case, system will go all the way to suspend and then wake up.
> > It will take a few seconds more to respond than if system was already suspended.
>
> Yes, my concern is the suspend/resume is measured in seconds.
It the gadget is too slow in responding, it shouldn't be a big deal.
The host will assume the gadget has disconnected and then will
re-discover it. Pretty much the same as if the gadget had actually
disconnected from the bus before going into system suspend.
Alan Stern
next prev parent reply other threads:[~2023-02-16 20:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 9:40 dwc3: gadget suspend/resume vs system suspend/resume Roger Quadros
2023-02-15 15:41 ` Alan Stern
2023-02-15 17:29 ` Roger Quadros
2023-02-15 18:24 ` Alan Stern
2023-02-15 22:53 ` Thinh Nguyen
2023-02-16 8:40 ` Roger Quadros
2023-02-16 18:11 ` Thinh Nguyen
2023-02-16 20:03 ` Alan Stern [this message]
2023-02-16 22:10 ` Thinh Nguyen
2023-02-16 20:43 ` Roger Quadros
2023-02-16 22:23 ` Thinh Nguyen
2023-02-17 9:28 ` Roger Quadros
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=Y+6MJ2juVmPdp15q@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=Thinh.Nguyen@synopsys.com \
--cc=linux-usb@vger.kernel.org \
--cc=rogerq@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox