diff options
-rw-r--r-- | drivers/rtc/interface.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-dev.c | 3 | ||||
-rw-r--r-- | kernel/time/clockevents.c | 5 | ||||
-rw-r--r-- | kernel/timer.c | 15 |
4 files changed, 14 insertions, 11 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index ef6316acec4..df68618f6db 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -318,7 +318,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
318 | } | 318 | } |
319 | EXPORT_SYMBOL_GPL(rtc_read_alarm); | 319 | EXPORT_SYMBOL_GPL(rtc_read_alarm); |
320 | 320 | ||
321 | int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | 321 | static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) |
322 | { | 322 | { |
323 | struct rtc_time tm; | 323 | struct rtc_time tm; |
324 | long now, scheduled; | 324 | long now, scheduled; |
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index d0e06edb14c..cace6d3aed9 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -421,7 +421,8 @@ static long rtc_dev_ioctl(struct file *file, | |||
421 | err = ops->ioctl(rtc->dev.parent, cmd, arg); | 421 | err = ops->ioctl(rtc->dev.parent, cmd, arg); |
422 | if (err == -ENOIOCTLCMD) | 422 | if (err == -ENOIOCTLCMD) |
423 | err = -ENOTTY; | 423 | err = -ENOTTY; |
424 | } | 424 | } else |
425 | err = -ENOTTY; | ||
425 | break; | 426 | break; |
426 | } | 427 | } |
427 | 428 | ||
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index c027d4f602f..e4c699dfa4e 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -182,7 +182,10 @@ void clockevents_register_device(struct clock_event_device *dev) | |||
182 | unsigned long flags; | 182 | unsigned long flags; |
183 | 183 | ||
184 | BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); | 184 | BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); |
185 | BUG_ON(!dev->cpumask); | 185 | if (!dev->cpumask) { |
186 | WARN_ON(num_possible_cpus() > 1); | ||
187 | dev->cpumask = cpumask_of(smp_processor_id()); | ||
188 | } | ||
186 | 189 | ||
187 | raw_spin_lock_irqsave(&clockevents_lock, flags); | 190 | raw_spin_lock_irqsave(&clockevents_lock, flags); |
188 | 191 | ||
diff --git a/kernel/timer.c b/kernel/timer.c index fd6198692b5..8cff36119e4 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -749,16 +749,15 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires) | |||
749 | unsigned long expires_limit, mask; | 749 | unsigned long expires_limit, mask; |
750 | int bit; | 750 | int bit; |
751 | 751 | ||
752 | expires_limit = expires; | ||
753 | |||
754 | if (timer->slack >= 0) { | 752 | if (timer->slack >= 0) { |
755 | expires_limit = expires + timer->slack; | 753 | expires_limit = expires + timer->slack; |
756 | } else { | 754 | } else { |
757 | unsigned long now = jiffies; | 755 | long delta = expires - jiffies; |
756 | |||
757 | if (delta < 256) | ||
758 | return expires; | ||
758 | 759 | ||
759 | /* No slack, if already expired else auto slack 0.4% */ | 760 | expires_limit = expires + delta / 256; |
760 | if (time_after(expires, now)) | ||
761 | expires_limit = expires + (expires - now)/256; | ||
762 | } | 761 | } |
763 | mask = expires ^ expires_limit; | 762 | mask = expires ^ expires_limit; |
764 | if (mask == 0) | 763 | if (mask == 0) |
@@ -795,6 +794,8 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires) | |||
795 | */ | 794 | */ |
796 | int mod_timer(struct timer_list *timer, unsigned long expires) | 795 | int mod_timer(struct timer_list *timer, unsigned long expires) |
797 | { | 796 | { |
797 | expires = apply_slack(timer, expires); | ||
798 | |||
798 | /* | 799 | /* |
799 | * This is a common optimization triggered by the | 800 | * This is a common optimization triggered by the |
800 | * networking code - if the timer is re-modified | 801 | * networking code - if the timer is re-modified |
@@ -803,8 +804,6 @@ int mod_timer(struct timer_list *timer, unsigned long expires) | |||
803 | if (timer_pending(timer) && timer->expires == expires) | 804 | if (timer_pending(timer) && timer->expires == expires) |
804 | return 1; | 805 | return 1; |
805 | 806 | ||
806 | expires = apply_slack(timer, expires); | ||
807 | |||
808 | return __mod_timer(timer, expires, false, TIMER_NOT_PINNED); | 807 | return __mod_timer(timer, expires, false, TIMER_NOT_PINNED); |
809 | } | 808 | } |
810 | EXPORT_SYMBOL(mod_timer); | 809 | EXPORT_SYMBOL(mod_timer); |