aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpu.c4
-rw-r--r--kernel/irq/spurious.c2
-rw-r--r--kernel/module.c38
-rw-r--r--kernel/params.c6
-rw-r--r--kernel/power/swap.c9
-rw-r--r--kernel/power/user.c7
-rw-r--r--kernel/profile.c16
-rw-r--r--kernel/sched.c2
8 files changed, 67 insertions, 17 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 241064a32241..7406fe6966f9 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -204,7 +204,7 @@ int cpu_down(unsigned int cpu)
204#endif /*CONFIG_HOTPLUG_CPU*/ 204#endif /*CONFIG_HOTPLUG_CPU*/
205 205
206/* Requires cpu_add_remove_lock to be held */ 206/* Requires cpu_add_remove_lock to be held */
207static int __devinit _cpu_up(unsigned int cpu) 207static int __cpuinit _cpu_up(unsigned int cpu)
208{ 208{
209 int ret; 209 int ret;
210 void *hcpu = (void *)(long)cpu; 210 void *hcpu = (void *)(long)cpu;
@@ -239,7 +239,7 @@ out_notify:
239 return ret; 239 return ret;
240} 240}
241 241
242int __devinit cpu_up(unsigned int cpu) 242int __cpuinit cpu_up(unsigned int cpu)
243{ 243{
244 int err = 0; 244 int err = 0;
245 245
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index 543ea2e5ad93..9d8c79b48823 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -176,7 +176,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
176 176
177int noirqdebug __read_mostly; 177int noirqdebug __read_mostly;
178 178
179int __init noirqdebug_setup(char *str) 179int noirqdebug_setup(char *str)
180{ 180{
181 noirqdebug = 1; 181 noirqdebug = 1;
182 printk(KERN_INFO "IRQ lockup detection disabled\n"); 182 printk(KERN_INFO "IRQ lockup detection disabled\n");
diff --git a/kernel/module.c b/kernel/module.c
index dbce132b354c..d0f2260a0210 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1148,10 +1148,10 @@ static int mod_sysfs_setup(struct module *mod,
1148 kobject_uevent(&mod->mkobj.kobj, KOBJ_ADD); 1148 kobject_uevent(&mod->mkobj.kobj, KOBJ_ADD);
1149 return 0; 1149 return 0;
1150 1150
1151out_unreg_drivers:
1152 kobject_unregister(mod->drivers_dir);
1153out_unreg_param: 1151out_unreg_param:
1154 module_param_sysfs_remove(mod); 1152 module_param_sysfs_remove(mod);
1153out_unreg_drivers:
1154 kobject_unregister(mod->drivers_dir);
1155out_unreg: 1155out_unreg:
1156 kobject_del(&mod->mkobj.kobj); 1156 kobject_del(&mod->mkobj.kobj);
1157 kobject_put(&mod->mkobj.kobj); 1157 kobject_put(&mod->mkobj.kobj);
@@ -2327,8 +2327,22 @@ void print_modules(void)
2327 printk("\n"); 2327 printk("\n");
2328} 2328}
2329 2329
2330static char *make_driver_name(struct device_driver *drv)
2331{
2332 char *driver_name;
2333
2334 driver_name = kmalloc(strlen(drv->name) + strlen(drv->bus->name) + 2,
2335 GFP_KERNEL);
2336 if (!driver_name)
2337 return NULL;
2338
2339 sprintf(driver_name, "%s:%s", drv->bus->name, drv->name);
2340 return driver_name;
2341}
2342
2330void module_add_driver(struct module *mod, struct device_driver *drv) 2343void module_add_driver(struct module *mod, struct device_driver *drv)
2331{ 2344{
2345 char *driver_name;
2332 int no_warn; 2346 int no_warn;
2333 2347
2334 if (!mod || !drv) 2348 if (!mod || !drv)
@@ -2336,17 +2350,31 @@ void module_add_driver(struct module *mod, struct device_driver *drv)
2336 2350
2337 /* Don't check return codes; these calls are idempotent */ 2351 /* Don't check return codes; these calls are idempotent */
2338 no_warn = sysfs_create_link(&drv->kobj, &mod->mkobj.kobj, "module"); 2352 no_warn = sysfs_create_link(&drv->kobj, &mod->mkobj.kobj, "module");
2339 no_warn = sysfs_create_link(mod->drivers_dir, &drv->kobj, drv->name); 2353 driver_name = make_driver_name(drv);
2354 if (driver_name) {
2355 no_warn = sysfs_create_link(mod->drivers_dir, &drv->kobj,
2356 driver_name);
2357 kfree(driver_name);
2358 }
2340} 2359}
2341EXPORT_SYMBOL(module_add_driver); 2360EXPORT_SYMBOL(module_add_driver);
2342 2361
2343void module_remove_driver(struct device_driver *drv) 2362void module_remove_driver(struct device_driver *drv)
2344{ 2363{
2364 char *driver_name;
2365
2345 if (!drv) 2366 if (!drv)
2346 return; 2367 return;
2368
2347 sysfs_remove_link(&drv->kobj, "module"); 2369 sysfs_remove_link(&drv->kobj, "module");
2348 if (drv->owner && drv->owner->drivers_dir) 2370 if (drv->owner && drv->owner->drivers_dir) {
2349 sysfs_remove_link(drv->owner->drivers_dir, drv->name); 2371 driver_name = make_driver_name(drv);
2372 if (driver_name) {
2373 sysfs_remove_link(drv->owner->drivers_dir,
2374 driver_name);
2375 kfree(driver_name);
2376 }
2377 }
2350} 2378}
2351EXPORT_SYMBOL(module_remove_driver); 2379EXPORT_SYMBOL(module_remove_driver);
2352 2380
diff --git a/kernel/params.c b/kernel/params.c
index f406655d6653..718945da8f58 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -143,9 +143,15 @@ int parse_args(const char *name,
143 143
144 while (*args) { 144 while (*args) {
145 int ret; 145 int ret;
146 int irq_was_disabled;
146 147
147 args = next_arg(args, &param, &val); 148 args = next_arg(args, &param, &val);
149 irq_was_disabled = irqs_disabled();
148 ret = parse_one(param, val, params, num, unknown); 150 ret = parse_one(param, val, params, num, unknown);
151 if (irq_was_disabled && !irqs_disabled()) {
152 printk(KERN_WARNING "parse_args(): option '%s' enabled "
153 "irq's!\n", param);
154 }
149 switch (ret) { 155 switch (ret) {
150 case -ENOENT: 156 case -ENOENT:
151 printk(KERN_ERR "%s: Unknown parameter `%s'\n", 157 printk(KERN_ERR "%s: Unknown parameter `%s'\n",
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index f133d4a6d817..3581f8f86acd 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -165,14 +165,15 @@ static int swsusp_swap_check(void) /* This is called before saving image */
165{ 165{
166 int res; 166 int res;
167 167
168 res = swap_type_of(swsusp_resume_device, swsusp_resume_block); 168 res = swap_type_of(swsusp_resume_device, swsusp_resume_block,
169 &resume_bdev);
169 if (res < 0) 170 if (res < 0)
170 return res; 171 return res;
171 172
172 root_swap = res; 173 root_swap = res;
173 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_WRITE); 174 res = blkdev_get(resume_bdev, FMODE_WRITE, O_RDWR);
174 if (IS_ERR(resume_bdev)) 175 if (res)
175 return PTR_ERR(resume_bdev); 176 return res;
176 177
177 res = set_blocksize(resume_bdev, PAGE_SIZE); 178 res = set_blocksize(resume_bdev, PAGE_SIZE);
178 if (res < 0) 179 if (res < 0)
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 89443b85163b..f7b7a785a5c6 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -57,7 +57,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
57 memset(&data->handle, 0, sizeof(struct snapshot_handle)); 57 memset(&data->handle, 0, sizeof(struct snapshot_handle));
58 if ((filp->f_flags & O_ACCMODE) == O_RDONLY) { 58 if ((filp->f_flags & O_ACCMODE) == O_RDONLY) {
59 data->swap = swsusp_resume_device ? 59 data->swap = swsusp_resume_device ?
60 swap_type_of(swsusp_resume_device, 0) : -1; 60 swap_type_of(swsusp_resume_device, 0, NULL) : -1;
61 data->mode = O_RDONLY; 61 data->mode = O_RDONLY;
62 } else { 62 } else {
63 data->swap = -1; 63 data->swap = -1;
@@ -268,7 +268,8 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
268 * so we need to recode them 268 * so we need to recode them
269 */ 269 */
270 if (old_decode_dev(arg)) { 270 if (old_decode_dev(arg)) {
271 data->swap = swap_type_of(old_decode_dev(arg), 0); 271 data->swap = swap_type_of(old_decode_dev(arg),
272 0, NULL);
272 if (data->swap < 0) 273 if (data->swap < 0)
273 error = -ENODEV; 274 error = -ENODEV;
274 } else { 275 } else {
@@ -365,7 +366,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
365 swdev = old_decode_dev(swap_area.dev); 366 swdev = old_decode_dev(swap_area.dev);
366 if (swdev) { 367 if (swdev) {
367 offset = swap_area.offset; 368 offset = swap_area.offset;
368 data->swap = swap_type_of(swdev, offset); 369 data->swap = swap_type_of(swdev, offset, NULL);
369 if (data->swap < 0) 370 if (data->swap < 0)
370 error = -ENODEV; 371 error = -ENODEV;
371 } else { 372 } else {
diff --git a/kernel/profile.c b/kernel/profile.c
index fb5e03d57e9d..a6574a18514e 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -40,7 +40,10 @@ int (*timer_hook)(struct pt_regs *) __read_mostly;
40 40
41static atomic_t *prof_buffer; 41static atomic_t *prof_buffer;
42static unsigned long prof_len, prof_shift; 42static unsigned long prof_len, prof_shift;
43
43int prof_on __read_mostly; 44int prof_on __read_mostly;
45EXPORT_SYMBOL_GPL(prof_on);
46
44static cpumask_t prof_cpu_mask = CPU_MASK_ALL; 47static cpumask_t prof_cpu_mask = CPU_MASK_ALL;
45#ifdef CONFIG_SMP 48#ifdef CONFIG_SMP
46static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits); 49static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
@@ -52,6 +55,7 @@ static int __init profile_setup(char * str)
52{ 55{
53 static char __initdata schedstr[] = "schedule"; 56 static char __initdata schedstr[] = "schedule";
54 static char __initdata sleepstr[] = "sleep"; 57 static char __initdata sleepstr[] = "sleep";
58 static char __initdata kvmstr[] = "kvm";
55 int par; 59 int par;
56 60
57 if (!strncmp(str, sleepstr, strlen(sleepstr))) { 61 if (!strncmp(str, sleepstr, strlen(sleepstr))) {
@@ -63,7 +67,7 @@ static int __init profile_setup(char * str)
63 printk(KERN_INFO 67 printk(KERN_INFO
64 "kernel sleep profiling enabled (shift: %ld)\n", 68 "kernel sleep profiling enabled (shift: %ld)\n",
65 prof_shift); 69 prof_shift);
66 } else if (!strncmp(str, sleepstr, strlen(sleepstr))) { 70 } else if (!strncmp(str, schedstr, strlen(schedstr))) {
67 prof_on = SCHED_PROFILING; 71 prof_on = SCHED_PROFILING;
68 if (str[strlen(schedstr)] == ',') 72 if (str[strlen(schedstr)] == ',')
69 str += strlen(schedstr) + 1; 73 str += strlen(schedstr) + 1;
@@ -72,6 +76,15 @@ static int __init profile_setup(char * str)
72 printk(KERN_INFO 76 printk(KERN_INFO
73 "kernel schedule profiling enabled (shift: %ld)\n", 77 "kernel schedule profiling enabled (shift: %ld)\n",
74 prof_shift); 78 prof_shift);
79 } else if (!strncmp(str, kvmstr, strlen(kvmstr))) {
80 prof_on = KVM_PROFILING;
81 if (str[strlen(kvmstr)] == ',')
82 str += strlen(kvmstr) + 1;
83 if (get_option(&str, &par))
84 prof_shift = par;
85 printk(KERN_INFO
86 "kernel KVM profiling enabled (shift: %ld)\n",
87 prof_shift);
75 } else if (get_option(&str, &par)) { 88 } else if (get_option(&str, &par)) {
76 prof_shift = par; 89 prof_shift = par;
77 prof_on = CPU_PROFILING; 90 prof_on = CPU_PROFILING;
@@ -318,6 +331,7 @@ out:
318 local_irq_restore(flags); 331 local_irq_restore(flags);
319 put_cpu(); 332 put_cpu();
320} 333}
334EXPORT_SYMBOL_GPL(profile_hits);
321 335
322static int __devinit profile_cpu_callback(struct notifier_block *info, 336static int __devinit profile_cpu_callback(struct notifier_block *info,
323 unsigned long action, void *__cpu) 337 unsigned long action, void *__cpu)
diff --git a/kernel/sched.c b/kernel/sched.c
index 3df33da0dafc..cca93cc0dd7d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6865,7 +6865,7 @@ void __init sched_init_smp(void)
6865 6865
6866 lock_cpu_hotplug(); 6866 lock_cpu_hotplug();
6867 arch_init_sched_domains(&cpu_online_map); 6867 arch_init_sched_domains(&cpu_online_map);
6868 cpus_andnot(non_isolated_cpus, cpu_online_map, cpu_isolated_map); 6868 cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);
6869 if (cpus_empty(non_isolated_cpus)) 6869 if (cpus_empty(non_isolated_cpus))
6870 cpu_set(smp_processor_id(), non_isolated_cpus); 6870 cpu_set(smp_processor_id(), non_isolated_cpus);
6871 unlock_cpu_hotplug(); 6871 unlock_cpu_hotplug();