public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] arm926ejs: timer: Replace bss variable by gdr
Date: Sat, 22 Jan 2011 09:14:06 +0100	[thread overview]
Message-ID: <4D3A91CE.2040201@emk-elektronik.de> (raw)
In-Reply-To: <4D3A8B4C.5090701@free.fr>

Dear Albert ARIBAUD,
> However a general rework of ARM timer code is in order so that all SoCs
> and CPUs share the same set of gd variables with the same names and the
> same logic; and when we get that, this code shall move along.
>
> About this rework, as the saying goes... "Patches Welcome ?". :)

There were several suggestions about that in the past (including from me)
that involve rework everywhere HZ related timeouts are used. I still
prefer a method as follows (because it does not need repeated mul/div calculations
nor necessarily 64 bit arithmetic):

u32 timeout = timeout_init(100); /* 100ms timeout */

do {...} while (!timed_out(timeout));

Internally it would be like:

timeout_init(x):
  return fast_tick + (x * fast_tick_rate) / CONFIG_SYS_HZ;
  /* this might need 64 bit precision in some implementations */

time_out(x):
  return ((i32)(x - fast_tick)) < 0;

If the tick were really high speed (and then 64 bits),
fast_tick could be derived by shifting the tick some bits to the right.

But, as long as we cannot agree on something, there will be no time spent
to make patches...

Best Regards,
Reinhard

  reply	other threads:[~2011-01-22  8:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10  9:33 [U-Boot] [PATCH] arm926ejs: timer: Replace bss variable by gdr Heiko Schocher
2010-12-11 11:41 ` Prafulla Wadaskar
2010-12-13  7:29 ` Stefano Babic
2011-01-20 20:43 ` Albert ARIBAUD
2011-01-20 20:49   ` Albert ARIBAUD
2011-01-21  8:33     ` Heiko Schocher
2011-01-21  8:48 ` [U-Boot] [PATCH v2] " Heiko Schocher
2011-01-21  8:56 ` [U-Boot] [PATCH v3] " Heiko Schocher
2011-01-21 17:37   ` Albert ARIBAUD
2011-01-22  5:39   ` Alexander Holler
2011-01-22  7:46     ` Albert ARIBAUD
2011-01-22  8:14       ` Reinhard Meyer [this message]
2011-01-22  9:21       ` Alexander Holler
2011-01-24  6:42         ` Heiko Schocher

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=4D3A91CE.2040201@emk-elektronik.de \
    --to=u-boot@emk-elektronik.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox