mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-25 13:14:19 +08:00
MUSB driver: Timeout is never detected as the while loop does not end
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 <Matej.Franceskin@comtrade.com> CC: Marek Vasut <matex@denx.de>?
This commit is contained in:
parent
749f8180c2
commit
8c86501819
@ -1113,7 +1113,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user