1 Fixes blurred capture images in dma mode. Isochronous error field in
2 urb and source data buffer pointer were not updated properly in dma
5 Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
7 diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
8 index 08e421f..a481d54 100644
9 --- a/drivers/usb/musb/musb_host.c
10 +++ b/drivers/usb/musb/musb_host.c
11 @@ -1505,10 +1505,29 @@ void musb_host_rx(struct musb *musb, u8 epnum)
12 musb_writew(hw_ep->regs, MUSB_RXCSR, val);
14 #ifdef CONFIG_USB_INVENTRA_DMA
15 + if (usb_pipeisoc(pipe)) {
16 + struct usb_iso_packet_descriptor *d;
18 + d = urb->iso_frame_desc + qh->iso_idx;
19 + d->actual_length = xfer_len;
21 + /* even if there was an error, we did the dma
22 + * for iso_frame_desc->length
24 + if (d->status != EILSEQ && d->status != -EOVERFLOW)
27 + if (++qh->iso_idx >= urb->number_of_packets)
33 /* done if urb buffer is full or short packet is recd */
34 done = (urb->actual_length + xfer_len >=
35 urb->transfer_buffer_length
36 || dma->actual_len < qh->maxpacket);
39 /* send IN token for next packet, without AUTOREQ */
41 @@ -1545,7 +1564,8 @@ void musb_host_rx(struct musb *musb, u8 epnum)
43 struct dma_controller *c;
49 rx_count = musb_readw(epio, MUSB_RXCOUNT);
51 @@ -1558,6 +1578,35 @@ void musb_host_rx(struct musb *musb, u8 epnum)
53 c = musb->dma_controller;
55 + if (usb_pipeisoc(pipe)) {
57 + struct usb_iso_packet_descriptor *d;
59 + d = urb->iso_frame_desc + qh->iso_idx;
65 + if (rx_count > d->length) {
67 + status = -EOVERFLOW;
70 + DBG(2, "** OVERFLOW %d into %d\n",\
71 + rx_count, d->length);
77 + buf = urb->transfer_dma + d->offset;
80 + buf = urb->transfer_dma +
84 dma->desired_mode = 0;
86 /* because of the issue below, mode 1 will
87 @@ -1569,6 +1618,12 @@ void musb_host_rx(struct musb *musb, u8 epnum)
90 dma->desired_mode = 1;
91 + if (rx_count < hw_ep->max_packet_sz_rx) {
93 + dma->bDesiredMode = 0;
95 + length = urb->transfer_buffer_length;
99 /* Disadvantage of using mode 1:
100 @@ -1606,12 +1661,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
102 ret = c->channel_program(
106 - + urb->actual_length,
107 - (dma->desired_mode == 0)
109 - : urb->transfer_buffer_length);
110 + dma->desired_mode, buf, length);
113 c->channel_release(dma);
114 @@ -1628,19 +1678,6 @@ void musb_host_rx(struct musb *musb, u8 epnum)
118 - if (dma && usb_pipeisoc(pipe)) {
119 - struct usb_iso_packet_descriptor *d;
120 - int iso_stat = status;
122 - d = urb->iso_frame_desc + qh->iso_idx;
123 - d->actual_length += xfer_len;
125 - iso_stat = -EILSEQ;
126 - urb->error_count++;
128 - d->status = iso_stat;
132 urb->actual_length += xfer_len;
133 qh->offset += xfer_len;
135 To unsubscribe from this list: send the line "unsubscribe linux-omap" in
136 the body of a message to majordomo@vger.kernel.org
137 More majordomo info at http://vger.kernel.org/majordomo-info.html