[U-Boot] [PATCH] musb: add timeout via CONFIG_MUSB_TIMEOUT
Remy Bohmer
linux at bohmer.net
Tue Feb 10 21:11:55 CET 2009
Hello Mike,
2009/2/10 Mike Frysinger <vapier at gentoo.org>:
> From: Bryan Wu <bryan.wu at analog.com>
>
> + int timeout = CONFIG_MUSB_TIMEOUT;
>
> while (result > 0) {
> csr = readw(&musbr->txcsr);
> @@ -152,7 +153,17 @@ static int wait_until_ep0_ready(struct usb_device *dev, u32 bit_mask)
> }
> break;
> }
> +
> + /* Check the timeout */
> + if (--timeout)
> + udelay(1);
Hmm, I might be mistaken, but looking at this patch you seem to want
to timeout at CONFIG_MUSB_TIMEOUT,
but actually the timeout ends at CONFIG_MUSB_TIMEOUT-1.
Shouldn't it be: if (timeout--) instead of if (--timeout) ???
(some remark applies to all instances in this patch...)
Kind Regards,
Remy
More information about the U-Boot
mailing list