From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] mmc: omap: timeout counter fix
Date: Tue, 26 Oct 2010 09:48:52 +0200 [thread overview]
Message-ID: <4CC687E4.2030701@emk-elektronik.de> (raw)
In-Reply-To: <20101026073651.4FD42152451@gemini.denx.de>
Dear Wolfgang Denk,
> Dear Reinhard Meyer,
>
> In message <4CC66ECA.9000106@emk-elektronik.de> you wrote:
>> Agreed here. People are invited to dig through u-boot and find all
>> those places.
>
> You know the ones you added best :-)
>
>> > int main(void)
>> > {
>> > unsigned int time = 0xFFFFFFF0;
>> > unsigned int delay = 0x20;
>> > unsigned int start;
>>
>> You are wrong here, because you take it out of context.
>
> I am not wrong. Feel free to replace "unsigned int" by "unsigned long
> long", and 0xFFFFFFF0 by 0xFFFFFFFFFFFFFFF0ULL, and the "%X" by "%llX".
>
>> My "demo" is using the (declared as) 64 bit function get_ticks().
>> I mentioned above that this function MUST be truly returning 64
>> bits worth of (incrementing) value to make any version work.
>
> What's the difference? It is inherently wrong to believe an overflow
> would never occur just because the precision of a number is "long
> enough". Remeber y2k issues. Remember the time overflog for UNIX
> systems in 2038, etc. etc.
>
>> If get_ticks() just returns a 32 bit counter value neither method will work
>> reliably. Just check all implementations that this function is implemented
>> correctly.
You should really try to understand what I am saying here:
IF get_timer() returns 0x0000000000000000 to 0x00000000ffffffff and wraps back
to 0x0000000000000000 (thats how it is or was implemented in SOME architectures)
neither mine (agreed to be wrong) nor your code would work if it uses 64 bits vars.
Reinhard
next prev parent reply other threads:[~2010-10-26 7:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-26 1:02 [U-Boot] [PATCH v2] mmc: omap: timeout counter fix Nishanth Menon
2010-10-26 1:14 ` Reinhard Meyer
2010-10-26 1:18 ` Nishanth Menon
2010-10-26 5:29 ` Wolfgang Denk
2010-10-26 5:28 ` Wolfgang Denk
2010-10-26 5:34 ` Ghorai, Sukumar
2010-10-26 13:58 ` Nishanth Menon
2010-10-26 5:43 ` Reinhard Meyer
2010-10-26 5:48 ` Wolfgang Denk
2010-10-26 6:01 ` Reinhard Meyer
2010-10-26 7:00 ` [U-Boot] Timer implementations (was: Re: [PATCH v2] mmc: omap: timeout counter fix) Reinhard Meyer
2010-10-26 7:41 ` Wolfgang Denk
2010-10-26 7:57 ` [U-Boot] Timer implementations Reinhard Meyer
2010-10-26 9:33 ` Wolfgang Denk
2010-10-26 10:18 ` Reinhard Meyer
2010-10-26 13:05 ` Wolfgang Denk
2010-10-26 13:33 ` Reinhard Meyer
2010-10-26 21:19 ` J. William Campbell
2010-10-28 6:02 ` Reinhard Meyer
2010-11-01 13:47 ` J. William Campbell
2010-11-01 20:01 ` Reinhard Meyer
2010-11-01 20:15 ` Wolfgang Denk
2010-10-26 15:11 ` Nishanth Menon
2010-10-26 15:17 ` Wolfgang Denk
2010-10-26 15:22 ` Nishanth Menon
2010-10-26 16:26 ` Wolfgang Denk
2010-10-26 18:36 ` Reinhard Meyer
2010-10-26 7:03 ` [U-Boot] [PATCH v2] mmc: omap: timeout counter fix J. William Campbell
2010-10-26 7:36 ` Wolfgang Denk
2010-10-26 7:48 ` Reinhard Meyer [this message]
2010-10-26 4:36 ` Wolfgang Denk
2010-10-26 5:26 ` Ghorai, Sukumar
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=4CC687E4.2030701@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