aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditfilter.c2
-rw-r--r--kernel/fork.c6
-rw-r--r--kernel/power/disk.c3
-rw-r--r--kernel/power/main.c19
-rw-r--r--kernel/profile.c1
-rw-r--r--kernel/sysctl.c2
-rw-r--r--kernel/time/clocksource.c10
-rw-r--r--kernel/time/ntp.c2
-rw-r--r--kernel/time/timekeeping.c2
-rw-r--r--kernel/timer.c2
10 files changed, 25 insertions, 24 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 6c61263ff96d..74cc0fc6bb81 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -311,6 +311,7 @@ int audit_match_class(int class, unsigned syscall)
311 return classes[class][AUDIT_WORD(syscall)] & AUDIT_BIT(syscall); 311 return classes[class][AUDIT_WORD(syscall)] & AUDIT_BIT(syscall);
312} 312}
313 313
314#ifdef CONFIG_AUDITSYSCALL
314static inline int audit_match_class_bits(int class, u32 *mask) 315static inline int audit_match_class_bits(int class, u32 *mask)
315{ 316{
316 int i; 317 int i;
@@ -347,6 +348,7 @@ static int audit_match_signal(struct audit_entry *entry)
347 return 1; 348 return 1;
348 } 349 }
349} 350}
351#endif
350 352
351/* Common user-space to kernel rule translation. */ 353/* Common user-space to kernel rule translation. */
352static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule) 354static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
diff --git a/kernel/fork.c b/kernel/fork.c
index 49530e40ea8b..87069cfc18a1 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1427,10 +1427,8 @@ static void sighand_ctor(void *data, struct kmem_cache *cachep,
1427{ 1427{
1428 struct sighand_struct *sighand = data; 1428 struct sighand_struct *sighand = data;
1429 1429
1430 if (flags & SLAB_CTOR_CONSTRUCTOR) { 1430 spin_lock_init(&sighand->siglock);
1431 spin_lock_init(&sighand->siglock); 1431 INIT_LIST_HEAD(&sighand->signalfd_list);
1432 INIT_LIST_HEAD(&sighand->signalfd_list);
1433 }
1434} 1432}
1435 1433
1436void __init proc_caches_init(void) 1434void __init proc_caches_init(void)
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index b5f0543ed84d..f445b9cd60fb 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -416,7 +416,8 @@ static ssize_t disk_store(struct kset *kset, const char *buf, size_t n)
416 416
417 mutex_lock(&pm_mutex); 417 mutex_lock(&pm_mutex);
418 for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { 418 for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) {
419 if (!strncmp(buf, hibernation_modes[i], len)) { 419 if (len == strlen(hibernation_modes[i])
420 && !strncmp(buf, hibernation_modes[i], len)) {
420 mode = i; 421 mode = i;
421 break; 422 break;
422 } 423 }
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 40d56a31245e..8812985f3029 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -97,25 +97,26 @@ static int suspend_prepare(suspend_state_t state)
97 } 97 }
98 } 98 }
99 99
100 if (pm_ops->prepare) {
101 if ((error = pm_ops->prepare(state)))
102 goto Thaw;
103 }
104
105 suspend_console(); 100 suspend_console();
106 error = device_suspend(PMSG_SUSPEND); 101 error = device_suspend(PMSG_SUSPEND);
107 if (error) { 102 if (error) {
108 printk(KERN_ERR "Some devices failed to suspend\n"); 103 printk(KERN_ERR "Some devices failed to suspend\n");
109 goto Resume_devices; 104 goto Resume_console;
110 } 105 }
106 if (pm_ops->prepare) {
107 if ((error = pm_ops->prepare(state)))
108 goto Resume_devices;
109 }
110
111 error = disable_nonboot_cpus(); 111 error = disable_nonboot_cpus();
112 if (!error) 112 if (!error)
113 return 0; 113 return 0;
114 114
115 enable_nonboot_cpus(); 115 enable_nonboot_cpus();
116 Resume_devices:
117 pm_finish(state); 116 pm_finish(state);
117 Resume_devices:
118 device_resume(); 118 device_resume();
119 Resume_console:
119 resume_console(); 120 resume_console();
120 Thaw: 121 Thaw:
121 thaw_processes(); 122 thaw_processes();
@@ -289,13 +290,13 @@ static ssize_t state_store(struct kset *kset, const char *buf, size_t n)
289 len = p ? p - buf : n; 290 len = p ? p - buf : n;
290 291
291 /* First, check if we are requested to hibernate */ 292 /* First, check if we are requested to hibernate */
292 if (!strncmp(buf, "disk", len)) { 293 if (len == 4 && !strncmp(buf, "disk", len)) {
293 error = hibernate(); 294 error = hibernate();
294 return error ? error : n; 295 return error ? error : n;
295 } 296 }
296 297
297 for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) { 298 for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) {
298 if (*s && !strncmp(buf, *s, len)) 299 if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
299 break; 300 break;
300 } 301 }
301 if (state < PM_SUSPEND_MAX && *s) 302 if (state < PM_SUSPEND_MAX && *s)
diff --git a/kernel/profile.c b/kernel/profile.c
index cc91b9bf759d..5b20fe977bed 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -26,6 +26,7 @@
26#include <asm/sections.h> 26#include <asm/sections.h>
27#include <asm/semaphore.h> 27#include <asm/semaphore.h>
28#include <asm/irq_regs.h> 28#include <asm/irq_regs.h>
29#include <asm/ptrace.h>
29 30
30struct profile_hit { 31struct profile_hit {
31 u32 pc, hits; 32 u32 pc, hits;
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 4073353abd4f..30ee462ee79f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -227,7 +227,7 @@ static ctl_table kern_table[] = {
227 .ctl_name = KERN_CORE_PATTERN, 227 .ctl_name = KERN_CORE_PATTERN,
228 .procname = "core_pattern", 228 .procname = "core_pattern",
229 .data = core_pattern, 229 .data = core_pattern,
230 .maxlen = 128, 230 .maxlen = CORENAME_MAX_SIZE,
231 .mode = 0644, 231 .mode = 0644,
232 .proc_handler = &proc_dostring, 232 .proc_handler = &proc_dostring,
233 .strategy = &sysctl_string, 233 .strategy = &sysctl_string,
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 3db5c3c460d7..51b6a6a6158c 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -74,7 +74,7 @@ static struct clocksource *watchdog;
74static struct timer_list watchdog_timer; 74static struct timer_list watchdog_timer;
75static DEFINE_SPINLOCK(watchdog_lock); 75static DEFINE_SPINLOCK(watchdog_lock);
76static cycle_t watchdog_last; 76static cycle_t watchdog_last;
77static int watchdog_resumed; 77static unsigned long watchdog_resumed;
78 78
79/* 79/*
80 * Interval: 0.5sec Threshold: 0.0625s 80 * Interval: 0.5sec Threshold: 0.0625s
@@ -104,9 +104,7 @@ static void clocksource_watchdog(unsigned long data)
104 104
105 spin_lock(&watchdog_lock); 105 spin_lock(&watchdog_lock);
106 106
107 resumed = watchdog_resumed; 107 resumed = test_and_clear_bit(0, &watchdog_resumed);
108 if (unlikely(resumed))
109 watchdog_resumed = 0;
110 108
111 wdnow = watchdog->read(); 109 wdnow = watchdog->read();
112 wd_nsec = cyc2ns(watchdog, (wdnow - watchdog_last) & watchdog->mask); 110 wd_nsec = cyc2ns(watchdog, (wdnow - watchdog_last) & watchdog->mask);
@@ -151,9 +149,7 @@ static void clocksource_watchdog(unsigned long data)
151} 149}
152static void clocksource_resume_watchdog(void) 150static void clocksource_resume_watchdog(void)
153{ 151{
154 spin_lock(&watchdog_lock); 152 set_bit(0, &watchdog_resumed);
155 watchdog_resumed = 1;
156 spin_unlock(&watchdog_lock);
157} 153}
158 154
159static void clocksource_check_watchdog(struct clocksource *cs) 155static void clocksource_check_watchdog(struct clocksource *cs)
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index cb25649c6f50..87aa5ff931e0 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -11,6 +11,8 @@
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/time.h> 12#include <linux/time.h>
13#include <linux/timex.h> 13#include <linux/timex.h>
14#include <linux/jiffies.h>
15#include <linux/hrtimer.h>
14 16
15#include <asm/div64.h> 17#include <asm/div64.h>
16#include <asm/timex.h> 18#include <asm/timex.h>
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index f9217bf644f6..3d1042f82a68 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -273,6 +273,8 @@ static int timekeeping_resume(struct sys_device *dev)
273 unsigned long flags; 273 unsigned long flags;
274 unsigned long now = read_persistent_clock(); 274 unsigned long now = read_persistent_clock();
275 275
276 clocksource_resume();
277
276 write_seqlock_irqsave(&xtime_lock, flags); 278 write_seqlock_irqsave(&xtime_lock, flags);
277 279
278 if (now && (now > timekeeping_suspend_time)) { 280 if (now && (now > timekeeping_suspend_time)) {
diff --git a/kernel/timer.c b/kernel/timer.c
index a6c580ac084b..5ec5490f8d85 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1499,8 +1499,6 @@ unregister_time_interpolator(struct time_interpolator *ti)
1499 prev = &curr->next; 1499 prev = &curr->next;
1500 } 1500 }
1501 1501
1502 clocksource_resume();
1503
1504 write_seqlock_irqsave(&xtime_lock, flags); 1502 write_seqlock_irqsave(&xtime_lock, flags);
1505 if (ti == time_interpolator) { 1503 if (ti == time_interpolator) {
1506 /* we lost the best time-interpolator: */ 1504 /* we lost the best time-interpolator: */