Re: [PATCH v2] usb: uas: quiesce SCSI before stopping endpoints on unbind

From: Michal Pecio

Date: Fri Oct 02 2026 - 08:52:16 EST


On Wed, 30 Sep 2026 09:22:49 +0200, Oliver Neukum wrote:
> > When URB submission or completion returns -ENODEV or -ESHUTDOWN,
> > it marks the transport dead, stops further submissions, clears
>
> Why this specific trigger?
> I am asking because -ENODEV comes relatively late in the process.
> URBs tend to fail long before that.

But it's sufficient, right? Apparently all we need is to detect
USB disconnection before disconnect() runs. This will do.

You may see -EPROTO earlier, but that's indistinguishable from
transient erros. -ENODEV specifically means "device is gone" and
-ESHUTDOWN is usb_disable_endpoint() etc or a fatal HC error.

These statuses should probably result in the SCSI command being
completed with error status right away so that scsi_remove_host()
called by disconnect() has nothing to wait for. Note that new
commands will be failing to queue due to usb_submit_urb() errors.

But UAS driver infamously has no URB error handling; if anything
goes wrong it just waits for SCSI core to abort the command. Not
sure why things are this way.

Regards,
Michal