diff options
| -rw-r--r-- | arch/x86_64/kernel/time.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index 966d1376b592..f8c47c688443 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
| @@ -504,8 +504,8 @@ unsigned long long sched_clock(void) | |||
| 504 | 504 | ||
| 505 | static unsigned long get_cmos_time(void) | 505 | static unsigned long get_cmos_time(void) |
| 506 | { | 506 | { |
| 507 | unsigned int timeout, year, mon, day, hour, min, sec; | 507 | unsigned int timeout = 1000000, year, mon, day, hour, min, sec; |
| 508 | unsigned char last, this; | 508 | unsigned char uip = 0, this = 0; |
| 509 | unsigned long flags; | 509 | unsigned long flags; |
| 510 | 510 | ||
| 511 | /* | 511 | /* |
| @@ -518,11 +518,8 @@ static unsigned long get_cmos_time(void) | |||
| 518 | 518 | ||
| 519 | spin_lock_irqsave(&rtc_lock, flags); | 519 | spin_lock_irqsave(&rtc_lock, flags); |
| 520 | 520 | ||
| 521 | timeout = 1000000; | 521 | while (timeout && (!uip || this)) { |
| 522 | last = this = 0; | 522 | uip |= this; |
| 523 | |||
| 524 | while (timeout && last && !this) { | ||
| 525 | last = this; | ||
| 526 | this = CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP; | 523 | this = CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP; |
| 527 | timeout--; | 524 | timeout--; |
| 528 | } | 525 | } |
