Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6

Conflicts:

arch/sparc/kernel/of_device.c

+81 -42
+6 -2
arch/sparc/Makefile
··· 52 52 export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y kallsyms.o 53 53 54 54 # Default target 55 - all: image 55 + all: zImage 56 56 57 57 boot := arch/sparc/boot 58 58 59 - image tftpboot.img: vmlinux 59 + image zImage tftpboot.img: vmlinux 60 60 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 61 61 62 62 archclean: 63 63 $(Q)$(MAKE) $(clean)=$(boot) 64 + 65 + # This is the image used for packaging 66 + KBUILD_IMAGE := $(boot)/zImage 64 67 65 68 CLEAN_FILES += arch/$(ARCH)/boot/System.map 66 69 67 70 # Don't use tabs in echo arguments. 68 71 define archhelp 69 72 echo '* image - kernel image ($(boot)/image)' 73 + echo '* zImage - stripped kernel image ($(boot)/zImage)' 70 74 echo ' tftpboot.img - image prepared for tftp' 71 75 endef
+6
arch/sparc/boot/Makefile
··· 19 19 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap 20 20 quiet_cmd_image = LD $@ 21 21 cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@ 22 + quiet_cmd_strip = STRIP $@ 23 + cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $(obj)/image -o $@ 24 + 22 25 23 26 define rule_image 24 27 $(if $($(quiet)cmd_image), \ ··· 51 48 # these files being recompiled for each build. 52 49 $(obj)/image: $(obj)/btfix.o FORCE 53 50 $(call if_changed_rule,image) 51 + 52 + $(obj)/zImage: $(obj)/image 53 + $(call if_changed,strip) 54 54 55 55 $(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE 56 56 $(call if_changed,elftoaout)
+15 -10
arch/sparc/include/asm/smp_32.h
··· 50 50 void smp_bogo(struct seq_file *); 51 51 void smp_info(struct seq_file *); 52 52 53 - BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) 53 + BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, cpumask_t, unsigned long, unsigned long, unsigned long, unsigned long) 54 54 BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) 55 55 BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) 56 56 BTFIXUPDEF_BLACKBOX(load_current) 57 57 58 - #define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) 58 + #define smp_cross_call(func,mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4) 59 59 60 - static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } 60 + static inline void xc0(smpfunc_t func) { smp_cross_call(func, cpu_online_map, 0, 0, 0, 0); } 61 61 static inline void xc1(smpfunc_t func, unsigned long arg1) 62 - { smp_cross_call(func, arg1, 0, 0, 0, 0); } 62 + { smp_cross_call(func, cpu_online_map, arg1, 0, 0, 0); } 63 63 static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2) 64 - { smp_cross_call(func, arg1, arg2, 0, 0, 0); } 64 + { smp_cross_call(func, cpu_online_map, arg1, arg2, 0, 0); } 65 65 static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2, 66 66 unsigned long arg3) 67 - { smp_cross_call(func, arg1, arg2, arg3, 0, 0); } 67 + { smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, 0); } 68 68 static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2, 69 69 unsigned long arg3, unsigned long arg4) 70 - { smp_cross_call(func, arg1, arg2, arg3, arg4, 0); } 71 - static inline void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg2, 72 - unsigned long arg3, unsigned long arg4, unsigned long arg5) 73 - { smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); } 70 + { smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, arg4); } 74 71 75 72 static inline int smp_call_function(void (*func)(void *info), void *info, int wait) 76 73 { 77 74 xc1((smpfunc_t)func, (unsigned long)info); 75 + return 0; 76 + } 77 + 78 + static inline int smp_call_function_single(int cpuid, void (*func) (void *info), 79 + void *info, int wait) 80 + { 81 + smp_cross_call((smpfunc_t)func, cpumask_of_cpu(cpuid), 82 + (unsigned long) info, 0, 0, 0); 78 83 return 0; 79 84 } 80 85
+14 -5
arch/sparc/kernel/of_device.c
··· 93 93 int *addrc, int *sizec); 94 94 int (*map)(u32 *addr, const u32 *range, 95 95 int na, int ns, int pna); 96 - unsigned int (*get_flags)(const u32 *addr); 96 + unsigned long (*get_flags)(const u32 *addr, unsigned long); 97 97 }; 98 98 99 99 /* ··· 153 153 return 0; 154 154 } 155 155 156 - static unsigned int of_bus_default_get_flags(const u32 *addr) 156 + static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags) 157 157 { 158 + if (flags) 159 + return flags; 158 160 return IORESOURCE_MEM; 159 161 } 160 162 ··· 219 217 return 0; 220 218 } 221 219 222 - static unsigned int of_bus_pci_get_flags(const u32 *addr) 220 + static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) 223 221 { 224 - unsigned int flags = 0; 225 222 u32 w = addr[0]; 226 223 224 + /* For PCI, we override whatever child busses may have used. */ 225 + flags = 0; 227 226 switch((w >> 24) & 0x03) { 228 227 case 0x01: 229 228 flags |= IORESOURCE_IO; 229 + break; 230 + 230 231 case 0x02: /* 32 bits */ 231 232 case 0x03: /* 64 bits */ 232 233 flags |= IORESOURCE_MEM; 234 + break; 233 235 } 234 236 if (w & 0x40000000) 235 237 flags |= IORESOURCE_PREFETCH; ··· 412 406 int pna, pns; 413 407 414 408 size = of_read_addr(reg + na, ns); 415 - flags = bus->get_flags(reg); 416 409 417 410 memcpy(addr, reg, na * 4); 411 + 412 + flags = bus->get_flags(reg, 0); 418 413 419 414 if (use_1to1_mapping(pp)) { 420 415 result = of_read_addr(addr, na); ··· 440 433 if (build_one_resource(dp, dbus, pbus, addr, 441 434 dna, dns, pna)) 442 435 break; 436 + 437 + flags = pbus->get_flags(addr, flags); 443 438 444 439 dna = pna; 445 440 dns = pns;
+10 -6
arch/sparc/kernel/sun4d_smp.c
··· 261 261 static DEFINE_SPINLOCK(cross_call_lock); 262 262 263 263 /* Cross calls must be serialized, at least currently. */ 264 - void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, 265 - unsigned long arg3, unsigned long arg4, unsigned long arg5) 264 + static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, 265 + unsigned long arg2, unsigned long arg3, 266 + unsigned long arg4) 266 267 { 267 268 if(smp_processors_ready) { 268 269 register int high = smp_highest_cpu; ··· 278 277 register unsigned long a2 asm("i2") = arg2; 279 278 register unsigned long a3 asm("i3") = arg3; 280 279 register unsigned long a4 asm("i4") = arg4; 281 - register unsigned long a5 asm("i5") = arg5; 280 + register unsigned long a5 asm("i5") = 0; 282 281 283 282 __asm__ __volatile__( 284 283 "std %0, [%6]\n\t" ··· 290 289 291 290 /* Init receive/complete mapping, plus fire the IPI's off. */ 292 291 { 293 - cpumask_t mask; 294 292 register int i; 295 293 296 - mask = cpumask_of_cpu(hard_smp4d_processor_id()); 297 - cpus_andnot(mask, cpu_online_map, mask); 294 + cpu_clear(smp_processor_id(), mask); 295 + cpus_and(mask, cpu_online_map, mask); 298 296 for(i = 0; i <= high; i++) { 299 297 if (cpu_isset(i, mask)) { 300 298 ccall_info.processors_in[i] = 0; ··· 308 308 309 309 i = 0; 310 310 do { 311 + if (!cpu_isset(i, mask)) 312 + continue; 311 313 while(!ccall_info.processors_in[i]) 312 314 barrier(); 313 315 } while(++i <= high); 314 316 315 317 i = 0; 316 318 do { 319 + if (!cpu_isset(i, mask)) 320 + continue; 317 321 while(!ccall_info.processors_out[i]) 318 322 barrier(); 319 323 } while(++i <= high);
+8 -4
arch/sparc/kernel/sun4m_smp.c
··· 244 244 static DEFINE_SPINLOCK(cross_call_lock); 245 245 246 246 /* Cross calls must be serialized, at least currently. */ 247 - static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, 247 + static void smp4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, 248 248 unsigned long arg2, unsigned long arg3, 249 - unsigned long arg4, unsigned long arg5) 249 + unsigned long arg4) 250 250 { 251 251 register int ncpus = SUN4M_NCPUS; 252 252 unsigned long flags; ··· 259 259 ccall_info.arg2 = arg2; 260 260 ccall_info.arg3 = arg3; 261 261 ccall_info.arg4 = arg4; 262 - ccall_info.arg5 = arg5; 262 + ccall_info.arg5 = 0; 263 263 264 264 /* Init receive/complete mapping, plus fire the IPI's off. */ 265 265 { 266 - cpumask_t mask = cpu_online_map; 267 266 register int i; 268 267 269 268 cpu_clear(smp_processor_id(), mask); 269 + cpus_and(mask, cpu_online_map, mask); 270 270 for(i = 0; i < ncpus; i++) { 271 271 if (cpu_isset(i, mask)) { 272 272 ccall_info.processors_in[i] = 0; ··· 284 284 285 285 i = 0; 286 286 do { 287 + if (!cpu_isset(i, mask)) 288 + continue; 287 289 while(!ccall_info.processors_in[i]) 288 290 barrier(); 289 291 } while(++i < ncpus); 290 292 291 293 i = 0; 292 294 do { 295 + if (!cpu_isset(i, mask)) 296 + continue; 293 297 while(!ccall_info.processors_out[i]) 294 298 barrier(); 295 299 } while(++i < ncpus);
+1
arch/sparc64/Kconfig
··· 254 254 255 255 config NUMA 256 256 bool "NUMA support" 257 + depends on SMP 257 258 258 259 config NODES_SHIFT 259 260 int
+14 -6
arch/sparc64/kernel/of_device.c
··· 119 119 int *addrc, int *sizec); 120 120 int (*map)(u32 *addr, const u32 *range, 121 121 int na, int ns, int pna); 122 - unsigned int (*get_flags)(const u32 *addr); 122 + unsigned long (*get_flags)(const u32 *addr, unsigned long); 123 123 }; 124 124 125 125 /* ··· 179 179 return 0; 180 180 } 181 181 182 - static unsigned int of_bus_default_get_flags(const u32 *addr) 182 + static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags) 183 183 { 184 + if (flags) 185 + return flags; 184 186 return IORESOURCE_MEM; 185 187 } 186 188 ··· 274 272 return 0; 275 273 } 276 274 277 - static unsigned int of_bus_pci_get_flags(const u32 *addr) 275 + static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) 278 276 { 279 - unsigned int flags = 0; 280 277 u32 w = addr[0]; 281 278 279 + /* For PCI, we override whatever child busses may have used. */ 280 + flags = 0; 282 281 switch((w >> 24) & 0x03) { 283 282 case 0x01: 284 283 flags |= IORESOURCE_IO; 284 + break; 285 + 285 286 case 0x02: /* 32 bits */ 286 287 case 0x03: /* 64 bits */ 287 288 flags |= IORESOURCE_MEM; 289 + break; 288 290 } 289 291 if (w & 0x40000000) 290 292 flags |= IORESOURCE_PREFETCH; ··· 516 510 int pna, pns; 517 511 518 512 size = of_read_addr(reg + na, ns); 519 - flags = bus->get_flags(reg); 520 - 521 513 memcpy(addr, reg, na * 4); 514 + 515 + flags = bus->get_flags(addr, 0); 522 516 523 517 if (use_1to1_mapping(pp)) { 524 518 result = of_read_addr(addr, na); ··· 543 537 if (build_one_resource(dp, dbus, pbus, addr, 544 538 dna, dns, pna)) 545 539 break; 540 + 541 + flags = pbus->get_flags(addr, flags); 546 542 547 543 dna = pna; 548 544 dns = pns;
+6 -8
arch/sparc64/kernel/smp.c
··· 80 80 i, cpu_data(i).clock_tick); 81 81 } 82 82 83 - static __cacheline_aligned_in_smp DEFINE_SPINLOCK(call_lock); 84 - 85 83 extern void setup_sparc64_timer(void); 86 84 87 85 static volatile unsigned long callin_flag = 0; ··· 118 120 while (!cpu_isset(cpuid, smp_commenced_mask)) 119 121 rmb(); 120 122 121 - spin_lock(&call_lock); 123 + ipi_call_lock(); 122 124 cpu_set(cpuid, cpu_online_map); 123 - spin_unlock(&call_lock); 125 + ipi_call_unlock(); 124 126 125 127 /* idle thread is expected to have preempt disabled */ 126 128 preempt_disable(); ··· 1303 1305 c->core_id = 0; 1304 1306 c->proc_id = -1; 1305 1307 1306 - spin_lock(&call_lock); 1307 - cpu_clear(cpu, cpu_online_map); 1308 - spin_unlock(&call_lock); 1309 - 1310 1308 smp_wmb(); 1311 1309 1312 1310 /* Make sure no interrupts point to this cpu. */ ··· 1311 1317 local_irq_enable(); 1312 1318 mdelay(1); 1313 1319 local_irq_disable(); 1320 + 1321 + ipi_call_lock(); 1322 + cpu_clear(cpu, cpu_online_map); 1323 + ipi_call_unlock(); 1314 1324 1315 1325 return 0; 1316 1326 }
+1 -1
arch/sparc64/mm/init.c
··· 1875 1875 * memory list again, and make sure it provides at least as much 1876 1876 * memory as 'pavail' does. 1877 1877 */ 1878 - static void setup_valid_addr_bitmap_from_pavail(void) 1878 + static void __init setup_valid_addr_bitmap_from_pavail(void) 1879 1879 { 1880 1880 int i; 1881 1881