mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Nigel Cunningham <ncunningham@linuxmail.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	John Stultz <johnstul@us.ibm.com>,
	David Shaohua <shaohua.li@intel.com>
Subject: Re: Patch 3/3: Reduce number of get_cmos_time_calls.
Date: Sat, 8 Jan 2005 14:27:18 +0100	[thread overview]
Message-ID: <20050108132718.GD7363@elf.ucw.cz> (raw)
In-Reply-To: <1105177308.5478.43.camel@desktop.cunninghams>

Hi!

> Create new __get_cmos_time patch, which doesn't wait for the start of a
> new second before returning. Adjust timer_suspend to use this as we
> don't appear to need the exact start of a second when suspending.

Basically nice cleanup. I do not know if this does not mean up-to
second error in clock for each suspend/resume?

> --- 913-old/arch/x86_64/kernel/time.c	2004-12-10 14:27:08.000000000 +1100
> +++ 913-new/arch/x86_64/kernel/time.c	2005-01-08 19:39:24.664278320 +1100
> @@ -499,11 +499,56 @@ unsigned long long sched_clock(void)
>  	return cycles_2_ns(a);
>  }
>  
> +unsigned long __get_cmos_time(void)
> +{

Missing static?

> +
> +	/*
> +	 * Do we need the spinlock in here too?
> +	 *
> +	 * If we're called directly (not via get_cmos_time),
> +	 * we're in the middle of a sysdev suspend/resume
> +	 * and interrupts are disabled, so this 
> +	 * should be safe without any locking.
> +	 * 				-- NC
> +	 */

I'd say "Caller is responsible for locking"... and explain this in
caller. Also do not sign comments.

> +	do {
> +		sec = CMOS_READ(RTC_SECONDS);
> +		min = CMOS_READ(RTC_MINUTES);
> +		hour = CMOS_READ(RTC_HOURS);
> +		day = CMOS_READ(RTC_DAY_OF_MONTH);
> +		mon = CMOS_READ(RTC_MONTH);
> +		year = CMOS_READ(RTC_YEAR);
> +	} while (sec != CMOS_READ(RTC_SECONDS));
> +
> +	/*
> +	 * We know that x86-64 always uses BCD format, no need to check the config
> +	 * register.
> +	 */
> +
> +	    BCD_TO_BIN(sec);
> +	    BCD_TO_BIN(min);
> +	    BCD_TO_BIN(hour);
> +	    BCD_TO_BIN(day);
> +	    BCD_TO_BIN(mon);
> +	    BCD_TO_BIN(year);

Whitespace damage?
								Pavel
-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

      reply	other threads:[~2005-01-08 13:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-08  9:42 [RFC] Patches to reduce delay in arch/kernel/time.c Nigel Cunningham
2005-01-08  9:42 ` Patch 1/3: Reduce number of get_cmos_time_calls Nigel Cunningham
2005-01-08 13:21   ` Pavel Machek
2005-01-08  9:42 ` Patch 2/3: " Nigel Cunningham
2005-01-08 13:22   ` Pavel Machek
2005-01-08  9:42 ` Patch 3/3: " Nigel Cunningham
2005-01-08 13:27   ` Pavel Machek [this message]

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=20050108132718.GD7363@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncunningham@linuxmail.org \
    --cc=shaohua.li@intel.com \
    /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

Powered by JetHome