Commit 641f71f5 authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds

[PATCH] RTC: Remove RTC UIP synchronization on x86_64

Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 63732c2f
...@@ -504,42 +504,25 @@ unsigned long long sched_clock(void) ...@@ -504,42 +504,25 @@ unsigned long long sched_clock(void)
static unsigned long get_cmos_time(void) static unsigned long get_cmos_time(void)
{ {
unsigned int timeout = 1000000, year, mon, day, hour, min, sec; unsigned int year, mon, day, hour, min, sec;
unsigned char uip = 0, this = 0;
unsigned long flags; unsigned long flags;
unsigned extyear = 0; unsigned extyear = 0;
/*
* The Linux interpretation of the CMOS clock register contents: When the
* Update-In-Progress (UIP) flag goes from 1 to 0, the RTC registers show the
* second which has precisely just started. Waiting for this can take up to 1
* second, we timeout approximately after 2.4 seconds on a machine with
* standard 8.3 MHz ISA bus.
*/
spin_lock_irqsave(&rtc_lock, flags); spin_lock_irqsave(&rtc_lock, flags);
while (timeout && (!uip || this)) { do {
uip |= this; sec = CMOS_READ(RTC_SECONDS);
this = CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP; min = CMOS_READ(RTC_MINUTES);
timeout--; hour = CMOS_READ(RTC_HOURS);
} day = CMOS_READ(RTC_DAY_OF_MONTH);
mon = CMOS_READ(RTC_MONTH);
/* year = CMOS_READ(RTC_YEAR);
* Here we are safe to assume the registers won't change for a whole
* second, so we just go ahead and read them.
*/
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);
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
if (acpi_fadt.revision >= FADT2_REVISION_ID && acpi_fadt.century) if (acpi_fadt.revision >= FADT2_REVISION_ID &&
extyear = CMOS_READ(acpi_fadt.century); acpi_fadt.century)
extyear = CMOS_READ(acpi_fadt.century);
#endif #endif
} while (sec != CMOS_READ(RTC_SECONDS));
spin_unlock_irqrestore(&rtc_lock, flags); spin_unlock_irqrestore(&rtc_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment