From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 18 Dec 2013 15:55:47 +0100 Subject: [U-Boot] [PATCH 2/2] usb: gadget: fotg210: EP0 fifo empty indication is non-reliable In-Reply-To: <1387351489-2008-3-git-send-email-dantesu@gmail.com> References: <1387351489-2008-1-git-send-email-dantesu@gmail.com> <1387351489-2008-3-git-send-email-dantesu@gmail.com> Message-ID: <201312181555.47125.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday, December 18, 2013 at 08:24:49 AM, Kuo-Jung Su wrote: > From: Kuo-Jung Su > > Because the EP0 fifo empty indication is non-reliable, > an extra delay is necessary to avoid data corruption while > handling packets with size greater than 64 bytes. > > This workaround should be applied to all hardware revisions. > > Signed-off-by: Kuo-Jung Su > CC: Marek Vasut > --- > drivers/usb/gadget/fotg210.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/gadget/fotg210.c b/drivers/usb/gadget/fotg210.c > index e3a61cc..14bfec6 100644 > --- a/drivers/usb/gadget/fotg210.c > +++ b/drivers/usb/gadget/fotg210.c > @@ -245,6 +245,7 @@ static int fotg210_dma(struct fotg210_ep *ep, struct > fotg210_request *req) if (ep->id == 0) { > /* Wait until cx/ep0 fifo empty */ > fotg210_cxwait(chip, CXFIFO_CXFIFOE); > + udelay_masked(1); Why don't you use regular udelay() here please ? Also, how exactly does the delay help solving the unreliability problem please? > writel(DMAFIFO_CX, ®s->dma_fifo); > } else { > /* Wait until epx fifo empty */ Best regards, Marek Vasut