From: Oliver Neukum <oneukum@suse.com>
To: Owen Gu <guhuinan@xiaomi.com>, Oliver Neukum <oneukum@suse.com>,
Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org,
usb-storage@lists.one-eyed-alien.net,
linux-kernel@vger.kernel.org, Yu Chen <chenyu45@xiaomi.com>,
Michal Pecio <michal.pecio@gmail.com>
Subject: Re: [PATCH v2] usb: uas: fix urb unmapping issue when the uas device is remove during ongoing data transfer
Date: Mon, 27 Oct 2025 14:35:37 +0100 [thread overview]
Message-ID: <8de18ee2-ccdd-4cdd-ae49-48600ad30ed4@suse.com> (raw)
In-Reply-To: <aP8Llz04UH8Sbq5Q@oa-guhuinan-2.localdomain>
Hi,
I think I was unclear the first time.
Sorry for that.
On 27.10.25 07:05, Owen Gu wrote:
> Hi Oliver,
>
>> This patch modifies the error condition check in the uas_submit_urbs()
>> function. When a UAS device is removed but one or more URBs have already
>> been successfully submitted to USB, it avoids immediately invoking
>> scsi_done() and save the cmnd to devinfo->cmnd array. If the successfully
>> submitted URBs is completed before devinfo->resetting being set, then
>> the scsi_done() function will be called within uas_try_complete() after
This requires that uas_try_complete() is called.
And I am afraid uas_stat_cmplt() cannot guarantee that in the error case.
I think the following sequence of events is possible:
CPU A CPU B
uas_queuecommand_lck() calls uas_submit_urbs()
COMMAND_INFLIGHT is set and URB submitted
URB gets an error
status = -EBABBLE (just an example)
uas_stat_cmplt is called
resetting is not set
if (status)
goto out;
uas_try_complete _not_ called
The scsi command runs for indeterminate amount of time.
It seems to me that if you want to use your approach you also
need to change error handling in uas_stat_cmplt()
Regards
Oliver
next prev parent reply other threads:[~2025-10-27 13:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 15:31 guhuinan
2025-10-27 6:05 ` Owen Gu
2025-10-27 13:35 ` Oliver Neukum [this message]
2025-11-01 13:55 ` Owen Gu
2025-11-03 9:41 ` [usb-storage] " Oliver Neukum
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=8de18ee2-ccdd-4cdd-ae49-48600ad30ed4@suse.com \
--to=oneukum@suse.com \
--cc=chenyu45@xiaomi.com \
--cc=gregkh@linuxfoundation.org \
--cc=guhuinan@xiaomi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michal.pecio@gmail.com \
--cc=stern@rowland.harvard.edu \
--cc=usb-storage@lists.one-eyed-alien.net \
/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®