mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/6] poller_call: move from getc to is_timeout
Date: Wed, 4 Jan 2012 10:25:43 +0100	[thread overview]
Message-ID: <20120104092543.GQ5446@pengutronix.de> (raw)
In-Reply-To: <1325566850-24432-3-git-send-email-plagnioj@jcrosoft.com>

On Tue, Jan 03, 2012 at 06:00:47AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> this will allow to always call poller_call even durring timeout
> and still the case in getc
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  common/clock.c   |    4 ++++
>  common/console.c |    2 --
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/common/clock.c b/common/clock.c
> index 79c06c8..f322db8 100644
> --- a/common/clock.c
> +++ b/common/clock.c
> @@ -27,6 +27,7 @@
>  #include <common.h>
>  #include <asm-generic/div64.h>
>  #include <clock.h>
> +#include <poller.h>
>  
>  static struct clocksource *current_clock;
>  static uint64_t time_ns;
> @@ -139,6 +140,9 @@ uint32_t clocksource_hz2mult(uint32_t hz, uint32_t shift_constant)
>  
>  int is_timeout(uint64_t start_ns, uint64_t time_offset_ns)
>  {
> +	if (time_offset_ns >= 100 * USECOND)
> +		poller_call();

Do we need this if() at all? I think not.

Sascha

> +
>  	if ((int64_t)(start_ns + time_offset_ns - get_time_ns()) < 0)
>  		return 1;
>  	else
> diff --git a/common/console.c b/common/console.c
> index cab8689..88c4010 100644
> --- a/common/console.c
> +++ b/common/console.c
> @@ -225,8 +225,6 @@ int getc(void)
>  	 */
>  	start = get_time_ns();
>  	while (1) {
> -		poller_call();
> -
>  		if (tstc_raw()) {
>  			kfifo_putc(console_input_buffer, getc_raw());
>  
> -- 
> 1.7.7
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-01-04  9:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03  5:00 [PATCH 1/6] defaultenv: source the init_board so we can keep exported env Jean-Christophe PLAGNIOL-VILLARD
2012-01-03  5:00 ` [PATCH 2/6] defaultenv: enable progress for cp Jean-Christophe PLAGNIOL-VILLARD
2012-01-03  5:00 ` [PATCH 3/6] poller_call: move from getc to is_timeout Jean-Christophe PLAGNIOL-VILLARD
2012-01-04  9:25   ` Sascha Hauer [this message]
2012-01-04 10:46     ` Jean-Christophe PLAGNIOL-VILLARD
2012-01-03  5:00 ` [PATCH 4/6] arm: introduce barebox_bare_init_size to known the bare_init size Jean-Christophe PLAGNIOL-VILLARD
2012-01-03  5:00 ` [PATCH 5/6] ARM: add ARM_EXCEPTION_VECTOR6 options Jean-Christophe PLAGNIOL-VILLARD
2012-01-04 10:26   ` Sascha Hauer
2012-01-03  5:00 ` [PATCH 6/6] at91: use " Jean-Christophe PLAGNIOL-VILLARD

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=20120104092543.GQ5446@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox