diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2009-09-01 00:54:14 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2009-09-01 00:54:14 -0400 |
| commit | ac6a0cf6716bb46813d0161024c66c2af66e53d1 (patch) | |
| tree | c7f53b1a04c590032c022549f3186fb9b04f8358 /kernel | |
| parent | e76a0136a3cf1859fbc07f122e42293d22229558 (diff) | |
| parent | ce3f7cb96e67d6518c7fc7b361a76409c3817d64 (diff) | |
Merge branch 'master' into sh/smp
Conflicts:
arch/sh/mm/cache-sh4.c
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/fork.c | 1 | ||||
| -rw-r--r-- | kernel/irq/manage.c | 10 | ||||
| -rw-r--r-- | kernel/perf_counter.c | 15 | ||||
| -rw-r--r-- | kernel/power/Kconfig | 14 | ||||
| -rw-r--r-- | kernel/power/main.c | 17 | ||||
| -rw-r--r-- | kernel/sysctl.c | 7 |
6 files changed, 58 insertions, 6 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 021e1138556..144326b7af5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -426,7 +426,6 @@ static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p) | |||
| 426 | init_rwsem(&mm->mmap_sem); | 426 | init_rwsem(&mm->mmap_sem); |
| 427 | INIT_LIST_HEAD(&mm->mmlist); | 427 | INIT_LIST_HEAD(&mm->mmlist); |
| 428 | mm->flags = (current->mm) ? current->mm->flags : default_dump_filter; | 428 | mm->flags = (current->mm) ? current->mm->flags : default_dump_filter; |
| 429 | mm->oom_adj = (current->mm) ? current->mm->oom_adj : 0; | ||
| 430 | mm->core_state = NULL; | 429 | mm->core_state = NULL; |
| 431 | mm->nr_ptes = 0; | 430 | mm->nr_ptes = 0; |
| 432 | set_mm_counter(mm, file_rss, 0); | 431 | set_mm_counter(mm, file_rss, 0); |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index d222515a5a0..0ec9ed83173 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -607,7 +607,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) | |||
| 607 | */ | 607 | */ |
| 608 | get_task_struct(t); | 608 | get_task_struct(t); |
| 609 | new->thread = t; | 609 | new->thread = t; |
| 610 | wake_up_process(t); | ||
| 611 | } | 610 | } |
| 612 | 611 | ||
| 613 | /* | 612 | /* |
| @@ -690,6 +689,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) | |||
| 690 | (int)(new->flags & IRQF_TRIGGER_MASK)); | 689 | (int)(new->flags & IRQF_TRIGGER_MASK)); |
| 691 | } | 690 | } |
| 692 | 691 | ||
| 692 | new->irq = irq; | ||
| 693 | *old_ptr = new; | 693 | *old_ptr = new; |
| 694 | 694 | ||
| 695 | /* Reset broken irq detection when installing new handler */ | 695 | /* Reset broken irq detection when installing new handler */ |
| @@ -707,7 +707,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) | |||
| 707 | 707 | ||
| 708 | spin_unlock_irqrestore(&desc->lock, flags); | 708 | spin_unlock_irqrestore(&desc->lock, flags); |
| 709 | 709 | ||
| 710 | new->irq = irq; | 710 | /* |
| 711 | * Strictly no need to wake it up, but hung_task complains | ||
| 712 | * when no hard interrupt wakes the thread up. | ||
| 713 | */ | ||
| 714 | if (new->thread) | ||
| 715 | wake_up_process(new->thread); | ||
| 716 | |||
| 711 | register_irq_proc(irq, desc); | 717 | register_irq_proc(irq, desc); |
| 712 | new->dir = NULL; | 718 | new->dir = NULL; |
| 713 | register_handler_proc(irq, new); | 719 | register_handler_proc(irq, new); |
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 534e20d14d6..36f65e2b8b5 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
| @@ -1503,10 +1503,21 @@ static void perf_counter_enable_on_exec(struct task_struct *task) | |||
| 1503 | */ | 1503 | */ |
| 1504 | static void __perf_counter_read(void *info) | 1504 | static void __perf_counter_read(void *info) |
| 1505 | { | 1505 | { |
| 1506 | struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context); | ||
| 1506 | struct perf_counter *counter = info; | 1507 | struct perf_counter *counter = info; |
| 1507 | struct perf_counter_context *ctx = counter->ctx; | 1508 | struct perf_counter_context *ctx = counter->ctx; |
| 1508 | unsigned long flags; | 1509 | unsigned long flags; |
| 1509 | 1510 | ||
| 1511 | /* | ||
| 1512 | * If this is a task context, we need to check whether it is | ||
| 1513 | * the current task context of this cpu. If not it has been | ||
| 1514 | * scheduled out before the smp call arrived. In that case | ||
| 1515 | * counter->count would have been updated to a recent sample | ||
| 1516 | * when the counter was scheduled out. | ||
| 1517 | */ | ||
| 1518 | if (ctx->task && cpuctx->task_ctx != ctx) | ||
| 1519 | return; | ||
| 1520 | |||
| 1510 | local_irq_save(flags); | 1521 | local_irq_save(flags); |
| 1511 | if (ctx->is_active) | 1522 | if (ctx->is_active) |
| 1512 | update_context_time(ctx); | 1523 | update_context_time(ctx); |
| @@ -2008,6 +2019,10 @@ int perf_counter_task_disable(void) | |||
| 2008 | return 0; | 2019 | return 0; |
| 2009 | } | 2020 | } |
| 2010 | 2021 | ||
| 2022 | #ifndef PERF_COUNTER_INDEX_OFFSET | ||
| 2023 | # define PERF_COUNTER_INDEX_OFFSET 0 | ||
| 2024 | #endif | ||
| 2025 | |||
| 2011 | static int perf_counter_index(struct perf_counter *counter) | 2026 | static int perf_counter_index(struct perf_counter *counter) |
| 2012 | { | 2027 | { |
| 2013 | if (counter->state != PERF_COUNTER_STATE_ACTIVE) | 2028 | if (counter->state != PERF_COUNTER_STATE_ACTIVE) |
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 72067cbdb37..91e09d3b2eb 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig | |||
| @@ -208,3 +208,17 @@ config APM_EMULATION | |||
| 208 | random kernel OOPSes or reboots that don't seem to be related to | 208 | random kernel OOPSes or reboots that don't seem to be related to |
| 209 | anything, try disabling/enabling this option (or disabling/enabling | 209 | anything, try disabling/enabling this option (or disabling/enabling |
| 210 | APM in your BIOS). | 210 | APM in your BIOS). |
| 211 | |||
| 212 | config PM_RUNTIME | ||
| 213 | bool "Run-time PM core functionality" | ||
| 214 | depends on PM | ||
| 215 | ---help--- | ||
| 216 | Enable functionality allowing I/O devices to be put into energy-saving | ||
| 217 | (low power) states at run time (or autosuspended) after a specified | ||
| 218 | period of inactivity and woken up in response to a hardware-generated | ||
| 219 | wake-up event or a driver's request. | ||
| 220 | |||
| 221 | Hardware support is generally required for this functionality to work | ||
| 222 | and the bus type drivers of the buses the devices are on are | ||
| 223 | responsible for the actual handling of the autosuspend requests and | ||
| 224 | wake-up events. | ||
diff --git a/kernel/power/main.c b/kernel/power/main.c index f710e36930c..347d2cc88cd 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/kobject.h> | 11 | #include <linux/kobject.h> |
| 12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
| 13 | #include <linux/resume-trace.h> | 13 | #include <linux/resume-trace.h> |
| 14 | #include <linux/workqueue.h> | ||
| 14 | 15 | ||
| 15 | #include "power.h" | 16 | #include "power.h" |
| 16 | 17 | ||
| @@ -217,8 +218,24 @@ static struct attribute_group attr_group = { | |||
| 217 | .attrs = g, | 218 | .attrs = g, |
| 218 | }; | 219 | }; |
| 219 | 220 | ||
| 221 | #ifdef CONFIG_PM_RUNTIME | ||
| 222 | struct workqueue_struct *pm_wq; | ||
| 223 | |||
| 224 | static int __init pm_start_workqueue(void) | ||
| 225 | { | ||
| 226 | pm_wq = create_freezeable_workqueue("pm"); | ||
| 227 | |||
| 228 | return pm_wq ? 0 : -ENOMEM; | ||
| 229 | } | ||
| 230 | #else | ||
| 231 | static inline int pm_start_workqueue(void) { return 0; } | ||
| 232 | #endif | ||
| 233 | |||
| 220 | static int __init pm_init(void) | 234 | static int __init pm_init(void) |
| 221 | { | 235 | { |
| 236 | int error = pm_start_workqueue(); | ||
| 237 | if (error) | ||
| 238 | return error; | ||
| 222 | power_kobj = kobject_create_and_add("power", NULL); | 239 | power_kobj = kobject_create_and_add("power", NULL); |
| 223 | if (!power_kobj) | 240 | if (!power_kobj) |
| 224 | return -ENOMEM; | 241 | return -ENOMEM; |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 98e02328c67..58be76017fd 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | #include <linux/acpi.h> | 49 | #include <linux/acpi.h> |
| 50 | #include <linux/reboot.h> | 50 | #include <linux/reboot.h> |
| 51 | #include <linux/ftrace.h> | 51 | #include <linux/ftrace.h> |
| 52 | #include <linux/security.h> | ||
| 52 | #include <linux/slow-work.h> | 53 | #include <linux/slow-work.h> |
| 53 | #include <linux/perf_counter.h> | 54 | #include <linux/perf_counter.h> |
| 54 | 55 | ||
| @@ -1306,10 +1307,10 @@ static struct ctl_table vm_table[] = { | |||
| 1306 | { | 1307 | { |
| 1307 | .ctl_name = CTL_UNNUMBERED, | 1308 | .ctl_name = CTL_UNNUMBERED, |
| 1308 | .procname = "mmap_min_addr", | 1309 | .procname = "mmap_min_addr", |
| 1309 | .data = &mmap_min_addr, | 1310 | .data = &dac_mmap_min_addr, |
| 1310 | .maxlen = sizeof(unsigned long), | 1311 | .maxlen = sizeof(unsigned long), |
| 1311 | .mode = 0644, | 1312 | .mode = 0644, |
| 1312 | .proc_handler = &proc_doulongvec_minmax, | 1313 | .proc_handler = &mmap_min_addr_handler, |
| 1313 | }, | 1314 | }, |
| 1314 | #ifdef CONFIG_NUMA | 1315 | #ifdef CONFIG_NUMA |
| 1315 | { | 1316 | { |
