[U-Boot] [PATCH 1/2] NS16550: buffer reads

Wolfgang Denk wd at denx.de
Wed Apr 6 22:42:12 CEST 2011


Dear Scott Wood,

In message <20110406203012.GA30167 at schlenkerla.am.freescale.net> you wrote:
> This improves the performance of U-Boot when accepting rapid input,
> such as pasting a sequence of commands.
...
> +static struct ns16550_priv rxstate[NUM_PORTS];

Do we really need to statically allocate these buffers for all
configured serial ports?  Actual I/O will always be done to a single
port only, so eventually only one such buffer will ever be used?

> +static void enqueue(unsigned int port, char ch)
> +{
> +	/* If queue is full, drop the character. */
> +	if ((rxstate[port].head - rxstate[port].tail - 1) % BUF_SIZE == 0)
> +		return;

Is it really wise to silentrly drop characters here?  Maybe we should
stop reading from the device, and/or issue some error message?



What is the increase of the memory footprint (flash and RAM) with
this patch, with CONFIG_NS16550_BUFFER_READS enabled and not enabled?

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
It usually takes more than three weeks to prepare  a  good  impromptu
speech.                                                  - Mark Twain


More information about the U-Boot mailing list