From: Dirk Behme <dirk.behme@de.bosch.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: global_data: make tbl long long
Date: Mon, 4 Mar 2013 15:20:39 +0100 [thread overview]
Message-ID: <5134ADB7.2000106@de.bosch.com> (raw)
In-Reply-To: <20130304111013.01401200246@gemini.denx.de>
Dear Wolfgang,
On 04.03.2013 12:10, Wolfgang Denk wrote:
> Dear Dirk Behme,
>
> In message <1362387637-32334-1-git-send-email-dirk.behme@de.bosch.com> you wrote:
>> From: Dirk Behme <dirk.behme@de.bosch.com>
>>
>> Several ARM timer implementations use gd->arch.tbl to record the
>> absolute tick count of 32-bit counters, including timer overflows.
>> For example arch/arm/imx-common/timer.c does:
>>
>> ulong lastinc;
>> ulong now = counter value;
>> if (no overflow) {
>> ...
>> } else { /* counter overflow */
>> gd->arch.tbl += (0xFFFFFFFF - lastinc) + now;
>> }
>> lastinc = now;
>>
>> As we use a 32-bit counter and the two ulong (32-bit) variables 'lastinc'
>> and 'now' here, gd->arch.tbl should be long long (64-bit) to not overflow
>> at the same time, too.
>
> I think this is wrong.
>
> "tbl" means "time base, lower 32 bits" and is complemented by "tbu"
> (time base, upper 32 bits) to form a 64 bit time base counter.
>
> If you need the full 64 bit precision, then please either maintain the
> carry manually, or use a proper union or similar.
Many thanks for this explanation!
This patch is obsolete now, replaced by
http://patchwork.ozlabs.org/patch/224740/
Thanks
Dirk
next prev parent reply other threads:[~2013-03-04 14:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 9:00 [U-Boot] [PATCH] ARM: global_data: make tbl long long Dirk Behme
2013-03-04 11:10 ` Wolfgang Denk
2013-03-04 14:20 ` Dirk Behme [this message]
2013-03-05 11:10 ` Wolfgang Denk
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=5134ADB7.2000106@de.bosch.com \
--to=dirk.behme@de.bosch.com \
--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