From patchwork Thu Aug 1 23:27:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 264164 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 800462C0084 for ; Fri, 2 Aug 2013 09:31:37 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A27104A12A; Fri, 2 Aug 2013 01:30:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fMR9zd8ZrSYm; Fri, 2 Aug 2013 01:30:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 19D314A12F; Fri, 2 Aug 2013 01:28:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 222DF4A0FD for ; Fri, 2 Aug 2013 01:28:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3F8BokZ1QK+c for ; Fri, 2 Aug 2013 01:28:34 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by theia.denx.de (Postfix) with ESMTPS id 1DA994A08B for ; Fri, 2 Aug 2013 01:27:53 +0200 (CEST) Received: by mail-pb0-f51.google.com with SMTP id jt11so2621936pbb.38 for ; Thu, 01 Aug 2013 16:27:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hvqjbHv4JEMf2wvOGc9b3+jSrBBEAV0DE3LQsviMVxQ=; b=WuR0Evx6XEILhXVFFRtNm2fgGfIJEcrFwfC9G3FJ6qw7qeavmvIJCCe3Wlfa6+Wo1s /4noOV/RtgkLwNjhkFqwkCQ34dcyRYrgSnz3so7DtLf89Lg+vYi38aUGzN6p8bnEZuT0 wdd+qjnDAMNmshL1Ca3VeH0OSNbWYJcW3dsvNybop8ImVphv0bvO3pqCn8X0DgTi47Aj PAM1MEF9sEzIcqzC7PTJS6lQu8EmzLBbxJkBhhC9Ylw9RVvzBu36ox/qflFb2ba54Z2T MYWFQ4ZApQv/0OMGx+9KVqiDS8sxdQHWOg4Q8xxWasSiFqTRgynXLirLR82hbY1TiHDs Mizg== X-Received: by 10.68.179.194 with SMTP id di2mr4442177pbc.203.1375399672028; Thu, 01 Aug 2013 16:27:52 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPSA id w8sm6622754pab.12.2013.08.01.16.27.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Aug 2013 16:27:51 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.80) (envelope-from ) id 1V52HX-0006hf-US; Thu, 01 Aug 2013 16:27:43 -0700 From: Troy Kisky To: marek.vasut@gmail.com Date: Thu, 1 Aug 2013 16:27:34 -0700 Message-Id: <1375399657-25642-18-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1375399657-25642-1-git-send-email-troy.kisky@boundarydevices.com> References: <1375399657-25642-1-git-send-email-troy.kisky@boundarydevices.com> X-Gm-Message-State: ALoCoQn39A7yNHiZ45rK1S/xmiH3OFaVqZwmPgIzwIHuxupRi0ciiSYpGcZoDTAgYCdkgcjKPPUT Cc: fabio.estevam@freescale.com, otavio@ossystems.com.br, leiwen@marvell.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V3 17/20] usb: gadget: mv_udc: flush item before head X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Make sure the transfer descriptor is flushed before the queue is updated so that the controller will not see old information. Signed-off-by: Troy Kisky --- drivers/usb/gadget/mv_udc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c index 6e0f9bb..2bf4bc0 100644 --- a/drivers/usb/gadget/mv_udc.c +++ b/drivers/usb/gadget/mv_udc.c @@ -362,21 +362,20 @@ static int mv_ep_queue(struct usb_ep *ep, item->info = INFO_BYTES(len) | INFO_IOC | INFO_ACTIVE; item->page0 = (uint32_t)mv_ep->b_buf; item->page1 = ((uint32_t)mv_ep->b_buf & 0xfffff000) + 0x1000; + mv_flush_qtd(num); head->next = (unsigned) item; head->info = 0; DBG("ept%d %s queue len %x, buffer %p\n", num, in ? "in" : "out", len, mv_ep->b_buf); + mv_flush_qh(num); if (in) bit = EPT_TX(num); else bit = EPT_RX(num); - mv_flush_qh(num); - mv_flush_qtd(num); - writel(bit, &udc->epprime); return 0;