Re: [PATCH] MUSB HOST DMA transfers greater than MUSBHSDMA max channel length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 09, 2010 at 05:43:49AM -0500, Anil Shetty wrote:
Add support for MUSB Host DMA transfers greater than MUSBHSDMA max
channel length, so that transfers greater than max channel length
wont be truncated.

Signed-off-by: Anil Shetty <anil@xxxxxx>
Cc: Felipe Balbi <me@xxxxxxxxxxxxxxx>

balbi@xxxxxx

@@ -1118,6 +1118,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
	u32			status = 0;
	void __iomem		*mbase = musb->mregs;
	struct dma_channel	*dma;
+	bool			transfer_pending = false;

	musb_ep_select(mbase, epnum);
	tx_csr = musb_readw(epio, MUSB_TXCSR);
@@ -1278,7 +1279,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
				offset = d->offset;
				length = d->length;
			}
-		} else if (dma) {
+		} else if (dma && (urb->transfer_buffer_length == qh->offset)) {
			done = true;
		} else {
			/* see if we need to send more data, or ZLP */
@@ -1291,6 +1292,7 @@ void musb_host_tx(struct musb *musb, u8 epnum)
			if (!done) {
				offset = qh->offset;
				length = urb->transfer_buffer_length - offset;
+				transfer_pending = true;
			}
		}
	}
@@ -1310,7 +1312,11 @@ void musb_host_tx(struct musb *musb, u8 epnum)
		urb->actual_length = qh->offset;
		musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT);
		return;
-	} else	if (usb_pipeisoc(pipe) && dma) {
+	} else if (transfer_pending && dma) {
+		if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb,
+				offset, length))
+			return;
+	} else if (usb_pipeisoc(pipe) && dma) {
		if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb,
				offset, length)) {
			if (is_cppi_enabled() || tusb_dma_omap())

unfortunately, I don't have currently how to test this patch, so it'll
be waiting a bit :-s sorry.

--
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux