From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Alan Stern <stern@rowland.harvard.edu>,
Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kai-Heng Feng <kai.heng.feng@canonical.com>,
Hans de Goede <hdegoede@redhat.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: core: hub_port_reset: Remove extra 40 ms reset recovery time
Date: Mon, 5 Aug 2024 12:17:22 +0300 [thread overview]
Message-ID: <ac78b076-b0e5-4d09-a304-8bd68c5ecf38@linux.intel.com> (raw)
In-Reply-To: <3ec64ec7-5e10-4d24-bc6b-f205154f2cf8@rowland.harvard.edu>
On 4.8.2024 16.19, Alan Stern wrote:
> On Sun, Aug 04, 2024 at 09:15:34AM +0200, Paul Menzel wrote:
>> [To: +Heikki]
>>
>>
>> Dear Alan, dear Heikki,
>>
>>
>> Am 26.07.24 um 19:48 schrieb Alan Stern:
>
> ...
>
>>> It's probably an xHCI thing -- the hardware may stop providing power to
>>> the ports during S3 suspend, or something like that. The xHCI people
>>> may have a better idea of what's going on.
>>
>> Heikki, can you confirm this. I am attaching the logs with
>
> You should be asking Mathias, the xHCI maintainer.
>
>> echo 'file drivers/usb/* +p' | sudo tee
>> /sys/kernel/debug/dynamic_debug/control
>
> ...
>
>> [ 149.185600] usb 1-3: usb suspend, wakeup 0
>> [ 149.185642] xhci_hcd 0000:00:14.0: Cancel URB 000000003e45896a, dev 4, ep 0x81, starting at offset 0x102ef1010
>> [ 149.185661] usb usb2: usb auto-resume
>> [ 149.185664] xhci_hcd 0000:00:14.0: // Ding dong!
>> [ 149.185736] xhci_hcd 0000:00:14.0: Stopped on Transfer TRB for slot 2 ep 2
>> [ 149.185745] xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x102ef1010 (dma) in stream 0 URB 000000003e45896a
>> [ 149.185753] xhci_hcd 0000:00:14.0: Set TR Deq ptr 0x102ef1020, cycle 1
>>
>> [ 149.185757] xhci_hcd 0000:00:14.0: // Ding dong!
>> [ 149.185763] xhci_hcd 0000:00:14.0: xhci_giveback_invalidated_tds: Keep cancelled URB 000000003e45896a TD as cancel_status is 2
>> [ 149.185770] xhci_hcd 0000:00:14.0: Successful Set TR Deq Ptr cmd, deq = @102ef1020
>> [ 149.185775] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: Giveback cancelled URB 000000003e45896a TD
>> [ 149.185780] xhci_hcd 0000:00:14.0: Giveback URB 000000003e45896a, len = 0, expected = 116, status = -115
>> [ 149.185788] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: All TDs cleared, ring doorbell
>> [ 149.185810] hub 2-0:1.0: hub_resume
>> [ 149.185816] usb 1-4: usb suspend, wakeup 0
>> [ 149.185840] hub 1-0:1.0: hub_suspend
>> [ 149.185865] usb usb1: bus suspend, wakeup 0
>> [ 149.185894] xhci_hcd 0000:00:14.0: port 1-4 not suspended
>> [ 149.185899] xhci_hcd 0000:00:14.0: port 1-3 not suspended
>
> I have to wonder why xhci-hcd says ports 1-3 and 1-4 are not suspended,
> when only a few lines earlier the log says that devices 1-3 and 1-4
> have gone into USB suspend.
In bus suspend xhci notices that those ports are not properly suspended.
They are both in link state U0 state when they should be in U3 at this point
where devices and hubs should have successfully suspended.
Bus suspend will now try to set those ports to u3
Looks like at least 1-4 and 1-5 report connect status change at resume.
They need to be reset to get to the enabled state
[ 149.879684] xhci_hcd 0000:00:14.0: xhci_resume: starting usb1 port polling.
[ 149.879687] xhci_hcd 0000:00:14.0: Port change event, 1-4, id 4, portsc: 0x206e1
[ 149.879736] xhci_hcd 0000:00:14.0: Port change event, 1-5, id 5, portsc: 0x206e1
...
[ 149.937564] xhci_hcd 0000:00:14.0: clear port4 connect change, portsc: 0x6e1
[ 149.937591] xhci_hcd 0000:00:14.0: clear port5 connect change, portsc: 0x6e1
Port Status: 0x206e1
Connected
Disabled
Link: Polling
Powered
Full Speed
Connect Status Change
port 1-3 seems like it resumes fine from u3 -> u0, but ends up being reset anyway
during resume, didn't look into why (maybe reset_resume flag is set?)
-Mathias
next prev parent reply other threads:[~2024-08-05 9:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 11:15 Paul Menzel
2024-07-24 13:25 ` get_maintainer.pl finds old email address not in MAINTAINERS Paul Menzel
2024-07-24 14:02 ` Joe Perches
2024-07-24 14:10 ` [PATCH] USB: core: hub_port_reset: Remove extra 40 ms reset recovery time Alan Stern
2024-07-24 18:14 ` Paul Menzel
2024-07-24 18:52 ` Alan Stern
2024-07-24 21:00 ` Paul Menzel
2024-07-26 17:48 ` Alan Stern
2024-08-04 7:15 ` Paul Menzel
2024-08-04 13:19 ` Alan Stern
2024-08-05 9:17 ` Mathias Nyman [this message]
2024-08-05 21:41 ` Paul Menzel
2024-08-05 8:19 ` Paul Menzel
2024-08-05 13:38 ` Alan Stern
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=ac78b076-b0e5-4d09-a304-8bd68c5ecf38@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=kai.heng.feng@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=pmenzel@molgen.mpg.de \
--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®