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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWAF8tAAoJEIaOsuA1yqREmlcQALFf3vheeMxu095CX1YKhuGK
 ktqRaSg/3Uwq3h6M1PJ8nf/n/oJQFbOJvMgZlKU5JgJy0fnyQIah1sUOkQCcisHM
 EWvfzAfa12yMX5Z9vCQbRksjkPg4ckte8vDhqCturNocYUPqid4KntU7G+8GTtqR
 OvnjN35foEkT01y2SW2JK/l6ZGoqfQ9etgVgfs+2FzEBTfjtT1Yi9uovi6V/pjCF
 h3KAhR340EK7jUg/+p6wFBDgvRS9FenuV5BebT+mldWMWGfAMwLNB06v2fbOZ+Jh
 +zAT/kq/l0gIRER6MIdR8hqzIzIWI4bmD/huCmi55auK3pP5zMwRvl2vifp2feVQ
 FI4WbL/44Tsr+N/PlB1iG82iI4XmYrwv72NWn9K0vbY9vzS7LSvoS9COpeFYTaAE
 6+k/sB5Sw6eYPeeM4kdjKD+XfWpki2b9jxsgYKo01et6MvDoOwEvtGyCeBohYUF1
 WwJulAPk/8cmZiI1JL4Rf8CDV+fOB2DHvVtKcnpQjlvdDud2sl6bIdT/zdceCidJ
 F6+bu9JRuM2MFNbJChut1iJOiecoJMXeII00IDynCmQtg1fyDTS2+Un725rSqDxD
 /+PXZqXFqpW8TBrToBPJGx0uiwBJciDXUN8hX/O+E6S3wmGeJYDHKspPQUA2iJvK
 BSbCrIDsQEb6m3NS7bR8
 =Lyn+
 -----END PGP SIGNATURE-----

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.
This commit is contained in:
Greg Kroah-Hartman 2015-09-21 22:21:31 -07:00
commit 01f4fd2a4f
10 changed files with 54 additions and 30 deletions

View file

@ -2665,8 +2665,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
int i;
irqreturn_t ret = IRQ_NONE;
spin_lock(&dwc->lock);
for (i = 0; i < dwc->num_event_buffers; i++) {
irqreturn_t status;
@ -2675,8 +2673,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc)
ret = status;
}
spin_unlock(&dwc->lock);
return ret;
}

View file

@ -2002,6 +2002,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
ep->udc = udc;
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)
list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);

View file

@ -324,8 +324,7 @@ static void bdc_mem_free(struct bdc *bdc)
bdc->scratchpad.buff, bdc->scratchpad.sp_dma);
/* 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 */
kfree(bdc->bdc_ep_array);

View file

@ -1348,6 +1348,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
{
struct dummy *dum = dum_hcd->dum;
struct dummy_request *req;
int sent = 0;
top:
/* if there's no request queued, the device is NAKing; return */
@ -1385,12 +1386,15 @@ top:
if (len == 0)
break;
/* use an extra pass for the final short packet */
if (len > ep->ep.maxpacket) {
rescan = 1;
len -= (len % ep->ep.maxpacket);
/* send multiple of maxpacket first, then remainder */
if (len >= ep->ep.maxpacket) {
is_short = 0;
if (len % ep->ep.maxpacket)
rescan = 1;
len -= len % ep->ep.maxpacket;
} else {
is_short = 1;
}
is_short = (len % ep->ep.maxpacket) != 0;
len = dummy_perform_transfer(urb, req, len);
@ -1399,6 +1403,7 @@ top:
req->req.status = len;
} else {
limit -= len;
sent += len;
urb->actual_length += len;
req->req.actual += len;
}
@ -1421,7 +1426,7 @@ top:
*status = -EOVERFLOW;
else
*status = 0;
} else if (!to_host) {
} else {
*status = 0;
if (host_len > dev_len)
req->req.status = -EOVERFLOW;
@ -1429,15 +1434,24 @@ top:
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 {
if (req->req.length == req->req.actual
&& !req->req.zero)
req->req.status = 0;
if (urb->transfer_buffer_length == urb->actual_length
&& !(urb->transfer_flags
& URB_ZERO_PACKET))
*status = 0;
if (req->req.length == req->req.actual) {
if (req->req.zero && to_host)
rescan = 1;
else
req->req.status = 0;
}
if (urb->transfer_buffer_length == urb->actual_length) {
if (urb->transfer_flags & URB_ZERO_PACKET &&
!to_host)
rescan = 1;
else
*status = 0;
}
}
/* device side completion --> continuable */
@ -1460,7 +1474,7 @@ top:
if (rescan)
goto top;
}
return limit;
return sent;
}
static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep)
@ -1890,7 +1904,7 @@ restart:
default:
treat_control_like_bulk:
ep->last_io = jiffies;
total = transfer(dum_hcd, urb, ep, limit, &status);
total -= transfer(dum_hcd, urb, ep, limit, &status);
break;
}

View file

@ -2117,8 +2117,7 @@ static int gr_remove(struct platform_device *pdev)
return -EBUSY;
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);
gr_free_request(&dev->epi[0].ep, &dev->ep0reqi->req);

View file

@ -1767,8 +1767,7 @@ static int mv_u3d_remove(struct platform_device *dev)
usb_del_gadget_udc(&u3d->gadget);
/* 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)
dma_free_coherent(&dev->dev, u3d->ep_context_size,

View file

@ -2100,8 +2100,7 @@ static int mv_udc_remove(struct platform_device *pdev)
}
/* 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)
dma_free_coherent(&pdev->dev, udc->ep_dqh_size,

View file

@ -551,6 +551,9 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel)
} else {
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_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB);
musb_writew(epio, MUSB_RXCSR, csr);

View file

@ -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->coreintr_set, coremask);
/* start polling for ID change. */
mod_timer(&glue->timer, jiffies + msecs_to_jiffies(wrp->poll_timeout));
/* start polling for ID change in dual-role idle mode */
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);
}

View file

@ -31,6 +31,7 @@ static const struct i2c_device_id isp1301_id[] = {
{ "isp1301", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, isp1301_id);
static struct i2c_client *isp1301_i2c_client;