Re: [PATCH] usb: uas: wait for pending commands before unbinding

From: Oliver Neukum

Date: Thu Oct 22 2026 - 09:34:29 EST


Hi,

thank you for doing this.

On 22.10.26 14:34, Jiayi Li wrote:

+static void uas_pre_disconnect(struct usb_interface *intf)
+{
+ struct Scsi_Host *shost = usb_get_intfdata(intf);
+ struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata;
+ unsigned long flags, start_time;
+
+ spin_lock_irqsave(shost->host_lock, flags);
+ scsi_block_requests(shost);

No, on pure grounds of maintainability, please put the
blocking of the host in the direct handler for disconnect.
Unblocking in the caller something that was never blocked
would forever trip up anybody reading the code.

Regards
Oliver