[U-Boot] [PATCH] MUSB driver: Timeout is never detected as the while loop does not end

Tom Rini trini at ti.com
Thu Aug 30 20:18:37 CEST 2012


On Thu, Aug 30, 2012 at 09:24:39AM +0200, Matej Fran?e?kin wrote:

> 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 at comtrade.com>
> CC: Marek Vasut <matex at denx.de>?

Acked-by: Tom Rini <trini at ti.com>

-- 
Tom


More information about the U-Boot mailing list