From patchwork Mon Jul 4 16:12:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Orjan Friberg X-Patchwork-Id: 103132 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 47A87B6F6E for ; Tue, 5 Jul 2011 02:12:28 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7DB2D2809B; Mon, 4 Jul 2011 18:12:26 +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 LsIVvKiCxRR8; Mon, 4 Jul 2011 18:12:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 518C528093; Mon, 4 Jul 2011 18:12:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F06728093 for ; Mon, 4 Jul 2011 18:12:21 +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 nSTcnZdcGAh1 for ; Mon, 4 Jul 2011 18:12:18 +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 fg-dc1.flatfrog.local (hd5b91d02.k46641.sta.perspektivbredband.net [213.185.29.2]) by theia.denx.de (Postfix) with ESMTPS id 61CC328090 for ; Mon, 4 Jul 2011 18:12:16 +0200 (CEST) Received: from onfg03.flatfrog.local (192.168.123.10) by fg-dc1.flatfrog.local (192.168.123.3) with Microsoft SMTP Server id 8.3.83.0; Mon, 4 Jul 2011 18:12:13 +0200 From: Orjan Friberg To: Date: Mon, 4 Jul 2011 18:12:12 +0200 Message-ID: <1309795932-17154-1-git-send-email-of@flatfrog.com> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 Received-SPF: None (fg-dc1.flatfrog.local: of@flatfrog.com does not designate permitted sender hosts) X-TM-AS-Product-Ver: SMEX-8.6.0.1168-6.500.1024-18238.004 X-TM-AS-Result: No--6.719200-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Subject: [U-Boot] [PATCH v2] MUSB timeout broken X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Use pre-decrement to leave timeout at 0 when the timeout happens (which is what the timeout detecting code expects). Signed-off-by: Orjan Friberg --- drivers/usb/musb/musb_hcd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c index 974bb31..adcf7f7 100644 --- a/drivers/usb/musb/musb_hcd.c +++ b/drivers/usb/musb/musb_hcd.c @@ -1114,7 +1114,7 @@ int usb_lowlevel_init(void) * should be a usb device connected. */ timeout = musb_cfg.timeout; - while (timeout--) + while (--timeout) if (readb(&musbr->devctl) & MUSB_DEVCTL_HM) break;