Merge 5.3-rc7 into usb-next
We need the usb fixes in here for testing Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -709,12 +709,6 @@ static int _gadget_stop_activity(struct usb_gadget *gadget)
|
||||
struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&ci->lock, flags);
|
||||
ci->gadget.speed = USB_SPEED_UNKNOWN;
|
||||
ci->remote_wakeup = 0;
|
||||
ci->suspended = 0;
|
||||
spin_unlock_irqrestore(&ci->lock, flags);
|
||||
|
||||
/* flush all endpoints */
|
||||
gadget_for_each_ep(ep, gadget) {
|
||||
usb_ep_fifo_flush(ep);
|
||||
@@ -732,6 +726,12 @@ static int _gadget_stop_activity(struct usb_gadget *gadget)
|
||||
ci->status = NULL;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ci->lock, flags);
|
||||
ci->gadget.speed = USB_SPEED_UNKNOWN;
|
||||
ci->remote_wakeup = 0;
|
||||
ci->suspended = 0;
|
||||
spin_unlock_irqrestore(&ci->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1303,6 +1303,10 @@ static int ep_disable(struct usb_ep *ep)
|
||||
return -EBUSY;
|
||||
|
||||
spin_lock_irqsave(hwep->lock, flags);
|
||||
if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
|
||||
spin_unlock_irqrestore(hwep->lock, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* only internal SW should disable ctrl endpts */
|
||||
|
||||
@@ -1392,6 +1396,10 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req,
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(hwep->lock, flags);
|
||||
if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
|
||||
spin_unlock_irqrestore(hwep->lock, flags);
|
||||
return 0;
|
||||
}
|
||||
retval = _ep_queue(ep, req, gfp_flags);
|
||||
spin_unlock_irqrestore(hwep->lock, flags);
|
||||
return retval;
|
||||
@@ -1415,8 +1423,8 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(hwep->lock, flags);
|
||||
|
||||
hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
|
||||
if (hwep->ci->gadget.speed != USB_SPEED_UNKNOWN)
|
||||
hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
|
||||
|
||||
list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) {
|
||||
dma_pool_free(hwep->td_pool, node->ptr, node->dma);
|
||||
@@ -1487,6 +1495,10 @@ static void ep_fifo_flush(struct usb_ep *ep)
|
||||
}
|
||||
|
||||
spin_lock_irqsave(hwep->lock, flags);
|
||||
if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
|
||||
spin_unlock_irqrestore(hwep->lock, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
|
||||
|
||||
@@ -1559,6 +1571,10 @@ static int ci_udc_wakeup(struct usb_gadget *_gadget)
|
||||
int ret = 0;
|
||||
|
||||
spin_lock_irqsave(&ci->lock, flags);
|
||||
if (ci->gadget.speed == USB_SPEED_UNKNOWN) {
|
||||
spin_unlock_irqrestore(&ci->lock, flags);
|
||||
return 0;
|
||||
}
|
||||
if (!ci->remote_wakeup) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user