From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 30 Aug 2012 20:35:23 +0200 Subject: [U-Boot] [PATCH] MUSB driver: Timeout is never detected as the while loop does not end In-Reply-To: <6AB4CEAFA8401D4B880B2C9D8BEBA82D3533D5BD@mail.hermes.si> References: <1346198876-31080-1-git-send-email-amartin@nvidia.com> <1346198876-31080-8-git-send-email-amartin@nvidia.com> <6AB4CEAFA8401D4B880B2C9D8BEBA82D3533D5BD@mail.hermes.si> Message-ID: <201208302035.23296.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 Dear Matej Fran?e?kin, > Timeout variable is decremented once more when while condition is not met. > Following "if" does not detect correctly that timeout has occurred. > Because of this bug the "usb start" command on AM335X-EVM board did not > detect correctly that USB device was not attached. > > timeout = musb_cfg.timeout; > while (timeout--) > if (readb(&musbr->devctl) & MUSB_DEVCTL_HM) > break; > /* if musb core is not in host mode, then return */ > if (!timeout) > return -1; > > > Signed-off-by: Matej Franceskin > CC: Marek Vasut ? Applied, thanks Best regards, Marek Vasut