Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jiayi Li" <lijiayi@kylinos.cn>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v3] usb: uas: wait for pending commands before unbinding
Date: Tue, 27 Oct 2026 13:26:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-186620@kernel.org> (raw)
In-Reply-To: <20261027131458.983241-1-lijiayi@kylinos.cn>

> USB core normally disables interface endpoints before calling
> uas_disconnect(), cancelling URBs while the device may still be
> processing the associated commands. Some storage bridges may then
> fail to recover after a driver rebind and require a disconnect and
> reconnect.
> 
> Enable soft unbinding and give already accepted commands a bounded
> grace period to complete before teardown. The disconnect sequence is:
> 
>   -> cancel pending scan work and block new requests
>   -> stop software retries for accepted commands
>   -> wait for commands that can still complete normally
>   -> set resetting and unblock requests
>   -> cancel work and URBs, then clean up remaining commands
>   -> synchronize scan work and remove the host
> 
> Commands needing a retry are left for the existing cleanup, while
> other accepted commands can still complete normally. Stop waiting
> when there are no commands left to wait for, USB core marks the device
> as not attached, or the grace period expires.
> 
> This does not abort tasks already accepted by the device. If a command
> cannot finish during the grace period, an affected bridge may still
> require a disconnect and reconnect to recover.
> 
> Signed-off-by: Jiayi Li <lijiayi@kylinos.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261027131458.983241-1-lijiayi@kylinos.cn?part=1


  reply	other threads:[~2026-10-27 13:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 13:14 [PATCH v3] usb: uas: wait for pending commands before unbinding Jiayi Li
2026-10-27 13:26 ` sashiko-bot [this message]
2026-10-27 14:35 ` Oliver Neukum
2026-10-28  2:09   ` Jiayi Li
2026-10-28  8:48     ` Oliver Neukum
2026-10-28  9:21       ` Jiayi Li

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=sashiko-outbox-186620@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lijiayi@kylinos.cn \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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