[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061220225602.0ff3f49e.akpm@osdl.org>
Date: Wed, 20 Dec 2006 22:56:02 -0800
From: Andrew Morton <akpm@...l.org>
To: john stultz <johnstul@...ibm.com>
Cc: Andi Kleen <ak@...e.de>, linux-kernel@...r.kernel.org,
tglx@...utronix.de, mingo@...e.hu, Valdis.Kletnieks@...edu
Subject: Re: [PATCH -mm 3/5][time][x86_64] Split x86_64/kernel/time.c up
On Wed, 20 Dec 2006 17:13:37 -0500
john stultz <johnstul@...ibm.com> wrote:
> +
> +unsigned int __init hpet_calibrate_tsc(void)
> +{
> + int tsc_start, hpet_start;
> + int tsc_now, hpet_now;
> + unsigned long flags;
> +
> + local_irq_save(flags);
> + local_irq_disable();
> +
> + hpet_start = hpet_readl(HPET_COUNTER);
> + rdtscl(tsc_start);
> +
> + do {
> + local_irq_disable();
> + hpet_now = hpet_readl(HPET_COUNTER);
> + tsc_now = get_cycles_sync();
> + local_irq_restore(flags);
> + } while ((tsc_now - tsc_start) < TICK_COUNT &&
> + (hpet_now - hpet_start) < TICK_COUNT);
> +
> + return (tsc_now - tsc_start) * 1000000000L
> + / ((hpet_now - hpet_start) * hpet_period / 1000);
> +}
What a confused function. If called with local irqs disabled it'll fail to
enable interrupts in that loop. Perhaps that's deliberate, dunno.
Plus local_irq_save() disables interrupts, so the first local_irq_disable()
is not needed.
I will kill the unneeded local_irq_disable() and then shall back slowly away
from it.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists