All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] NS16550: buffer reads
Date: Sat, 15 Oct 2011 21:08:44 +0200	[thread overview]
Message-ID: <20111015190844.2518214094B5@gemini.denx.de> (raw)
In-Reply-To: <1318694632-21872-1-git-send-email-sjg@chromium.org>

Dear Simon Glass,

In message <1318694632-21872-1-git-send-email-sjg@chromium.org> you wrote:
> From: Scott Wood <scottwood@freescale.com>
> 
> From: Scott Wood <scottwood@freescale.com>
> 
> This improves the performance of U-Boot when accepting rapid input,
> such as pasting a sequence of commands.
> 
> Without this patch, on P4080DS I see a maximum of around 5 lines can
> be pasted.  With this patch, it handles around 70 lines before lossage,
> long enough for most things you'd paste.
> 
> With it enabled, on ppc it's an extra 396 bytes of image size, and 1056
> bytes of BSS.
> 
> ARM note from Simon Glass <sjg@chromium.org> - ARM code size goes from
> 212 to 484 bytes (extra 272 bytes), BSS to 1056 bytes.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> Changes in v2:
> - Fix checkpatch warnings, the other one was already there
> 
> Changes in v3:
> - Use CONFIG_NS16550_BUFFER_READS to set the buffer size also
> 
>  README                   |   12 ++++++
>  drivers/serial/ns16550.c |   96 +++++++++++++++++++++++++++++++++++++++++++--
>  drivers/serial/serial.c  |    5 +-
>  include/ns16550.h        |    4 +-
>  4 files changed, 108 insertions(+), 9 deletions(-)
> 
> diff --git a/README b/README
> index 7e032a9..1150d6c 100644
> --- a/README
> +++ b/README
> @@ -2862,6 +2862,18 @@ use the "saveenv" command to store a valid environment.
>  		space for already greatly restricted images, including but not
>  		limited to NAND_SPL configurations.
>  
> +- CONFIG_NS16550_BUFFER_READS:
> +		Instead of reading directly from the receive register
> +		every time U-Boot is ready for another byte, keep a
> +		buffer and fill it from the hardware fifo every time
> +		U-Boot reads a character.  This helps U-Boot keep up with
> +		a larger amount of rapid input, such as happens when
> +		pasting text into the terminal.
> +
> +		To use this option, define CONFIG_NS16550_BUFFER_READS to
> +		the size of the buffer you want (256 is a reasonable value).

If we should accept that patch, then please chose a better name here.
For example, CONFIG_NS16550_RBUF_SIZE (or similar) seems to be a
somewhat better choice.

> +#ifdef CONFIG_NS16550_BUFFER_READS
> +
> +#define BUF_SIZE CONFIG_NS16550_BUFFER_READS
> +#define NUM_PORTS 4
> +
> +struct ns16550_priv {
> +	char buf[BUF_SIZE];
> +	unsigned int head, tail;
> +};

There is little sense in adding another variable here.  Just write:

	char buf[CONFIG_NS16550_BUFFER_READS];

(or whatever variable name would be used here).


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
"The  release  of  emotion  is  what  keeps  us  health.  Emotionally
healthy."
"That may be, Doctor. However, I have noted that the healthy  release
of emotion is frequently unhealthy for those closest to you."
	-- McCoy and Spock, "Plato's Stepchildren", stardate 5784.3

  parent reply	other threads:[~2011-10-15 19:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-15 16:03 [U-Boot] [PATCH v3] NS16550: buffer reads Simon Glass
2011-10-15 17:55 ` Marek Vasut
2011-10-16  3:56   ` Simon Glass
2011-10-16  4:18     ` Marek Vasut
2011-10-16  5:11       ` Simon Glass
2011-10-15 19:08 ` Wolfgang Denk [this message]
2011-10-16  5:11   ` Simon Glass

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=20111015190844.2518214094B5@gemini.denx.de \
    --to=wd@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.