From patchwork Thu Sep 26 01:41:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 278062 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 216272C03D7 for ; Thu, 26 Sep 2013 11:43:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4B4454A065; Thu, 26 Sep 2013 03:43:08 +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 gO7f7HNAsKXT; Thu, 26 Sep 2013 03:43:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 57F714A0C0; Thu, 26 Sep 2013 03:41:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1C4A34A0B5 for ; Thu, 26 Sep 2013 03:41:45 +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 ybDxQfj78p3j for ; Thu, 26 Sep 2013 03:41:38 +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-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by theia.denx.de (Postfix) with ESMTPS id 736684A090 for ; Thu, 26 Sep 2013 03:41:13 +0200 (CEST) Received: by mail-pb0-f54.google.com with SMTP id ro12so433432pbb.27 for ; Wed, 25 Sep 2013 18:41:12 -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=nxaLOIRS9IXxqiP9tmijPneazxJ7q7iD1eUA/00I4+4=; b=HbOFWNOJv+w+ByFk3prf5CZq8ntR44zd8KOGF63+DWcWgzcaOOUrjoLAja7+Bq6PMg WzRDDX9l1wBlVuTrFKZDxhlZD2m7UWIut3kcFf8vzc7iwHG9AGXm75yUusgHqGDzwcHA 315reqeT7r+fLoERJ8Pq0Kw6KOpWVYDVKKFaMkQH+zqVfmDtetPo3zSgiqvlNc7pSii0 3ug5oeFV686BrzhAQPt3Vn+hnOdYOofFJE8U6sFYbjKOfJzQdFUA0GjInzP6c1OW9aHU phgIGk8o1HFxU6rXybrv5jVNC5zqpPViV1ykryEnTQdK0wIaIpmzg/4lUcURb6j0wFjB vO1w== X-Gm-Message-State: ALoCoQnFAyUrw/NoqQxwep9kSTPl8W0L3k119QWivwgRxWjg5fS9dv8xuNTYszWez4RxKrzHBAOH X-Received: by 10.68.215.38 with SMTP id of6mr36484613pbc.14.1380159672001; Wed, 25 Sep 2013 18:41:12 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPSA id xe9sm1152735pab.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Sep 2013 18:41:10 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.80) (envelope-from ) id 1VP0a4-0006tj-B4; Wed, 25 Sep 2013 18:41:24 -0700 From: Troy Kisky To: marek.vasut@gmail.com Date: Wed, 25 Sep 2013 18:41:12 -0700 Message-Id: <1380159678-26416-13-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1380159678-26416-1-git-send-email-troy.kisky@boundarydevices.com> References: <1380159678-26416-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 V5 12/18] 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 v5: 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 a2cbe67..3509aa8 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;