From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] MUSB driver: Timeout is never detected as the while loop does not end
Date: Wed, 29 Aug 2012 13:00:01 +0200 [thread overview]
Message-ID: <201208291300.01813.marex@denx.de> (raw)
In-Reply-To: <6AB4CEAFA8401D4B880B2C9D8BEBA82D3533D105@mail.hermes.si>
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;
>
CCing Tom, SoB line missing, please read http://www.denx.de/wiki/U-Boot/Patches
> ---
> drivers/usb/musb/musb_hcd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c
> index 2df52c1..8d44c46 100644
> --- a/drivers/usb/musb/musb_hcd.c
> +++ b/drivers/usb/musb/musb_hcd.c
> @@ -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;
> /* if musb core is not in host mode, then return */
> if (!timeout)
> return -1;
Best regards,
Marek Vasut
next prev parent reply other threads:[~2012-08-29 11:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-29 0:07 [U-Boot] [PATCH v10 00/16] split tegra20 arm7 code into separate SPL Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 01/16] tegra20: rename tegra2 -> tegra20 Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 02/16] tegra20: move tegra20 SoC code to arch/arm/cpu/tegra20-common Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 03/16] tegra20: rename CONFIG_MACH_TEGRA_GENERIC Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 04/16] tegra20: tec: add tegra20-common-post.h Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 05/16] tegra20: make board mkdir commands unconditional Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 06/16] mkconfig: remove bashisms and cleanup config.mk generation Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 07/16] MAKEALL: update to work with new boards.cfg syntax Allen Martin
2012-08-29 8:22 ` [U-Boot] [PATCH] MUSB driver: Timeout is never detected as the while loop does not end Matej Frančeškin
2012-08-29 11:00 ` Marek Vasut [this message]
2012-08-30 7:24 ` Matej Frančeškin
2012-08-30 18:18 ` Tom Rini
2012-08-30 18:35 ` Marek Vasut
2012-08-29 0:07 ` [U-Boot] [PATCH v10 08/16] ARM: Fix arm720t SPL build Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 09/16] tegra20: remove timer_init from " Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 10/16] ARM: add tegra20 support to arm720t Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 11/16] tegra20: add u-boot-*-tegra.bin targets Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 12/16] tegra20: move SDRAM param save to later in boot Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 13/16] tegra20: enable SPL for tegra20 boards Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 14/16] arm: enable libgcc build for SPL Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 15/16] spl: fix SPL build of private libgcc Allen Martin
2012-08-29 0:07 ` [U-Boot] [PATCH v10 16/16] tegra20: Remove armv4t build flags Allen Martin
2012-08-29 16:55 ` [U-Boot] [PATCH v10 00/16] split tegra20 arm7 code into separate SPL Tom Warren
2012-08-29 18:33 ` [U-Boot] ./MAKEALL arm is buggy Allen Martin
2013-02-09 7:31 ` Albert ARIBAUD
2013-02-09 7:34 ` [U-Boot] ./MAKEALL arm is buggy - scratch that Albert ARIBAUD
2012-08-29 20:54 ` [U-Boot] [PATCH v10 00/16] split tegra20 arm7 code into separate SPL Lucas Stach
[not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379E005CEF@HQMAIL04.nvidia.com>
2012-08-30 8:41 ` Albert ARIBAUD
2012-08-30 15:42 ` Tom Warren
2012-08-30 16:30 ` Allen Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208291300.01813.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.