mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Cyrill Gorcunov" <gorcunov@gmail.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Q] Is 64bit LVTT screwed
Date: Tue, 8 Jul 2008 15:38:45 +0400	[thread overview]
Message-ID: <aa79d98a0807080438u19fc4915sd81c9fedf8b90260@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.55.0807072243410.20615@cliff.in.clinika.pl>

On Tue, Jul 8, 2008 at 2:08 AM, Maciej W. Rozycki <macro@linux-mips.org> wrote:
[...]
>>
>> but in both cases we use "divide by 16" in divide register. The only
>> explanation I imagine - for 64bit mode we are required to 'stuck'
>> for a bit longer (by 16 times longer to be precise). Am I right?
>> Or there is another reason why we dont use APIC_DIVISOR here. Actually,
>> as I see it not fair to a caller. For 64bit mode APIC timer is requested
>> to count 250000000 ticks but in real it will count 250000000 * 16.
>> Not sure who is right there. I think the better would be to
>> use 4000000000 and APIC_DIVISOR in 64bit mode. How do you think?
>
>  The APIC clock varies across systems so the timer setup includes
> calibration.  Which means both variations end up with the correct
> interrupt rate probably, except using different divisors.  We used to
> print the APIC clock rate and that would be off with one of the above, but
> I don't we do this anymore.  We had a similar problem with the 82489DX
> where the prescaler was bypassed altogether resulting in an incorrect
> clock rate printed, but the rate of timer interrupt was correctly
> calibrated regardless.
>
>  This is of course merely an explanation why the code you quoted does not
> explode spectacularly.  It does not make it correct.  If the prescaler is
> indeed set to 16 for 64-bit systems, then APIC_DIVISOR should obviously be
> used in the calculation above too.  And if not, then I think the prescaler
> should be set consistently across systems and then the setting reflected
> in the calculations accordingly.  Please note that only values between 2
> and 16 are supported in a uniform way across all the APIC models and using
> low values risks an overflow as clock rates are in the GHz range these
> days already.  The value of 16 seems a reasonable one.
>
>  Maciej
>

Thanks, Maciej, for explanation. Unfortunelly I'm quite busy now so
I stopped merging/research on apic code, as only get spare time - will
let you know my results.

- Cyrill -

  reply	other threads:[~2008-07-08 11:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 18:40 Cyrill Gorcunov
2008-07-07 22:08 ` Maciej W. Rozycki
2008-07-08 11:38   ` Cyrill Gorcunov [this message]
2008-07-08 19:09   ` Cyrill Gorcunov

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=aa79d98a0807080438u19fc4915sd81c9fedf8b90260@mail.gmail.com \
    --to=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    /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

all inboxes | Powered by JetHome®