在 2023/4/13 21:46, Alan Stern 写道:
On Thu, Apr 13, 2023 at 12:50:12PM +0800, qianfan wrote:
The resubmit logic in usb_wwan_indat_callback semms need improve:
if (status) {
dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n",
__func__, status, endpoint);
/* don't resubmit on fatal errors */
if (status == -ESHUTDOWN || status == -ENOENT)
return;
}
maybe this patch is better?
switch (status) {
case -ESHOTDOWN:
case -ENOENT:
case -ECONNRESET:
case -EOVERFLOW:
case -EPROTO:
reutrn;
}
In fact, it would be better to treat any error you don't recognize as a
fatal error.
I think it is a good idea.
Alan Stern