public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: john stultz <johnstul@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>,
	linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@elte.hu,
	Valdis.Kletnieks@vt.edu
Subject: Re: [PATCH -mm 3/5][time][x86_64] Split x86_64/kernel/time.c up
Date: Wed, 20 Dec 2006 22:56:02 -0800	[thread overview]
Message-ID: <20061220225602.0ff3f49e.akpm@osdl.org> (raw)
In-Reply-To: <20061220221003.15178.60219.sendpatchset@localhost>

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.

  reply	other threads:[~2006-12-21  6:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 22:13 [PATCH -mm 0/5][time][x86_64] GENERIC_TIME patchset for x86_64 john stultz
2006-12-20 22:13 ` [PATCH -mm 1/5][time][generic] vsyscall-gtod support for GENERIC_TIME john stultz
2006-12-20 22:13 ` [PATCH -mm 2/5][time][x86_64] hpet_address cleanup john stultz
2006-12-20 22:13 ` [PATCH -mm 3/5][time][x86_64] Split x86_64/kernel/time.c up john stultz
2006-12-21  6:56   ` Andrew Morton [this message]
2006-12-20 22:13 ` [PATCH -mm 4/5][time][x86_64] Convert x86_64 to use GENERIC_TIME john stultz
2006-12-28  1:24   ` Andrew Morton
2006-12-20 22:13 ` [PATCH -mm 5/5][time][x86_64] Re-enable vsyscall support for x86_64 john stultz
2006-12-21  6:27   ` Andrew Morton
2006-12-21 15:42 ` [PATCH -mm 0/5][time][x86_64] GENERIC_TIME patchset " Valdis.Kletnieks

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=20061220225602.0ff3f49e.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=ak@suse.de \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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