From patchwork Fri Sep 20 03:29: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: 276199 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 B80FB2C0126 for ; Fri, 20 Sep 2013 13:37:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4BD284A176; Fri, 20 Sep 2013 05:37:10 +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 xndYYS3eeKFs; Fri, 20 Sep 2013 05:37:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1515C4A19B; Fri, 20 Sep 2013 05:37:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A0424A15D for ; Fri, 20 Sep 2013 05:36: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 OOZmQpcSS2TC for ; Fri, 20 Sep 2013 05:36:49 +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-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by theia.denx.de (Postfix) with ESMTPS id 791494A167 for ; Fri, 20 Sep 2013 05:36:43 +0200 (CEST) Received: by mail-pa0-f44.google.com with SMTP id fz6so201413pac.3 for ; Thu, 19 Sep 2013 20:36:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f/cXA++3YeRkcRYdT9ZHRW3UY2HyIpQYyFadiJ5JLuE=; b=LD9W3jaBVp4E4+sjPKqXNROchpi8UJTHaX1OaaQqaokko0+voLLXFbk11I+j0++OCs DivqKIBGxFNtUxzSzo2a9WKbr/7f1zfIn+03EgrWa0drOOZZNa2VRQL7WHycnZJ2nCv0 eJG3RuSMNjj7wVQsRaxLRsSxSCncDR9dkQkU9N85iq/ie1HJ92+ta91+ier9jJogywpS o6e/vl1J2zttrgw5q+9f+jKILMuW4fhwYbzjqPryPCQc/oQfAgZJ1x6NT19jjdsGM6/E FJExInHxm8ciqgNPKgdhd3+b48Ozyo72ue0wyF84txL7drTIid9Vq5LGMmk4MTru3niH E5Og== X-Gm-Message-State: ALoCoQlB0u8qzGyrKNEXCCEggZ7ztVWQ9rGbk449VqXLblyjcE/CMmOTY3tNHoGuh4VSj9X/yZp+ X-Received: by 10.66.49.68 with SMTP id s4mr6318061pan.98.1379647775634; Thu, 19 Sep 2013 20:29:35 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPSA id go4sm12611416pbb.15.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Sep 2013 20:29:34 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.80) (envelope-from ) id 1VMrPe-0000hu-CF; Thu, 19 Sep 2013 20:29:46 -0700 From: Troy Kisky To: marek.vasut@gmail.com Date: Thu, 19 Sep 2013 20:29:34 -0700 Message-Id: <1379647780-2623-12-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1379647780-2623-1-git-send-email-troy.kisky@boundarydevices.com> References: <1379647780-2623-1-git-send-email-troy.kisky@boundarydevices.com> Cc: fabio.estevam@freescale.com, otavio@ossystems.com.br, leiwen@marvell.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V4 11/17] 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 --- v4: no change --- 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 97bab93..075b039 100644 --- a/drivers/usb/gadget/mv_udc.c +++ b/drivers/usb/gadget/mv_udc.c @@ -347,21 +347,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;