From: "Bjørn Mork" <bjorn@mork.no>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
gregkh@linuxfoundation.org, <mathias.nyman@intel.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: Allow USB device to be warm reset in suspended state
Date: Wed, 06 Nov 2019 12:23:24 +0100 [thread overview]
Message-ID: <87o8xpz1sj.fsf@miraculix.mork.no> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1911051200570.1678-100000@iolanthe.rowland.org> (Alan Stern's message of "Tue, 5 Nov 2019 13:07:34 -0500 (EST)")
Alan Stern <stern@rowland.harvard.edu> writes:
> I was sure I remembered reading somewhere that suspended devices were
> not allowed to be reset, but now I can't find that requirement anywhere
> in the USB spec.
I don't know anything about this, but "Reset From Suspended State" is
part of Appendix C in the USB 2.0 spec. Looks valid to me..
Quoting the relevant section for those who don't have that spec at hand:
C.2.1 Reset From Suspended State
As can be seen from Figure C-2, the device wakes up from the Suspended
state as soon as it sees a K or an SE0 on the bus. A J would be
indistinguishable from idle on the bus that a suspended device sees
normally. On seeing a K, the device will initiate a resume
process. For the details of this process, see Section 7.1.7.7. On
seeing an SE0, the device could enter the reset handshake procedure,
so it starts timer T0.
The actual reset handshake is only started after seeing a continuous
assertion of SE0 for at least 2.5 μs (T FILTSE0 ). The loop between
the blocks with “Clear timer T1” and “Run timer T1” represents this
filtering. If the device has not detected a continuous SE0 before
timer T0 exceeds the value of T UCHEND - T UCH , the device goes back
into the Suspended state.
A device coming from suspend most probably had its high-speed clock
stopped to meet the power requirements for a suspended device (see
Section 7.2.3). Therefore, it may take some time to let the clock
settle to a level of operation where it is able to perform the reset
detection and handshake with enough precision. In the state diagram, a
time symbol T WTCLK is used to have the device wait for a stable
clock. This symbol is not part of the USB 2.0 specification and does
not appear in Chapter 7. It is an implementation specific detail of
the reset detection state diagram for the upstream facing port, where
it is marked with a asterisk (*). T WTCLK should have a value
somewhere between 0 and 5.0 ms. This allows at least 1.0 ms time to
detect the continuous SE0.
If the device has seen an SE0 signal on the bus for at least T FILTSE0
, then it can safely assume to have detected a reset and can start the
reset handshake.
Bjørn
prev parent reply other threads:[~2019-11-06 11:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 16:54 Kai-Heng Feng
2019-11-05 18:07 ` Alan Stern
2019-11-05 18:18 ` Kai-Heng Feng
2019-11-06 11:23 ` Bjørn Mork [this message]
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=87o8xpz1sj.fsf@miraculix.mork.no \
--to=bjorn@mork.no \
--cc=gregkh@linuxfoundation.org \
--cc=kai.heng.feng@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®