Re: [PATCH v2] USB:UAS:return ENODEV when submit urbs fail with device not attached.

From: Oliver Neukum
Date: Thu Feb 29 2024 - 03:09:43 EST


On 29.02.24 12:19, WeitaoWang-oc@xxxxxxxxxxx wrote:

When alloc urb fail in the same function uas_submit_urbs,
whether we should replace SCSI_MLQUEUE_DEVICE_BUSY with generic
error code -ENOMEM? Such like this:

@@ -572,7 +571,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
         cmdinfo->data_in_urb = uas_alloc_data_urb(devinfo, GFP_ATOMIC,
                             cmnd, DMA_FROM_DEVICE);
         if (!cmdinfo->data_in_urb)
-            return SCSI_MLQUEUE_DEVICE_BUSY;
+            return -ENOMEM;
         cmdinfo->state &= ~ALLOC_DATA_IN_URB;
     }

Hi,

yes, and then you translate in one central place for the SCSI layer
into DID_ERROR or DID_NO_CONNECT.

Regards
Oliver