Commit 01f4fd2a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fixes-for-v4.3-rc3' of...

Merge tag 'fixes-for-v4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.3-rc3

Here's the second pull request for current -rc cycle.

A few fixes on dummy_hcd which have been around for
longer than they should be.

MUSB got a couple fixes, the most important of which
is a fix to DMA channel teardown on AM335x devices.

And DWC3 got a minor fix for when using RT-enabled
kernels.
parents ea934651 a66c275b
...@@ -2665,8 +2665,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc) ...@@ -2665,8 +2665,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
int i; int i;
irqreturn_t ret = IRQ_NONE; irqreturn_t ret = IRQ_NONE;
spin_lock(&dwc->lock);
for (i = 0; i < dwc->num_event_buffers; i++) { for (i = 0; i < dwc->num_event_buffers; i++) {
irqreturn_t status; irqreturn_t status;
...@@ -2675,8 +2673,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc) ...@@ -2675,8 +2673,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
ret = status; ret = status;
} }
spin_unlock(&dwc->lock);
return ret; return ret;
} }
......
...@@ -2002,6 +2002,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, ...@@ -2002,6 +2002,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
ep->udc = udc; ep->udc = udc;
INIT_LIST_HEAD(&ep->queue); INIT_LIST_HEAD(&ep->queue);
if (ep->index == 0) {
ep->ep.caps.type_control = true;
} else {
ep->ep.caps.type_iso = ep->can_isoc;
ep->ep.caps.type_bulk = true;
ep->ep.caps.type_int = true;
}
ep->ep.caps.dir_in = true;
ep->ep.caps.dir_out = true;
if (i) if (i)
list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
......
...@@ -324,7 +324,6 @@ static void bdc_mem_free(struct bdc *bdc) ...@@ -324,7 +324,6 @@ static void bdc_mem_free(struct bdc *bdc)
bdc->scratchpad.buff, bdc->scratchpad.sp_dma); bdc->scratchpad.buff, bdc->scratchpad.sp_dma);
/* Destroy the dma pools */ /* Destroy the dma pools */
if (bdc->bd_table_pool)
dma_pool_destroy(bdc->bd_table_pool); dma_pool_destroy(bdc->bd_table_pool);
/* Free the bdc_ep array */ /* Free the bdc_ep array */
......
...@@ -1348,6 +1348,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb, ...@@ -1348,6 +1348,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
{ {
struct dummy *dum = dum_hcd->dum; struct dummy *dum = dum_hcd->dum;
struct dummy_request *req; struct dummy_request *req;
int sent = 0;
top: top:
/* if there's no request queued, the device is NAKing; return */ /* if there's no request queued, the device is NAKing; return */
...@@ -1385,12 +1386,15 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb, ...@@ -1385,12 +1386,15 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
if (len == 0) if (len == 0)
break; break;
/* use an extra pass for the final short packet */ /* send multiple of maxpacket first, then remainder */
if (len > ep->ep.maxpacket) { if (len >= ep->ep.maxpacket) {
is_short = 0;
if (len % ep->ep.maxpacket)
rescan = 1; rescan = 1;
len -= (len % ep->ep.maxpacket); len -= len % ep->ep.maxpacket;
} else {
is_short = 1;
} }
is_short = (len % ep->ep.maxpacket) != 0;
len = dummy_perform_transfer(urb, req, len); len = dummy_perform_transfer(urb, req, len);
...@@ -1399,6 +1403,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb, ...@@ -1399,6 +1403,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
req->req.status = len; req->req.status = len;
} else { } else {
limit -= len; limit -= len;
sent += len;
urb->actual_length += len; urb->actual_length += len;
req->req.actual += len; req->req.actual += len;
} }
...@@ -1421,7 +1426,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb, ...@@ -1421,7 +1426,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
*status = -EOVERFLOW; *status = -EOVERFLOW;
else else
*status = 0; *status = 0;
} else if (!to_host) { } else {
*status = 0; *status = 0;
if (host_len > dev_len) if (host_len > dev_len)
req->req.status = -EOVERFLOW; req->req.status = -EOVERFLOW;
...@@ -1429,16 +1434,25 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb, ...@@ -1429,16 +1434,25 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
req->req.status = 0; req->req.status = 0;
} }
/* many requests terminate without a short packet */ /*
* many requests terminate without a short packet.
* send a zlp if demanded by flags.
*/
} else { } else {
if (req->req.length == req->req.actual if (req->req.length == req->req.actual) {
&& !req->req.zero) if (req->req.zero && to_host)
rescan = 1;
else
req->req.status = 0; req->req.status = 0;
if (urb->transfer_buffer_length == urb->actual_length }
&& !(urb->transfer_flags if (urb->transfer_buffer_length == urb->actual_length) {
& URB_ZERO_PACKET)) if (urb->transfer_flags & URB_ZERO_PACKET &&
!to_host)
rescan = 1;
else
*status = 0; *status = 0;
} }
}
/* device side completion --> continuable */ /* device side completion --> continuable */
if (req->req.status != -EINPROGRESS) { if (req->req.status != -EINPROGRESS) {
...@@ -1460,7 +1474,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb, ...@@ -1460,7 +1474,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
if (rescan) if (rescan)
goto top; goto top;
} }
return limit; return sent;
} }
static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep) static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep)
...@@ -1890,7 +1904,7 @@ static void dummy_timer(unsigned long _dum_hcd) ...@@ -1890,7 +1904,7 @@ static void dummy_timer(unsigned long _dum_hcd)
default: default:
treat_control_like_bulk: treat_control_like_bulk:
ep->last_io = jiffies; ep->last_io = jiffies;
total = transfer(dum_hcd, urb, ep, limit, &status); total -= transfer(dum_hcd, urb, ep, limit, &status);
break; break;
} }
......
...@@ -2117,7 +2117,6 @@ static int gr_remove(struct platform_device *pdev) ...@@ -2117,7 +2117,6 @@ static int gr_remove(struct platform_device *pdev)
return -EBUSY; return -EBUSY;
gr_dfs_delete(dev); gr_dfs_delete(dev);
if (dev->desc_pool)
dma_pool_destroy(dev->desc_pool); dma_pool_destroy(dev->desc_pool);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
......
...@@ -1767,7 +1767,6 @@ static int mv_u3d_remove(struct platform_device *dev) ...@@ -1767,7 +1767,6 @@ static int mv_u3d_remove(struct platform_device *dev)
usb_del_gadget_udc(&u3d->gadget); usb_del_gadget_udc(&u3d->gadget);
/* free memory allocated in probe */ /* free memory allocated in probe */
if (u3d->trb_pool)
dma_pool_destroy(u3d->trb_pool); dma_pool_destroy(u3d->trb_pool);
if (u3d->ep_context) if (u3d->ep_context)
......
...@@ -2100,7 +2100,6 @@ static int mv_udc_remove(struct platform_device *pdev) ...@@ -2100,7 +2100,6 @@ static int mv_udc_remove(struct platform_device *pdev)
} }
/* free memory allocated in probe */ /* free memory allocated in probe */
if (udc->dtd_pool)
dma_pool_destroy(udc->dtd_pool); dma_pool_destroy(udc->dtd_pool);
if (udc->ep_dqh) if (udc->ep_dqh)
......
...@@ -551,6 +551,9 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) ...@@ -551,6 +551,9 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel)
} else { } else {
cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREQ_NONE); cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREQ_NONE);
/* delay to drain to cppi dma pipeline for isoch */
udelay(250);
csr = musb_readw(epio, MUSB_RXCSR); csr = musb_readw(epio, MUSB_RXCSR);
csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB); csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB);
musb_writew(epio, MUSB_RXCSR, csr); musb_writew(epio, MUSB_RXCSR, csr);
......
...@@ -225,8 +225,11 @@ static void dsps_musb_enable(struct musb *musb) ...@@ -225,8 +225,11 @@ static void dsps_musb_enable(struct musb *musb)
dsps_writel(reg_base, wrp->epintr_set, epmask); dsps_writel(reg_base, wrp->epintr_set, epmask);
dsps_writel(reg_base, wrp->coreintr_set, coremask); dsps_writel(reg_base, wrp->coreintr_set, coremask);
/* start polling for ID change. */ /* start polling for ID change in dual-role idle mode */
mod_timer(&glue->timer, jiffies + msecs_to_jiffies(wrp->poll_timeout)); if (musb->xceiv->otg->state == OTG_STATE_B_IDLE &&
musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE)
mod_timer(&glue->timer, jiffies +
msecs_to_jiffies(wrp->poll_timeout));
dsps_musb_try_idle(musb, 0); dsps_musb_try_idle(musb, 0);
} }
......
...@@ -31,6 +31,7 @@ static const struct i2c_device_id isp1301_id[] = { ...@@ -31,6 +31,7 @@ static const struct i2c_device_id isp1301_id[] = {
{ "isp1301", 0 }, { "isp1301", 0 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, isp1301_id);
static struct i2c_client *isp1301_i2c_client; static struct i2c_client *isp1301_i2c_client;
......
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