diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/hrtimer.c | 7 | ||||
| -rw-r--r-- | kernel/power/disk.c | 1 | ||||
| -rw-r--r-- | kernel/power/user.c | 3 | ||||
| -rw-r--r-- | kernel/time/ntp.c | 30 |
4 files changed, 23 insertions, 18 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 6a7938a0d513..067ba2c05328 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
| @@ -814,7 +814,12 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) | |||
| 814 | 814 | ||
| 815 | timer_stats_hrtimer_set_start_info(timer); | 815 | timer_stats_hrtimer_set_start_info(timer); |
| 816 | 816 | ||
| 817 | enqueue_hrtimer(timer, new_base, base == new_base); | 817 | /* |
| 818 | * Only allow reprogramming if the new base is on this CPU. | ||
| 819 | * (it might still be on another CPU if the timer was pending) | ||
| 820 | */ | ||
| 821 | enqueue_hrtimer(timer, new_base, | ||
| 822 | new_base->cpu_base == &__get_cpu_var(hrtimer_bases)); | ||
| 818 | 823 | ||
| 819 | unlock_hrtimer_base(timer, &flags); | 824 | unlock_hrtimer_base(timer, &flags); |
| 820 | 825 | ||
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index dee0ff40befd..aec19b063e3f 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
| @@ -58,7 +58,6 @@ static inline int platform_prepare(void) | |||
| 58 | 58 | ||
| 59 | static void power_down(suspend_disk_method_t mode) | 59 | static void power_down(suspend_disk_method_t mode) |
| 60 | { | 60 | { |
| 61 | disable_nonboot_cpus(); | ||
| 62 | switch(mode) { | 61 | switch(mode) { |
| 63 | case PM_DISK_PLATFORM: | 62 | case PM_DISK_PLATFORM: |
| 64 | if (pm_ops && pm_ops->enter) { | 63 | if (pm_ops && pm_ops->enter) { |
diff --git a/kernel/power/user.c b/kernel/power/user.c index bf211fee1222..7cf6713b2325 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
| @@ -401,10 +401,9 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
| 401 | 401 | ||
| 402 | case PMOPS_ENTER: | 402 | case PMOPS_ENTER: |
| 403 | if (data->platform_suspend) { | 403 | if (data->platform_suspend) { |
| 404 | disable_nonboot_cpus(); | ||
| 405 | kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); | 404 | kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); |
| 406 | error = pm_ops->enter(PM_SUSPEND_DISK); | 405 | error = pm_ops->enter(PM_SUSPEND_DISK); |
| 407 | enable_nonboot_cpus(); | 406 | error = 0; |
| 408 | } | 407 | } |
| 409 | break; | 408 | break; |
| 410 | 409 | ||
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index eb12509e00bd..cb25649c6f50 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
| @@ -32,7 +32,7 @@ static u64 tick_length, tick_length_base; | |||
| 32 | /* TIME_ERROR prevents overwriting the CMOS clock */ | 32 | /* TIME_ERROR prevents overwriting the CMOS clock */ |
| 33 | static int time_state = TIME_OK; /* clock synchronization status */ | 33 | static int time_state = TIME_OK; /* clock synchronization status */ |
| 34 | int time_status = STA_UNSYNC; /* clock status bits */ | 34 | int time_status = STA_UNSYNC; /* clock status bits */ |
| 35 | static long time_offset; /* time adjustment (ns) */ | 35 | static s64 time_offset; /* time adjustment (ns) */ |
| 36 | static long time_constant = 2; /* pll time constant */ | 36 | static long time_constant = 2; /* pll time constant */ |
| 37 | long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */ | 37 | long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */ |
| 38 | long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ | 38 | long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ |
| @@ -196,7 +196,7 @@ void __attribute__ ((weak)) notify_arch_cmos_timer(void) | |||
| 196 | */ | 196 | */ |
| 197 | int do_adjtimex(struct timex *txc) | 197 | int do_adjtimex(struct timex *txc) |
| 198 | { | 198 | { |
| 199 | long ltemp, mtemp, save_adjust; | 199 | long mtemp, save_adjust, rem; |
| 200 | s64 freq_adj, temp64; | 200 | s64 freq_adj, temp64; |
| 201 | int result; | 201 | int result; |
| 202 | 202 | ||
| @@ -277,14 +277,14 @@ int do_adjtimex(struct timex *txc) | |||
| 277 | time_adjust = txc->offset; | 277 | time_adjust = txc->offset; |
| 278 | } | 278 | } |
| 279 | else if (time_status & STA_PLL) { | 279 | else if (time_status & STA_PLL) { |
| 280 | ltemp = txc->offset * NSEC_PER_USEC; | 280 | time_offset = txc->offset * NSEC_PER_USEC; |
| 281 | 281 | ||
| 282 | /* | 282 | /* |
| 283 | * Scale the phase adjustment and | 283 | * Scale the phase adjustment and |
| 284 | * clamp to the operating range. | 284 | * clamp to the operating range. |
| 285 | */ | 285 | */ |
| 286 | time_offset = min(ltemp, MAXPHASE * NSEC_PER_USEC); | 286 | time_offset = min(time_offset, (s64)MAXPHASE * NSEC_PER_USEC); |
| 287 | time_offset = max(time_offset, -MAXPHASE * NSEC_PER_USEC); | 287 | time_offset = max(time_offset, (s64)-MAXPHASE * NSEC_PER_USEC); |
| 288 | 288 | ||
| 289 | /* | 289 | /* |
| 290 | * Select whether the frequency is to be controlled | 290 | * Select whether the frequency is to be controlled |
| @@ -297,11 +297,11 @@ int do_adjtimex(struct timex *txc) | |||
| 297 | mtemp = xtime.tv_sec - time_reftime; | 297 | mtemp = xtime.tv_sec - time_reftime; |
| 298 | time_reftime = xtime.tv_sec; | 298 | time_reftime = xtime.tv_sec; |
| 299 | 299 | ||
| 300 | freq_adj = (s64)time_offset * mtemp; | 300 | freq_adj = time_offset * mtemp; |
| 301 | freq_adj = shift_right(freq_adj, time_constant * 2 + | 301 | freq_adj = shift_right(freq_adj, time_constant * 2 + |
| 302 | (SHIFT_PLL + 2) * 2 - SHIFT_NSEC); | 302 | (SHIFT_PLL + 2) * 2 - SHIFT_NSEC); |
| 303 | if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) { | 303 | if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) { |
| 304 | temp64 = (s64)time_offset << (SHIFT_NSEC - SHIFT_FLL); | 304 | temp64 = time_offset << (SHIFT_NSEC - SHIFT_FLL); |
| 305 | if (time_offset < 0) { | 305 | if (time_offset < 0) { |
| 306 | temp64 = -temp64; | 306 | temp64 = -temp64; |
| 307 | do_div(temp64, mtemp); | 307 | do_div(temp64, mtemp); |
| @@ -314,8 +314,10 @@ int do_adjtimex(struct timex *txc) | |||
| 314 | freq_adj += time_freq; | 314 | freq_adj += time_freq; |
| 315 | freq_adj = min(freq_adj, (s64)MAXFREQ_NSEC); | 315 | freq_adj = min(freq_adj, (s64)MAXFREQ_NSEC); |
| 316 | time_freq = max(freq_adj, (s64)-MAXFREQ_NSEC); | 316 | time_freq = max(freq_adj, (s64)-MAXFREQ_NSEC); |
| 317 | time_offset = (time_offset / NTP_INTERVAL_FREQ) | 317 | time_offset = div_long_long_rem_signed(time_offset, |
| 318 | << SHIFT_UPDATE; | 318 | NTP_INTERVAL_FREQ, |
| 319 | &rem); | ||
| 320 | time_offset <<= SHIFT_UPDATE; | ||
| 319 | } /* STA_PLL */ | 321 | } /* STA_PLL */ |
| 320 | } /* txc->modes & ADJ_OFFSET */ | 322 | } /* txc->modes & ADJ_OFFSET */ |
| 321 | if (txc->modes & ADJ_TICK) | 323 | if (txc->modes & ADJ_TICK) |
| @@ -328,12 +330,12 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0) | |||
| 328 | result = TIME_ERROR; | 330 | result = TIME_ERROR; |
| 329 | 331 | ||
| 330 | if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) | 332 | if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) |
| 331 | txc->offset = save_adjust; | 333 | txc->offset = save_adjust; |
| 332 | else | 334 | else |
| 333 | txc->offset = shift_right(time_offset, SHIFT_UPDATE) | 335 | txc->offset = ((long)shift_right(time_offset, SHIFT_UPDATE)) * |
| 334 | * NTP_INTERVAL_FREQ / 1000; | 336 | NTP_INTERVAL_FREQ / 1000; |
| 335 | txc->freq = (time_freq / NSEC_PER_USEC) | 337 | txc->freq = (time_freq / NSEC_PER_USEC) << |
| 336 | << (SHIFT_USEC - SHIFT_NSEC); | 338 | (SHIFT_USEC - SHIFT_NSEC); |
| 337 | txc->maxerror = time_maxerror; | 339 | txc->maxerror = time_maxerror; |
| 338 | txc->esterror = time_esterror; | 340 | txc->esterror = time_esterror; |
| 339 | txc->status = time_status; | 341 | txc->status = time_status; |
