From: Jim Lin Date: Wed, 31 Jul 2013 17:48:19 +0800 Subject: [U-Boot] [PATCH v7 2/2] console: usb: kbd: To improve TFTP booting performance In-Reply-To: <20130719111727.201A9380ADF@gemini.denx.de> References: <1374226576-13401-1-git-send-email-jilin@nvidia.com> <1374226576-13401-2-git-send-email-jilin@nvidia.com> <20130719111727.201A9380ADF@gemini.denx.de> Message-ID: <1375264099.11294.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 Fri, 2013-07-19 at 19:17 +0800, Wolfgang Denk wrote: > Dear Jim Lin, > > In message <1374226576-13401-2-git-send-email-jilin@nvidia.com> you wrote: > > TFTP booting is slow when a USB keyboard is installed and > > stdin has usbkbd added. > > This fix is to change Ctrl-C polling for USB keyboard to every second > > when NET transfer is running. > ... > > +#ifdef CONFIG_CMD_NET > > +/* The period of time between two calls of usb_kbd_testc(). */ > > +static unsigned long kbd_testc_tms; > > +#endif > > > > /* Generic keyboard event polling. */ > > void usb_kbd_generic_poll(void) > > @@ -366,6 +370,16 @@ static int usb_kbd_testc(void) > > struct usb_device *usb_kbd_dev; > > struct usb_kbd_pdata *data; > > > > +#ifdef CONFIG_CMD_NET > > + /* > > + * If net_busy_flag is 1, NET transfer is running, > > + * then we check key pressed every second to improve > > + * TFTP booting performance. > > + */ > > + if (net_busy_flag && (get_timer(kbd_testc_tms) < CONFIG_SYS_HZ)) > > + return 0; > > + kbd_testc_tms = get_timer(0); > > +#endif > > You did not comment on my remark about kbd_testc_tms being used > basically with a random start value for each invocation of a network > command. The "every second" above is wrong. The actual interval may > be much shorter (even nearly zero, at least once), or longer. I will change the comment as the following. /* * If net_busy_flag is 1, NET transfer is running, * then we check key pressed every second (first check * may be less than 1 second) * to improve TFTP booting performance. */ The behavior you mentioned is not that critical. --nvpublic