Re: [PATCH V3] usb: dwc3: Handle pending control data out correctly

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

 



On 5/4/2012 3:15 PM, Felipe Balbi wrote:
On Thu, May 03, 2012 at 07:05:05PM +0530, Pratyush Anand wrote:
If transfer not ready is received before ep_queue is called for control
out transfer then pending flag is set. Handling of this case was not
correct.
TRB size must be multiple of maxpacket for all control out transfer.
dma sync function should also be called before start transfer.

A routine to delegate transfer for control data has been extracted out
from dwc3_ep0_do_control_data. Same routine has been called from
ep_queue too in case of pending flag is set.

Signed-off-by: Pratyush Anand<pratyush.anand@xxxxxx>
Signed-off-by: Felipe Balbi<balbi@xxxxxx>
---
  drivers/usb/dwc3/ep0.c |   90 +++++++++++++++++++++++++----------------------
  1 files changed, 48 insertions(+), 42 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 1f917d9..f0c5f85 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -119,6 +119,49 @@ static int dwc3_ep0_start_trans(struct dwc3 *dwc, u8 epnum, dma_addr_t buf_dma,
  	return 0;
  }

+static int dwc3_ep0_start_data_trans(struct dwc3 *dwc,
+		struct dwc3_request *req)
+{
+	u32 transfer_size = req->request.length;
+	struct dwc3_ep *dep = dwc->eps[0];

you can't hardcode this to ep0. Physical endpoint 0 is *ONLY* for OUT
direction. physical endpoint 1 is *ONLY* for in direction.

But , If I see original dwc3_ep0_do_control_data, then it does hard code to ep0.
--
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