[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49a365a7-199a-42cd-b8d3-86d72fe5bca6@suse.com>
Date: Wed, 28 Feb 2024 15:47:51 +0100
From: Oliver Neukum <oneukum@...e.com>
To: "WeitaoWang-oc@...oxin.com" <WeitaoWang-oc@...oxin.com>,
Oliver Neukum <oneukum@...e.com>, stern@...land.harvard.edu,
gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
usb-storage@...ts.one-eyed-alien.net
Cc: WeitaoWang@...oxin.com, stable@...r.kernel.org
Subject: Re: [PATCH v2] USB:UAS:return ENODEV when submit urbs fail with
device not attached.
On 28.02.24 23:32, WeitaoWang-oc@...oxin.com wrote:
> @@ -602,6 +606,8 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
> if (err) {
> usb_unanchor_urb(cmdinfo->data_out_urb);
> uas_log_cmd_state(cmnd, "data out submit err", err);
> + if (err == -ENODEV)
> + return -ENODEV;
This is a generic error code from errno.h
> return SCSI_MLQUEUE_DEVICE_BUSY;
This is not.
> }
> cmdinfo->state &= ~SUBMIT_DATA_OUT_URB;
> @@ -621,6 +627,8 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
> if (err) {
> usb_unanchor_urb(cmdinfo->cmd_urb);
> uas_log_cmd_state(cmnd, "cmd submit err", err);
> + if (err == -ENODEV)
> + return -ENODEV;
> return SCSI_MLQUEUE_DEVICE_BUSY;
> }
>
> I'm not sure I fully understand what your mean.
> Whether the above code is more reasonable? If not,could you give me some
> suggestion? Thanks for your help!
You want to change uas_submit_urbs() to return the reason for
errors, because -ENODEV needs to be handled differently. That
is good.
But why don't you just do
return err;
unconditionally? There is no point in using SCSI_MLQUEUE_DEVICE_BUSY
Regards
Oliver
Powered by blists - more mailing lists