diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/hrtimer.c | 10 | ||||
| -rw-r--r-- | kernel/irq/proc.c | 2 | ||||
| -rw-r--r-- | kernel/kexec.c | 7 | ||||
| -rw-r--r-- | kernel/pid.c | 5 | ||||
| -rw-r--r-- | kernel/power/hibernate.c | 10 | ||||
| -rw-r--r-- | kernel/power/suspend.c | 5 | ||||
| -rw-r--r-- | kernel/time/posix-clock.c | 24 | ||||
| -rw-r--r-- | kernel/trace/Kconfig | 2 | ||||
| -rw-r--r-- | kernel/watchdog.c | 5 | ||||
| -rw-r--r-- | kernel/workqueue.c | 8 |
10 files changed, 50 insertions, 28 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 9017478c5d4c..87fdb3f8db14 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
| @@ -81,7 +81,11 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) = | |||
| 81 | } | 81 | } |
| 82 | }; | 82 | }; |
| 83 | 83 | ||
| 84 | static int hrtimer_clock_to_base_table[MAX_CLOCKS]; | 84 | static int hrtimer_clock_to_base_table[MAX_CLOCKS] = { |
| 85 | [CLOCK_REALTIME] = HRTIMER_BASE_REALTIME, | ||
| 86 | [CLOCK_MONOTONIC] = HRTIMER_BASE_MONOTONIC, | ||
| 87 | [CLOCK_BOOTTIME] = HRTIMER_BASE_BOOTTIME, | ||
| 88 | }; | ||
| 85 | 89 | ||
| 86 | static inline int hrtimer_clockid_to_base(clockid_t clock_id) | 90 | static inline int hrtimer_clockid_to_base(clockid_t clock_id) |
| 87 | { | 91 | { |
| @@ -1722,10 +1726,6 @@ static struct notifier_block __cpuinitdata hrtimers_nb = { | |||
| 1722 | 1726 | ||
| 1723 | void __init hrtimers_init(void) | 1727 | void __init hrtimers_init(void) |
| 1724 | { | 1728 | { |
| 1725 | hrtimer_clock_to_base_table[CLOCK_REALTIME] = HRTIMER_BASE_REALTIME; | ||
| 1726 | hrtimer_clock_to_base_table[CLOCK_MONOTONIC] = HRTIMER_BASE_MONOTONIC; | ||
| 1727 | hrtimer_clock_to_base_table[CLOCK_BOOTTIME] = HRTIMER_BASE_BOOTTIME; | ||
| 1728 | |||
| 1729 | hrtimer_cpu_notify(&hrtimers_nb, (unsigned long)CPU_UP_PREPARE, | 1729 | hrtimer_cpu_notify(&hrtimers_nb, (unsigned long)CPU_UP_PREPARE, |
| 1730 | (void *)(long)smp_processor_id()); | 1730 | (void *)(long)smp_processor_id()); |
| 1731 | register_cpu_notifier(&hrtimers_nb); | 1731 | register_cpu_notifier(&hrtimers_nb); |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index dd201bd35103..834899f2500f 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
| @@ -419,7 +419,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
| 419 | } else { | 419 | } else { |
| 420 | seq_printf(p, " %8s", "None"); | 420 | seq_printf(p, " %8s", "None"); |
| 421 | } | 421 | } |
| 422 | #ifdef CONFIG_GENIRC_IRQ_SHOW_LEVEL | 422 | #ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL |
| 423 | seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge"); | 423 | seq_printf(p, " %-8s", irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge"); |
| 424 | #endif | 424 | #endif |
| 425 | if (desc->name) | 425 | if (desc->name) |
diff --git a/kernel/kexec.c b/kernel/kexec.c index 55936f9cb251..87b77de03dd3 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/vmalloc.h> | 33 | #include <linux/vmalloc.h> |
| 34 | #include <linux/swap.h> | 34 | #include <linux/swap.h> |
| 35 | #include <linux/kmsg_dump.h> | 35 | #include <linux/kmsg_dump.h> |
| 36 | #include <linux/syscore_ops.h> | ||
| 36 | 37 | ||
| 37 | #include <asm/page.h> | 38 | #include <asm/page.h> |
| 38 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
| @@ -1532,6 +1533,11 @@ int kernel_kexec(void) | |||
| 1532 | local_irq_disable(); | 1533 | local_irq_disable(); |
| 1533 | /* Suspend system devices */ | 1534 | /* Suspend system devices */ |
| 1534 | error = sysdev_suspend(PMSG_FREEZE); | 1535 | error = sysdev_suspend(PMSG_FREEZE); |
| 1536 | if (!error) { | ||
| 1537 | error = syscore_suspend(); | ||
| 1538 | if (error) | ||
| 1539 | sysdev_resume(); | ||
| 1540 | } | ||
| 1535 | if (error) | 1541 | if (error) |
| 1536 | goto Enable_irqs; | 1542 | goto Enable_irqs; |
| 1537 | } else | 1543 | } else |
| @@ -1546,6 +1552,7 @@ int kernel_kexec(void) | |||
| 1546 | 1552 | ||
| 1547 | #ifdef CONFIG_KEXEC_JUMP | 1553 | #ifdef CONFIG_KEXEC_JUMP |
| 1548 | if (kexec_image->preserve_context) { | 1554 | if (kexec_image->preserve_context) { |
| 1555 | syscore_resume(); | ||
| 1549 | sysdev_resume(); | 1556 | sysdev_resume(); |
| 1550 | Enable_irqs: | 1557 | Enable_irqs: |
| 1551 | local_irq_enable(); | 1558 | local_irq_enable(); |
diff --git a/kernel/pid.c b/kernel/pid.c index 02f221274265..57a8346a270e 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
| @@ -217,11 +217,14 @@ static int alloc_pidmap(struct pid_namespace *pid_ns) | |||
| 217 | return -1; | 217 | return -1; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | int next_pidmap(struct pid_namespace *pid_ns, int last) | 220 | int next_pidmap(struct pid_namespace *pid_ns, unsigned int last) |
| 221 | { | 221 | { |
| 222 | int offset; | 222 | int offset; |
| 223 | struct pidmap *map, *end; | 223 | struct pidmap *map, *end; |
| 224 | 224 | ||
| 225 | if (last >= PID_MAX_LIMIT) | ||
| 226 | return -1; | ||
| 227 | |||
| 225 | offset = (last + 1) & BITS_PER_PAGE_MASK; | 228 | offset = (last + 1) & BITS_PER_PAGE_MASK; |
| 226 | map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE]; | 229 | map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE]; |
| 227 | end = &pid_ns->pidmap[PIDMAP_ENTRIES]; | 230 | end = &pid_ns->pidmap[PIDMAP_ENTRIES]; |
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index aeabd26e3342..50aae660174d 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
| @@ -273,8 +273,11 @@ static int create_image(int platform_mode) | |||
| 273 | local_irq_disable(); | 273 | local_irq_disable(); |
| 274 | 274 | ||
| 275 | error = sysdev_suspend(PMSG_FREEZE); | 275 | error = sysdev_suspend(PMSG_FREEZE); |
| 276 | if (!error) | 276 | if (!error) { |
| 277 | error = syscore_suspend(); | 277 | error = syscore_suspend(); |
| 278 | if (error) | ||
| 279 | sysdev_resume(); | ||
| 280 | } | ||
| 278 | if (error) { | 281 | if (error) { |
| 279 | printk(KERN_ERR "PM: Some system devices failed to power down, " | 282 | printk(KERN_ERR "PM: Some system devices failed to power down, " |
| 280 | "aborting hibernation\n"); | 283 | "aborting hibernation\n"); |
| @@ -407,8 +410,11 @@ static int resume_target_kernel(bool platform_mode) | |||
| 407 | local_irq_disable(); | 410 | local_irq_disable(); |
| 408 | 411 | ||
| 409 | error = sysdev_suspend(PMSG_QUIESCE); | 412 | error = sysdev_suspend(PMSG_QUIESCE); |
| 410 | if (!error) | 413 | if (!error) { |
| 411 | error = syscore_suspend(); | 414 | error = syscore_suspend(); |
| 415 | if (error) | ||
| 416 | sysdev_resume(); | ||
| 417 | } | ||
| 412 | if (error) | 418 | if (error) |
| 413 | goto Enable_irqs; | 419 | goto Enable_irqs; |
| 414 | 420 | ||
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 2814c32aed51..8935369d503a 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
| @@ -164,8 +164,11 @@ static int suspend_enter(suspend_state_t state) | |||
| 164 | BUG_ON(!irqs_disabled()); | 164 | BUG_ON(!irqs_disabled()); |
| 165 | 165 | ||
| 166 | error = sysdev_suspend(PMSG_SUSPEND); | 166 | error = sysdev_suspend(PMSG_SUSPEND); |
| 167 | if (!error) | 167 | if (!error) { |
| 168 | error = syscore_suspend(); | 168 | error = syscore_suspend(); |
| 169 | if (error) | ||
| 170 | sysdev_resume(); | ||
| 171 | } | ||
| 169 | if (!error) { | 172 | if (!error) { |
| 170 | if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { | 173 | if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { |
| 171 | error = suspend_ops->enter(state); | 174 | error = suspend_ops->enter(state); |
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c index 25028dd4fa18..c340ca658f37 100644 --- a/kernel/time/posix-clock.c +++ b/kernel/time/posix-clock.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | */ | 19 | */ |
| 20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
| 21 | #include <linux/file.h> | 21 | #include <linux/file.h> |
| 22 | #include <linux/mutex.h> | ||
| 23 | #include <linux/posix-clock.h> | 22 | #include <linux/posix-clock.h> |
| 24 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 25 | #include <linux/syscalls.h> | 24 | #include <linux/syscalls.h> |
| @@ -34,19 +33,19 @@ static struct posix_clock *get_posix_clock(struct file *fp) | |||
| 34 | { | 33 | { |
| 35 | struct posix_clock *clk = fp->private_data; | 34 | struct posix_clock *clk = fp->private_data; |
| 36 | 35 | ||
| 37 | mutex_lock(&clk->mutex); | 36 | down_read(&clk->rwsem); |
| 38 | 37 | ||
| 39 | if (!clk->zombie) | 38 | if (!clk->zombie) |
| 40 | return clk; | 39 | return clk; |
| 41 | 40 | ||
| 42 | mutex_unlock(&clk->mutex); | 41 | up_read(&clk->rwsem); |
| 43 | 42 | ||
| 44 | return NULL; | 43 | return NULL; |
| 45 | } | 44 | } |
| 46 | 45 | ||
| 47 | static void put_posix_clock(struct posix_clock *clk) | 46 | static void put_posix_clock(struct posix_clock *clk) |
| 48 | { | 47 | { |
| 49 | mutex_unlock(&clk->mutex); | 48 | up_read(&clk->rwsem); |
| 50 | } | 49 | } |
| 51 | 50 | ||
| 52 | static ssize_t posix_clock_read(struct file *fp, char __user *buf, | 51 | static ssize_t posix_clock_read(struct file *fp, char __user *buf, |
| @@ -156,7 +155,7 @@ static int posix_clock_open(struct inode *inode, struct file *fp) | |||
| 156 | struct posix_clock *clk = | 155 | struct posix_clock *clk = |
| 157 | container_of(inode->i_cdev, struct posix_clock, cdev); | 156 | container_of(inode->i_cdev, struct posix_clock, cdev); |
| 158 | 157 | ||
| 159 | mutex_lock(&clk->mutex); | 158 | down_read(&clk->rwsem); |
| 160 | 159 | ||
| 161 | if (clk->zombie) { | 160 | if (clk->zombie) { |
| 162 | err = -ENODEV; | 161 | err = -ENODEV; |
| @@ -172,7 +171,7 @@ static int posix_clock_open(struct inode *inode, struct file *fp) | |||
| 172 | fp->private_data = clk; | 171 | fp->private_data = clk; |
| 173 | } | 172 | } |
| 174 | out: | 173 | out: |
| 175 | mutex_unlock(&clk->mutex); | 174 | up_read(&clk->rwsem); |
| 176 | return err; | 175 | return err; |
| 177 | } | 176 | } |
| 178 | 177 | ||
| @@ -211,25 +210,20 @@ int posix_clock_register(struct posix_clock *clk, dev_t devid) | |||
| 211 | int err; | 210 | int err; |
| 212 | 211 | ||
| 213 | kref_init(&clk->kref); | 212 | kref_init(&clk->kref); |
| 214 | mutex_init(&clk->mutex); | 213 | init_rwsem(&clk->rwsem); |
| 215 | 214 | ||
| 216 | cdev_init(&clk->cdev, &posix_clock_file_operations); | 215 | cdev_init(&clk->cdev, &posix_clock_file_operations); |
| 217 | clk->cdev.owner = clk->ops.owner; | 216 | clk->cdev.owner = clk->ops.owner; |
| 218 | err = cdev_add(&clk->cdev, devid, 1); | 217 | err = cdev_add(&clk->cdev, devid, 1); |
| 219 | if (err) | ||
| 220 | goto no_cdev; | ||
| 221 | 218 | ||
| 222 | return err; | 219 | return err; |
| 223 | no_cdev: | ||
| 224 | mutex_destroy(&clk->mutex); | ||
| 225 | return err; | ||
| 226 | } | 220 | } |
| 227 | EXPORT_SYMBOL_GPL(posix_clock_register); | 221 | EXPORT_SYMBOL_GPL(posix_clock_register); |
| 228 | 222 | ||
| 229 | static void delete_clock(struct kref *kref) | 223 | static void delete_clock(struct kref *kref) |
| 230 | { | 224 | { |
| 231 | struct posix_clock *clk = container_of(kref, struct posix_clock, kref); | 225 | struct posix_clock *clk = container_of(kref, struct posix_clock, kref); |
| 232 | mutex_destroy(&clk->mutex); | 226 | |
| 233 | if (clk->release) | 227 | if (clk->release) |
| 234 | clk->release(clk); | 228 | clk->release(clk); |
| 235 | } | 229 | } |
| @@ -238,9 +232,9 @@ void posix_clock_unregister(struct posix_clock *clk) | |||
| 238 | { | 232 | { |
| 239 | cdev_del(&clk->cdev); | 233 | cdev_del(&clk->cdev); |
| 240 | 234 | ||
| 241 | mutex_lock(&clk->mutex); | 235 | down_write(&clk->rwsem); |
| 242 | clk->zombie = true; | 236 | clk->zombie = true; |
| 243 | mutex_unlock(&clk->mutex); | 237 | up_write(&clk->rwsem); |
| 244 | 238 | ||
| 245 | kref_put(&clk->kref, delete_clock); | 239 | kref_put(&clk->kref, delete_clock); |
| 246 | } | 240 | } |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 61d7d59f4a1a..2ad39e556cb4 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
| @@ -141,7 +141,7 @@ if FTRACE | |||
| 141 | config FUNCTION_TRACER | 141 | config FUNCTION_TRACER |
| 142 | bool "Kernel Function Tracer" | 142 | bool "Kernel Function Tracer" |
| 143 | depends on HAVE_FUNCTION_TRACER | 143 | depends on HAVE_FUNCTION_TRACER |
| 144 | select FRAME_POINTER if !ARM_UNWIND && !S390 | 144 | select FRAME_POINTER if !ARM_UNWIND && !S390 && !MICROBLAZE |
| 145 | select KALLSYMS | 145 | select KALLSYMS |
| 146 | select GENERIC_TRACER | 146 | select GENERIC_TRACER |
| 147 | select CONTEXT_SWITCH_TRACER | 147 | select CONTEXT_SWITCH_TRACER |
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 140dce750450..14733d4d156b 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
| @@ -430,9 +430,12 @@ static int watchdog_enable(int cpu) | |||
| 430 | p = kthread_create(watchdog, (void *)(unsigned long)cpu, "watchdog/%d", cpu); | 430 | p = kthread_create(watchdog, (void *)(unsigned long)cpu, "watchdog/%d", cpu); |
| 431 | if (IS_ERR(p)) { | 431 | if (IS_ERR(p)) { |
| 432 | printk(KERN_ERR "softlockup watchdog for %i failed\n", cpu); | 432 | printk(KERN_ERR "softlockup watchdog for %i failed\n", cpu); |
| 433 | if (!err) | 433 | if (!err) { |
| 434 | /* if hardlockup hasn't already set this */ | 434 | /* if hardlockup hasn't already set this */ |
| 435 | err = PTR_ERR(p); | 435 | err = PTR_ERR(p); |
| 436 | /* and disable the perf event */ | ||
| 437 | watchdog_nmi_disable(cpu); | ||
| 438 | } | ||
| 436 | goto out; | 439 | goto out; |
| 437 | } | 440 | } |
| 438 | kthread_bind(p, cpu); | 441 | kthread_bind(p, cpu); |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 8859a41806dd..e3378e8d3a5c 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -1291,8 +1291,14 @@ __acquires(&gcwq->lock) | |||
| 1291 | return true; | 1291 | return true; |
| 1292 | spin_unlock_irq(&gcwq->lock); | 1292 | spin_unlock_irq(&gcwq->lock); |
| 1293 | 1293 | ||
| 1294 | /* CPU has come up in between, retry migration */ | 1294 | /* |
| 1295 | * We've raced with CPU hot[un]plug. Give it a breather | ||
| 1296 | * and retry migration. cond_resched() is required here; | ||
| 1297 | * otherwise, we might deadlock against cpu_stop trying to | ||
| 1298 | * bring down the CPU on non-preemptive kernel. | ||
| 1299 | */ | ||
| 1295 | cpu_relax(); | 1300 | cpu_relax(); |
| 1301 | cond_resched(); | ||
| 1296 | } | 1302 | } |
| 1297 | } | 1303 | } |
| 1298 | 1304 | ||
