From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Wed, 03 Jul 2013 13:20:23 +0200 Subject: [U-Boot] [PATCH v4 1/1] NET: Improve TFTP booting performance when CONFIG_USB_KEYBOARD In-Reply-To: <1372847667-31928-1-git-send-email-jilin@nvidia.com> References: <1372847667-31928-1-git-send-email-jilin@nvidia.com> Message-ID: <20130703112023.6172D380A2C@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Jim Lin, In message <1372847667-31928-1-git-send-email-jilin@nvidia.com> you wrote: > TFTP booting is slow when a USB keyboard is installed and > CONFIG_USB_KEYBOARD is defined. > The fix is to change Ctrl-C polling to every second when NET transfer > is running. I'm not sure if we can accept this implementation. > +#ifdef CONFIG_USB_KEYBOARD > + /* > + * Reduce ctrl-c checking to 1 second once > + * to improve TFTP boot performance. > + */ > + ctrlc_t = get_timer(kbd_ctrlc_tms); > + if (ctrlc_t > CONFIG_SYS_HZ) { > + ctrlc_result = ctrlc(); > + kbd_ctrlc_tms = get_timer(0); > + } else { > + ctrlc_result = 0; > + } > + if (ctrlc_result) { > +#else get_timer() is used by a number of network related services. For information, just grep for it in the net/ and drivers/net/ directories. The "get_timer(0)" used in your code resets a global resource, and has thus the potential of messing up a number of timeouts running elsewhere in the network code. I wonder to which extend this has actually been considered (and tested) ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Alan Turing thought about criteria to settle the question of whether machines can think, a question of which we now know that it is about as relevant as the question of whether submarines can swim. -- Edsger Dijkstra