Commit ef9d3468 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Felipe Balbi

usb: gadget: aspeed: Don't reject requests on suspended devices

A disconnect may just suspend the hub in absence of a physical
disconnect detection. If we start rejecting requests, the mass
storage function gets into a spin trying to requeue the same
request for ever and hangs.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 7e420cef
...@@ -204,14 +204,19 @@ int ast_vhub_std_dev_request(struct ast_vhub_ep *ep, ...@@ -204,14 +204,19 @@ int ast_vhub_std_dev_request(struct ast_vhub_ep *ep,
u16 wValue, wIndex; u16 wValue, wIndex;
/* No driver, we shouldn't be enabled ... */ /* No driver, we shouldn't be enabled ... */
if (!d->driver || !d->enabled || d->suspended) { if (!d->driver || !d->enabled) {
EPDBG(ep, EPDBG(ep,
"Device is wrong state driver=%p enabled=%d" "Device is wrong state driver=%p enabled=%d\n",
" suspended=%d\n", d->driver, d->enabled);
d->driver, d->enabled, d->suspended);
return std_req_stall; return std_req_stall;
} }
/*
* Note: we used to reject/stall requests while suspended,
* we don't do that anymore as we seem to have cases of
* mass storage getting very upset.
*/
/* First packet, grab speed */ /* First packet, grab speed */
if (d->gadget.speed == USB_SPEED_UNKNOWN) { if (d->gadget.speed == USB_SPEED_UNKNOWN) {
d->gadget.speed = ep->vhub->speed; d->gadget.speed = ep->vhub->speed;
......
...@@ -379,7 +379,7 @@ static int ast_vhub_ep0_queue(struct usb_ep* u_ep, struct usb_request *u_req, ...@@ -379,7 +379,7 @@ static int ast_vhub_ep0_queue(struct usb_ep* u_ep, struct usb_request *u_req,
return -EINVAL; return -EINVAL;
/* Disabled device */ /* Disabled device */
if (ep->dev && (!ep->dev->enabled || ep->dev->suspended)) if (ep->dev && !ep->dev->enabled)
return -ESHUTDOWN; return -ESHUTDOWN;
/* Data, no buffer and not internal ? */ /* Data, no buffer and not internal ? */
......
...@@ -352,7 +352,7 @@ static int ast_vhub_epn_queue(struct usb_ep* u_ep, struct usb_request *u_req, ...@@ -352,7 +352,7 @@ static int ast_vhub_epn_queue(struct usb_ep* u_ep, struct usb_request *u_req,
/* Endpoint enabled ? */ /* Endpoint enabled ? */
if (!ep->epn.enabled || !u_ep->desc || !ep->dev || !ep->d_idx || if (!ep->epn.enabled || !u_ep->desc || !ep->dev || !ep->d_idx ||
!ep->dev->enabled || ep->dev->suspended) { !ep->dev->enabled) {
EPDBG(ep, "Enqueuing request on wrong or disabled EP\n"); EPDBG(ep, "Enqueuing request on wrong or disabled EP\n");
return -ESHUTDOWN; return -ESHUTDOWN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment