lkml.org 
[lkml]   [2006]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@us.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-21 07:59    [W:0.217 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site