public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Daniel Drake <drake@endlessm.com>
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	len.brown@intel.com, rafael.j.wysocki@intel.com,
	linux@endlessm.com
Subject: Re: [PATCH 2/2] x86/tsc: set LAPIC timer frequency to crystal clock frequency
Date: Mon, 22 Apr 2019 14:04:51 +0200	[thread overview]
Message-ID: <20190422120451.GA9499@gmail.com> (raw)
In-Reply-To: <20190422101526.28415-2-drake@endlessm.com>


* Daniel Drake <drake@endlessm.com> wrote:

> +#ifdef CONFIG_X86_LOCAL_APIC
> +	/*
> +	 * The local APIC appears to be fed by the core crystal clock
> +	 * (which sounds entirely sensible). We can set the global
> +	 * lapic_timer_frequency here to avoid having to calibrate the APIC
> +	 * timer later.
> +	 */
> +	lapic_timer_frequency = (crystal_khz * 1000) / HZ;
> +#endif

Minor style nit: the parentheses are unnecessary, integer expressions 
like this are evaluated left to right and multiplication and division has 
the same precedence.

But it might also make sense to actually store crystal_mhz instead of 
crystal_khz, because both CPUID 15H and 16H provides MHz values.

That way the above expression would simplify to:

	lapic_timer_frequency = crystal_mhz / HZ;

Thanks,

	Ingo

  reply	other threads:[~2019-04-22 12:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22 10:15 [PATCH 1/2] x86/tsc: use CPUID.0x16 to calculate missing crystal frequency Daniel Drake
2019-04-22 10:15 ` [PATCH 2/2] x86/tsc: set LAPIC timer frequency to crystal clock frequency Daniel Drake
2019-04-22 12:04   ` Ingo Molnar [this message]
2019-04-23  3:06     ` Daniel Drake
2019-04-23 10:30       ` Ingo Molnar
2019-04-23  9:08 ` [PATCH 1/2] x86/tsc: use CPUID.0x16 to calculate missing crystal frequency Peter Zijlstra
2019-04-24  5:53   ` Daniel Drake

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=20190422120451.GA9499@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=drake@endlessm.com \
    --cc=hpa@zytor.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=mingo@redhat.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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