From: Christophe Lebouc Date: Thu, 30 Sep 2010 14:34:36 +0000 (+0100) Subject: usb: langwell_udc: fix big file transfer issue. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c8458d59d424fcba2456d6cba5811ce01c3aedb9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: langwell_udc: fix big file transfer issue. This patch fixing the problem with large file transfers failing. Swap the read order to avoid unexpected RX status. Signed-off-by: Christophe Lebouc Signed-off-by: Hao Wu Signed-off-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c index d297f9eb92e4..064306046702 100644 --- a/drivers/usb/gadget/langwell_udc.c +++ b/drivers/usb/gadget/langwell_udc.c @@ -2440,12 +2440,14 @@ static int process_ep_req(struct langwell_udc *dev, int index, dev_vdbg(&dev->pdev->dev, "---> %s()\n", __func__); for (i = 0; i < curr_req->dtd_count; i++) { - remaining_length = le16_to_cpu(curr_dtd->dtd_total); - actual -= remaining_length; /* command execution states by dTD */ dtd_status = curr_dtd->dtd_status; + barrier(); + remaining_length = le16_to_cpu(curr_dtd->dtd_total); + actual -= remaining_length; + if (!dtd_status) { /* transfers completed successfully */ if (!remaining_length) {