Re: [PATCH 1/2] USB: musb: gadget: fix dma mode 0 in double buffer Rx case(V1)

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

 



Hello.

tom.leiming@xxxxxxxxx wrote:

From: Ming Lei <tom.leiming@xxxxxxxxx>

1, In Rx double buffer case, FIFO may have two packets, so
rxstate should be called to unload fifo if RXPKTRDY is set
even the current request has not been completed.

2, Commit 	490e5fbe8ccb198fb719ae49eaa0c7071273e016
[usb: musb:gadget: enable autoclear for OUT transfer in both DMA 0 and DMA 1]
introduces autoclear to support double buffer in dma mode 0,
so remove clearing RXPKTRDY manually for dma mode 0.

3, Felipe's patch[usb: musb: gadget: only enable AUTOCLEAR in double
buffered case] may break dma mode 1 for non-doublebuffer endpoint, fix it.

With this patch, either usbtest #5 or g_file_storage(writing
file to device in usb host) or g_ether have been tested OK in
double buffer case(using fifo mode 3). Also, this patch has
been verified that single buffer case can't be broken.

Cc: Felipe Balbi <balbi@xxxxxx>
Cc: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
Cc: Anand Gadiyar <gadiyar@xxxxxx>
Cc: Mike Frysinger <vapier@xxxxxxxxxx>
Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxx
Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>

[...]

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 66585e2..256e555 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
[...]
@@ -877,8 +879,16 @@ void musb_g_rx(struct musb *musb, u8 epnum)
 		/* incomplete, and not short? wait for next IN packet */
 		if ((request->actual < request->length)
 				&& (musb_ep->dma->actual_len
-					== musb_ep->packet_sz))
+					== musb_ep->packet_sz)) {
+			/* In double buffer case, continue to unload fifo if
+ 			 * there is Rx packet in FIFO.

   You use either 'fifo' and 'FIFO'. Stick to 'FIFO' please.

+ 			 **/

   No double asterisk please. Multi-line comment should look like:

/*
 * This is the first line
 * and this is the second one
 */

WBR, Sergei
--
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