lkml.org 
[lkml]   [2019]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86/tsc: set LAPIC timer frequency to crystal clock frequency

* 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

\
 
 \ /
  Last update: 2019-04-22 14:05    [W:2.000 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site