aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/smpboot.c6
-rw-r--r--arch/i386/mm/boot_ioremap.c7
-rw-r--r--arch/ia64/kernel/acpi.c13
-rw-r--r--arch/ia64/kernel/numa.c34
-rw-r--r--arch/ia64/kernel/topology.c6
-rw-r--r--drivers/char/rtc.c5
-rw-r--r--drivers/media/video/videodev.c2
-rw-r--r--drivers/video/fbsysfs.c12
-rw-r--r--fs/autofs4/expire.c6
-rw-r--r--include/asm-ia64/numa.h4
-rw-r--r--kernel/module.c6
-rw-r--r--mm/page_alloc.c4
12 files changed, 86 insertions, 19 deletions
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index f948419c888a..efe07990e7fc 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -642,9 +642,13 @@ static void map_cpu_to_logical_apicid(void)
642{ 642{
643 int cpu = smp_processor_id(); 643 int cpu = smp_processor_id();
644 int apicid = logical_smp_processor_id(); 644 int apicid = logical_smp_processor_id();
645 int node = apicid_to_node(apicid);
646
647 if (!node_online(node))
648 node = first_online_node;
645 649
646 cpu_2_logical_apicid[cpu] = apicid; 650 cpu_2_logical_apicid[cpu] = apicid;
647 map_cpu_to_node(cpu, apicid_to_node(apicid)); 651 map_cpu_to_node(cpu, node);
648} 652}
649 653
650static void unmap_cpu_to_logical_apicid(int cpu) 654static void unmap_cpu_to_logical_apicid(int cpu)
diff --git a/arch/i386/mm/boot_ioremap.c b/arch/i386/mm/boot_ioremap.c
index 5d44f4f5ff59..4de11f508c3a 100644
--- a/arch/i386/mm/boot_ioremap.c
+++ b/arch/i386/mm/boot_ioremap.c
@@ -29,8 +29,11 @@
29 */ 29 */
30 30
31#define BOOT_PTE_PTRS (PTRS_PER_PTE*2) 31#define BOOT_PTE_PTRS (PTRS_PER_PTE*2)
32#define boot_pte_index(address) \ 32
33 (((address) >> PAGE_SHIFT) & (BOOT_PTE_PTRS - 1)) 33static unsigned long boot_pte_index(unsigned long vaddr)
34{
35 return __pa(vaddr) >> PAGE_SHIFT;
36}
34 37
35static inline boot_pte_t* boot_vaddr_to_pte(void *address) 38static inline boot_pte_t* boot_vaddr_to_pte(void *address)
36{ 39{
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 0176556aeecc..32c3abededc6 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -771,16 +771,19 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
771{ 771{
772#ifdef CONFIG_ACPI_NUMA 772#ifdef CONFIG_ACPI_NUMA
773 int pxm_id; 773 int pxm_id;
774 int nid;
774 775
775 pxm_id = acpi_get_pxm(handle); 776 pxm_id = acpi_get_pxm(handle);
776
777 /* 777 /*
778 * Assuming that the container driver would have set the proximity 778 * We don't have cpu-only-node hotadd. But if the system equips
779 * domain and would have initialized pxm_to_node(pxm_id) && pxm_flag 779 * SRAT table, pxm is already found and node is ready.
780 * So, just pxm_to_nid(pxm) is OK.
781 * This code here is for the system which doesn't have full SRAT
782 * table for possible cpus.
780 */ 783 */
781 node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_node(pxm_id); 784 nid = acpi_map_pxm_to_node(pxm_id);
782
783 node_cpuid[cpu].phys_id = physid; 785 node_cpuid[cpu].phys_id = physid;
786 node_cpuid[cpu].nid = nid;
784#endif 787#endif
785 return (0); 788 return (0);
786} 789}
diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c
index 1cc360c83e7a..20340631179f 100644
--- a/arch/ia64/kernel/numa.c
+++ b/arch/ia64/kernel/numa.c
@@ -29,6 +29,36 @@ EXPORT_SYMBOL(cpu_to_node_map);
29 29
30cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; 30cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
31 31
32void __cpuinit map_cpu_to_node(int cpu, int nid)
33{
34 int oldnid;
35 if (nid < 0) { /* just initialize by zero */
36 cpu_to_node_map[cpu] = 0;
37 return;
38 }
39 /* sanity check first */
40 oldnid = cpu_to_node_map[cpu];
41 if (cpu_isset(cpu, node_to_cpu_mask[oldnid])) {
42 return; /* nothing to do */
43 }
44 /* we don't have cpu-driven node hot add yet...
45 In usual case, node is created from SRAT at boot time. */
46 if (!node_online(nid))
47 nid = first_online_node;
48 cpu_to_node_map[cpu] = nid;
49 cpu_set(cpu, node_to_cpu_mask[nid]);
50 return;
51}
52
53void __cpuinit unmap_cpu_from_node(int cpu, int nid)
54{
55 WARN_ON(!cpu_isset(cpu, node_to_cpu_mask[nid]));
56 WARN_ON(cpu_to_node_map[cpu] != nid);
57 cpu_to_node_map[cpu] = 0;
58 cpu_clear(cpu, node_to_cpu_mask[nid]);
59}
60
61
32/** 62/**
33 * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays 63 * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays
34 * 64 *
@@ -49,8 +79,6 @@ void __init build_cpu_to_node_map(void)
49 node = node_cpuid[i].nid; 79 node = node_cpuid[i].nid;
50 break; 80 break;
51 } 81 }
52 cpu_to_node_map[cpu] = (node >= 0) ? node : 0; 82 map_cpu_to_node(cpu, node);
53 if (node >= 0)
54 cpu_set(cpu, node_to_cpu_mask[node]);
55 } 83 }
56} 84}
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index f648c610b10c..05bdf7affb43 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -36,6 +36,9 @@ int arch_register_cpu(int num)
36 */ 36 */
37 if (!can_cpei_retarget() && is_cpu_cpei_target(num)) 37 if (!can_cpei_retarget() && is_cpu_cpei_target(num))
38 sysfs_cpus[num].cpu.no_control = 1; 38 sysfs_cpus[num].cpu.no_control = 1;
39#ifdef CONFIG_NUMA
40 map_cpu_to_node(num, node_cpuid[num].nid);
41#endif
39#endif 42#endif
40 43
41 return register_cpu(&sysfs_cpus[num].cpu, num); 44 return register_cpu(&sysfs_cpus[num].cpu, num);
@@ -45,7 +48,8 @@ int arch_register_cpu(int num)
45 48
46void arch_unregister_cpu(int num) 49void arch_unregister_cpu(int num)
47{ 50{
48 return unregister_cpu(&sysfs_cpus[num].cpu); 51 unregister_cpu(&sysfs_cpus[num].cpu);
52 unmap_cpu_from_node(num, cpu_to_node(num));
49} 53}
50EXPORT_SYMBOL(arch_register_cpu); 54EXPORT_SYMBOL(arch_register_cpu);
51EXPORT_SYMBOL(arch_unregister_cpu); 55EXPORT_SYMBOL(arch_unregister_cpu);
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 6e6a7c7a7eff..ab6429b4a84e 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -209,11 +209,12 @@ static const unsigned char days_in_mo[] =
209 */ 209 */
210static inline unsigned char rtc_is_updating(void) 210static inline unsigned char rtc_is_updating(void)
211{ 211{
212 unsigned long flags;
212 unsigned char uip; 213 unsigned char uip;
213 214
214 spin_lock_irq(&rtc_lock); 215 spin_lock_irqsave(&rtc_lock, flags);
215 uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); 216 uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
216 spin_unlock_irq(&rtc_lock); 217 spin_unlock_irqrestore(&rtc_lock, flags);
217 return uip; 218 return uip;
218} 219}
219 220
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 88bf2af2a0e7..edd7b83c3464 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -836,7 +836,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
836 break; 836 break;
837 } 837 }
838 838
839 if (index<=0 || index >= vfd->tvnormsize) { 839 if (index < 0 || index >= vfd->tvnormsize) {
840 ret=-EINVAL; 840 ret=-EINVAL;
841 break; 841 break;
842 } 842 }
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index 4f78f234473d..c151dcf68786 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -397,6 +397,12 @@ static ssize_t store_bl_curve(struct class_device *class_device,
397 u8 tmp_curve[FB_BACKLIGHT_LEVELS]; 397 u8 tmp_curve[FB_BACKLIGHT_LEVELS];
398 unsigned int i; 398 unsigned int i;
399 399
400 /* Some drivers don't use framebuffer_alloc(), but those also
401 * don't have backlights.
402 */
403 if (!fb_info || !fb_info->bl_dev)
404 return -ENODEV;
405
400 if (count != (FB_BACKLIGHT_LEVELS / 8 * 24)) 406 if (count != (FB_BACKLIGHT_LEVELS / 8 * 24))
401 return -EINVAL; 407 return -EINVAL;
402 408
@@ -430,6 +436,12 @@ static ssize_t show_bl_curve(struct class_device *class_device, char *buf)
430 ssize_t len = 0; 436 ssize_t len = 0;
431 unsigned int i; 437 unsigned int i;
432 438
439 /* Some drivers don't use framebuffer_alloc(), but those also
440 * don't have backlights.
441 */
442 if (!fb_info || !fb_info->bl_dev)
443 return -ENODEV;
444
433 mutex_lock(&fb_info->bl_mutex); 445 mutex_lock(&fb_info->bl_mutex);
434 for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) 446 for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
435 len += snprintf(&buf[len], PAGE_SIZE, 447 len += snprintf(&buf[len], PAGE_SIZE,
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 8dbd44f10e9d..d96e5c14a9ca 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -32,7 +32,7 @@ static inline int autofs4_can_expire(struct dentry *dentry,
32 32
33 if (!do_now) { 33 if (!do_now) {
34 /* Too young to die */ 34 /* Too young to die */
35 if (time_after(ino->last_used + timeout, now)) 35 if (!timeout || time_after(ino->last_used + timeout, now))
36 return 0; 36 return 0;
37 37
38 /* update last_used here :- 38 /* update last_used here :-
@@ -253,7 +253,7 @@ static struct dentry *autofs4_expire_direct(struct super_block *sb,
253 struct dentry *root = dget(sb->s_root); 253 struct dentry *root = dget(sb->s_root);
254 int do_now = how & AUTOFS_EXP_IMMEDIATE; 254 int do_now = how & AUTOFS_EXP_IMMEDIATE;
255 255
256 if (!sbi->exp_timeout || !root) 256 if (!root)
257 return NULL; 257 return NULL;
258 258
259 now = jiffies; 259 now = jiffies;
@@ -293,7 +293,7 @@ static struct dentry *autofs4_expire_indirect(struct super_block *sb,
293 int do_now = how & AUTOFS_EXP_IMMEDIATE; 293 int do_now = how & AUTOFS_EXP_IMMEDIATE;
294 int exp_leaves = how & AUTOFS_EXP_LEAVES; 294 int exp_leaves = how & AUTOFS_EXP_LEAVES;
295 295
296 if ( !sbi->exp_timeout || !root ) 296 if (!root)
297 return NULL; 297 return NULL;
298 298
299 now = jiffies; 299 now = jiffies;
diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h
index e5a8260593a5..e0a1d173e42d 100644
--- a/include/asm-ia64/numa.h
+++ b/include/asm-ia64/numa.h
@@ -64,6 +64,10 @@ extern int paddr_to_nid(unsigned long paddr);
64 64
65#define local_nodeid (cpu_to_node_map[smp_processor_id()]) 65#define local_nodeid (cpu_to_node_map[smp_processor_id()])
66 66
67extern void map_cpu_to_node(int cpu, int nid);
68extern void unmap_cpu_from_node(int cpu, int nid);
69
70
67#else /* !CONFIG_NUMA */ 71#else /* !CONFIG_NUMA */
68 72
69#define paddr_to_nid(addr) 0 73#define paddr_to_nid(addr) 0
diff --git a/kernel/module.c b/kernel/module.c
index 2a19cd47c046..b7fe6e840963 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1054,6 +1054,12 @@ static int mod_sysfs_setup(struct module *mod,
1054{ 1054{
1055 int err; 1055 int err;
1056 1056
1057 if (!module_subsys.kset.subsys) {
1058 printk(KERN_ERR "%s: module_subsys not initialized\n",
1059 mod->name);
1060 err = -EINVAL;
1061 goto out;
1062 }
1057 memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj)); 1063 memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj));
1058 err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name); 1064 err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name);
1059 if (err) 1065 if (err)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3b5358a0561f..8a52ba9fe693 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1845,8 +1845,10 @@ static inline void free_zone_pagesets(int cpu)
1845 for_each_zone(zone) { 1845 for_each_zone(zone) {
1846 struct per_cpu_pageset *pset = zone_pcp(zone, cpu); 1846 struct per_cpu_pageset *pset = zone_pcp(zone, cpu);
1847 1847
1848 /* Free per_cpu_pageset if it is slab allocated */
1849 if (pset != &boot_pageset[cpu])
1850 kfree(pset);
1848 zone_pcp(zone, cpu) = NULL; 1851 zone_pcp(zone, cpu) = NULL;
1849 kfree(pset);
1850 } 1852 }
1851} 1853}
1852 1854