From: "WeitaoWang-oc@zhaoxin.com" <WeitaoWang-oc@zhaoxin.com>
To: Oliver Neukum <oneukum@suse.com>, <stern@rowland.harvard.edu>,
<gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
<usb-storage@lists.one-eyed-alien.net>
Cc: <WeitaoWang@zhaoxin.com>
Subject: Re: [PATCH] USB:UAS:return ENODEV when submit urbs fail with device not attached.
Date: Fri, 23 Feb 2024 04:06:23 +0800 [thread overview]
Message-ID: <41daf1a9-590a-e220-84a3-648eb895272b@zhaoxin.com> (raw)
In-Reply-To: <3ff16f34-07a9-4b7e-b51d-b7220f08d88d@suse.com>
On 2024/2/22 17:47, Oliver Neukum wrote:
>
> On 22.02.24 17:54, Weitao Wang wrote:
>> In the scenario of entering hibernation with udisk in the system, if the
>> udisk was gone or resume fail in the thaw phase of hibernation. Its state
>> will be set to NOTATTACHED. However, usb_hub_wq was already freezed and
>> can't not handle disconnect event. Then, sync cache SCSI command will be
>> sent to this udisk on the poweroff phase of hibernation, that will cause
>
> Wait, this seems like a contradiction. Are we in thaw or are we powering off?
This fail appear in poweroff phase of hibernation.
>> uas_submit_urbs to be called to submit URB to sense/data/cmd pipe. Then,
>> usb_submit_urb return value -ENODEV when device was set to NOTATTACHED
>> state. However, uas_submit_urbs always return "SCSI_MLQUEUE_DEVICE_BUSY"
>> regardless of the reason for submission failure.That will lead the SCSI
>> layer go into an ugly loop and system fail to go into hibernation.
>
> The thing is that the SCSI documentation explicitly tells us to return
> either SCSI_MLQUEUE_DEVICE_BUSY or SCSI_MLQUEUE_HOST_BUSY. Now, it makes
> sense to tell the SCSI laer that a device or host is gone for good,
> if we know that. But we cannot just introduce new error returns on our own.
>
> This needs to be addressed. That means that the SCSI layer or at the
> very least the documentation needs to be fixed. Frankly, this is not strictly
> speaking a UAS issue. Any thing hotunpluggable should have this issue.
>
Maybe, my description was not accurate enough, here not add new return
value to scsi layer,it just add a case to tell device is gone in the uas
driver internal and the ENODEV error code not return to scsi layer.
Here just notify SCSI layer of device loss through flag DID_NO_CONNECT.
This is also hope to fix this issue in the uas driver internal.
Thanks and best regards,
weitao
next prev parent reply other threads:[~2024-02-22 12:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 16:54 Weitao Wang
2024-02-22 9:47 ` Oliver Neukum
2024-02-22 20:06 ` WeitaoWang-oc [this message]
2024-02-27 9:05 ` Oliver Neukum
2024-02-27 21:35 ` WeitaoWang-oc
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=41daf1a9-590a-e220-84a3-648eb895272b@zhaoxin.com \
--to=weitaowang-oc@zhaoxin.com \
--cc=WeitaoWang@zhaoxin.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.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®