From: Jim Lin Date: Thu, 24 Jan 2013 18:38:05 +0800 Subject: [U-Boot] [PATCH 1/1 v2] console: USB: KBD: Fix incorrect autoboot timeout In-Reply-To: <20130123193349.17C612454A1@gemini.denx.de> References: <1358937511-32664-1-git-send-email-jilin@nvidia.com> <20130123193349.17C612454A1@gemini.denx.de> Message-ID: <1359023885.6248.6.camel@jilin-desktop> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2013-01-24 at 03:33 +0800, Wolfgang Denk wrote: > Dear Jim Lin, > > In message <1358937511-32664-1-git-send-email-jilin@nvidia.com> you wrote: > > Autoboot timeout defined by CONFIG_BOOTDELAY will not be accurate if > > CONFIG_USB_KEYBOARD and CONFIG_SYS_USB_EVENT_POLL are defined in > > configuration file and when tstc() function for checking key pressed > > takes longer time than 10 ms (e.g., 50 ms) to finish. > > Thanks. One minor nitpick... > > > + /* delay 1000 ms */ > > + ts = get_timer(0); > > + do { > > if (tstc()) { /* we got a key press */ > > abort = 1; /* don't auto boot */ > > bootdelay = 0; /* no more delay */ > > @@ -263,8 +263,7 @@ int abortboot(int bootdelay) > > # endif > > break; > > } > > - udelay(10000); > > - } > > + } while (!abort && get_timer(ts) < 1000); > > I recommend to keep a short udelay() [say, an udelay(1000)] in the > loop, as this will make sure that watchdog still gets triggered on > systems that need this. > I will keep udelay(10000); for safety in next patch. Thanks. -- nvpublic