linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-usb@vger.kernel.org
Subject: [Bug 220491] usb_storage connected SD card disconnects/reconnects on resume from suspend
Date: Wed, 03 Sep 2025 12:58:53 +0000	[thread overview]
Message-ID: <bug-220491-208809-wwb9zhzJAe@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-220491-208809@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=220491

Mathias Nyman (mathias.nyman@linux.intel.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mathias.nyman@linux.intel.c
                   |                            |om

--- Comment #23 from Mathias Nyman (mathias.nyman@linux.intel.com) ---
Looks like main issue is that the device is disconnected during suspend/resume.

USB3 devices will try to train the link automatically after connect, and get it
up to a full enabled and running U0 state without driver interaction.

I see at least 3 different outcomes after device was re-connected during
suspend/resume

1. Device link training was attempted early in resume (or during suspend), but
before xHC host was really capable to di its part.xHC sets a CAS flag (cold
attach state) to tell xhci driver device needs to reset to get the link in
shape. CAS is xhci specific, not part of usb specification, so xhci driver
reports a "compliance mode" state to usb core instead.  This is the idd 341
state Alan talked about.  For som unknown reason I can't see the expected
"Connect status change" here.

2. link is successfully retrained during resume, link reaches U0/enabled 
state. We also see the "Connect Status Change" (CSC) set. This link state looks
exactly like a successful resume from U3, except for the CSC flag. It's
possible usb core assumes device is now successfully resumed into U0 configured
state even if it is in U0 Default state, and needs to be addressed and
configured before it can respond to most requests.

3. reset-resume races with link error (ss.Inactive state). If link goes to
ss.Inactive it can only be recovered by a (device) reset. In this race case
the link goes to ss.inactive at the same time a usb core resets the device.
- link goes to ss.inactive (xhci driver and usb core are not yet aware of this)
- usb core reset device as part of reset-resume path.
- xhci driver sees ss.Inactive error state before reset, sets a flag that
prevents transfers. logs show "Can't queue urb, port error, link inactive"
messages.
- device is reset and recovers, flags stays forever preventing transfers.
This needs to be fixes in xhci driver

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2025-09-03 12:58 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  3:34 [Bug 220491] New: usb_storage connected SD card disconnects/reconnects on resume from suspend bugzilla-daemon
2025-08-26  3:38 ` [Bug 220491] " bugzilla-daemon
2025-08-26 10:41 ` bugzilla-daemon
2025-08-26 15:05 ` bugzilla-daemon
2025-08-26 16:18 ` bugzilla-daemon
2025-08-26 17:24 ` bugzilla-daemon
2025-08-27  1:55 ` bugzilla-daemon
2025-08-27  3:49 ` bugzilla-daemon
2025-08-27  8:28 ` bugzilla-daemon
2025-08-27 16:26 ` bugzilla-daemon
2025-08-27 16:34 ` bugzilla-daemon
2025-08-27 17:01 ` bugzilla-daemon
2025-08-28  2:47 ` bugzilla-daemon
2025-08-28 17:33 ` bugzilla-daemon
2025-08-28 18:11 ` bugzilla-daemon
2025-08-29 17:37 ` bugzilla-daemon
2025-08-29 18:31 ` bugzilla-daemon
2025-09-02 21:23 ` bugzilla-daemon
2025-09-02 21:24 ` bugzilla-daemon
2025-09-02 21:45 ` bugzilla-daemon
2025-09-03  2:26 ` bugzilla-daemon
2025-09-03  5:39 ` bugzilla-daemon
2025-09-03  6:12 ` bugzilla-daemon
2025-09-03 12:58 ` bugzilla-daemon [this message]
2025-09-03 14:09 ` bugzilla-daemon
2025-09-03 15:29 ` bugzilla-daemon
2025-09-03 16:36 ` bugzilla-daemon
2025-09-03 16:43 ` bugzilla-daemon
2025-09-03 17:12 ` bugzilla-daemon
2025-09-03 19:00 ` bugzilla-daemon
2025-09-03 21:04 ` bugzilla-daemon
2025-09-03 21:08 ` bugzilla-daemon
2025-09-03 21:13 ` bugzilla-daemon
2025-09-03 21:22 ` bugzilla-daemon
2025-09-04  0:59 ` bugzilla-daemon
2025-09-04  1:00 ` bugzilla-daemon
2025-09-04  1:29 ` bugzilla-daemon
2025-09-04  2:49 ` bugzilla-daemon
2025-09-04  5:11 ` bugzilla-daemon
2025-09-04  6:05 ` bugzilla-daemon
2025-09-04 15:17 ` bugzilla-daemon
2025-09-04 23:03 ` bugzilla-daemon
2025-09-05  1:35 ` bugzilla-daemon
2025-09-05 11:53 ` bugzilla-daemon
2025-09-05 18:30 ` bugzilla-daemon
2025-09-05 21:44 ` bugzilla-daemon
2025-09-08 13:39 ` bugzilla-daemon
2025-09-08 22:41 ` bugzilla-daemon
2025-09-08 23:01 ` bugzilla-daemon
2025-09-08 23:04 ` bugzilla-daemon
2025-09-09  4:38 ` bugzilla-daemon
2025-09-09 16:03 ` bugzilla-daemon
2025-09-09 21:05 ` bugzilla-daemon
2025-09-09 21:16 ` bugzilla-daemon
2025-09-09 22:25 ` bugzilla-daemon

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=bug-220491-208809-wwb9zhzJAe@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-usb@vger.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;
as well as URLs for NNTP newsgroup(s).