Re: [patch -mm 22/28] x86_64: Convert to cleckevents

Andrew Morton
2007-06-26T00:28:25Z

On Sat, 23 Jun 2007 13:32:47 -0000
Thomas Gleixner <tglx@linutronix.de> wrote:

> Convert x86_64 to the clockevents code. Share code with i386 for
> hpet and PIT.
>
> Build and whitespace fixups from:
> Venki Pallipadi <venkatesh.pallipadi@intel.com>
> and
> Chris Wright <chrisw@sous-sol.org>

semi-fixes.

> if (no_ctr_free) {
> - i = 3;
> - rdmsrl(MSR_K7_EVNTSEL3, evntsel3);
> - wrmsrl(MSR_K7_EVNTSEL3, 0);
> - rdmsrl(MSR_K7_PERFCTR3, pmc3);
> + i = 3;
> + rdmsrl(MSR_K7_EVNTSEL3, evntsel3);
> + wrmsrl(MSR_K7_EVNTSEL3, 0);
> + rdmsrl(MSR_K7_PERFCTR3, pmc3);
> } else {
> - reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i);
> - reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
> + reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i);
> + reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
> }
> local_irq_save(flags);
> /* start meauring cycles, incrementing from 0 */
> @@ -275,119 +236,38 @@ static unsigned int __init tsc_calibrate
> wrmsrl(MSR_K7_EVNTSEL0 + i, 1 << 22 | 3 << 16 | 0x76);
> rdtscl(tsc_start);
> do {
> - rdmsrl(MSR_K7_PERFCTR0 + i, pmc_now);
> - tsc_now = get_cycles_sync();
> + rdmsrl(MSR_K7_PERFCTR0 + i, pmc_now);
> + tsc_now = get_cycles_sync();
> } while ((tsc_now - tsc_start) < TICK_COUNT);
>
> local_irq_restore(flags);
> if (no_ctr_free) {
> - wrmsrl(MSR_K7_EVNTSEL3, 0);
> - wrmsrl(MSR_K7_PERFCTR3, pmc3);
> - wrmsrl(MSR_K7_EVNTSEL3, evntsel3);
> + wrmsrl(MSR_K7_EVNTSEL3, 0);
> + wrmsrl(MSR_K7_PERFCTR3, pmc3);
> + wrmsrl(MSR_K7_EVNTSEL3, evntsel3);
> } else {
> - release_perfctr_nmi(MSR_K7_PERFCTR0 + i);
> - release_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
> + release_perfctr_nmi(MSR_K7_PERFCTR0 + i);
> + release_evntsel_nmi(MSR_K7_EVNTSEL0 + i);
> }

There's still bulk whitespace bustage in here.

(However checkpatch only says

Use #include <linux/hpet.h> instead of <asm/hpet.h>
#1913: FILE: arch/x86_64/kernel/tsc.c:11:
+#include <asm/hpet.h>
)

<edits the diff, fixes it>