Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] Clean up duplicate includes in drivers/macintosh/
[POWERPC] Quiet section mismatch warning on pcibios_setup
[POWERPC] init and exit markings for hvc_iseries
[POWERPC] Quiet section mismatch in hvc_rtas.c
[POWERPC] Constify of_platform_driver match_table
[POWERPC] hvcs: Make some things static and const
[POWERPC] Constify of_platform_driver name
[POWERPC] MPIC protected sources
[POWERPC] of_detach_node()'s device node argument cannot be const
[POWERPC] Fix ARCH=ppc builds
[POWERPC] mv64x60: Use mutex instead of semaphore
[POWERPC] Allow smp_call_function_single() to current cpu
[POWERPC] Allow exec faults on readable areas on classic 32-bit PowerPC
[POWERPC] Fix future firmware feature fixups function failure
[POWERPC] fix showing xmon help
[POWERPC] Make xmon_write accept a const buffer
[POWERPC] Fix misspelled "CONFIG_CHECK_CACHE_COHERENCY" Kconfig option.
[POWERPC] cell: CONFIG_SPE_BASE is a typo

+101 -56
+1 -1
arch/powerpc/configs/prpmc2800_defconfig
··· 48 48 # CONFIG_PPC_MM_SLICES is not set 49 49 # CONFIG_SMP is not set 50 50 CONFIG_NOT_COHERENT_CACHE=y 51 - CONFIG_CONFIG_CHECK_CACHE_COHERENCY=y 51 + CONFIG_CHECK_CACHE_COHERENCY=y 52 52 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 53 53 54 54 #
+1 -1
arch/powerpc/kernel/pci-common.c
··· 166 166 167 167 } 168 168 169 - char __init *pcibios_setup(char *str) 169 + char __devinit *pcibios_setup(char *str) 170 170 { 171 171 return str; 172 172 }
+1 -1
arch/powerpc/kernel/prom.c
··· 1218 1218 * a reference to the node. The memory associated with the node 1219 1219 * is not freed until its refcount goes to zero. 1220 1220 */ 1221 - void of_detach_node(const struct device_node *np) 1221 + void of_detach_node(struct device_node *np) 1222 1222 { 1223 1223 struct device_node *parent; 1224 1224
+6 -1
arch/powerpc/kernel/smp.c
··· 284 284 int wait) 285 285 { 286 286 cpumask_t map = CPU_MASK_NONE; 287 - int ret = -EBUSY; 287 + int ret = 0; 288 288 289 289 if (!cpu_online(cpu)) 290 290 return -EINVAL; ··· 292 292 cpu_set(cpu, map); 293 293 if (cpu != get_cpu()) 294 294 ret = smp_call_function_map(func,info,nonatomic,wait,map); 295 + else { 296 + local_irq_disable(); 297 + func(info); 298 + local_irq_enable(); 299 + } 295 300 put_cpu(); 296 301 return ret; 297 302 }
+7 -1
arch/powerpc/mm/fault.c
··· 283 283 /* protection fault */ 284 284 if (error_code & DSISR_PROTFAULT) 285 285 goto bad_area; 286 - if (!(vma->vm_flags & VM_EXEC)) 286 + /* 287 + * Allow execution from readable areas if the MMU does not 288 + * provide separate controls over reading and executing. 289 + */ 290 + if (!(vma->vm_flags & VM_EXEC) && 291 + (cpu_has_feature(CPU_FTR_NOEXECUTE) || 292 + !(vma->vm_flags & (VM_READ | VM_WRITE)))) 287 293 goto bad_area; 288 294 #else 289 295 pte_t *ptep;
+2 -2
arch/powerpc/mm/hash_utils_64.c
··· 609 609 mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp; 610 610 #endif /* CONFIG_PPC_MM_SLICES */ 611 611 612 - #ifdef CONFIG_SPE_BASE 612 + #ifdef CONFIG_SPU_BASE 613 613 spu_flush_all_slbs(mm); 614 614 #endif 615 615 } ··· 744 744 "to 4kB pages because of " 745 745 "non-cacheable mapping\n"); 746 746 psize = mmu_vmalloc_psize = MMU_PAGE_4K; 747 - #ifdef CONFIG_SPE_BASE 747 + #ifdef CONFIG_SPU_BASE 748 748 spu_flush_all_slbs(mm); 749 749 #endif 750 750 }
+1 -1
arch/powerpc/platforms/Kconfig.cputype
··· 215 215 depends on 4xx || 8xx || E200 216 216 default y 217 217 218 - config CONFIG_CHECK_CACHE_COHERENCY 218 + config CHECK_CACHE_COHERENCY 219 219 bool 220 220 221 221 endmenu
+1 -1
arch/powerpc/platforms/embedded6xx/Kconfig
··· 59 59 config MV64X60 60 60 bool 61 61 select PPC_INDIRECT_PCI 62 - select CONFIG_CHECK_CACHE_COHERENCY 62 + select CHECK_CACHE_COHERENCY 63 63 64 64 config MPC10X_OPENPIC 65 65 bool
+3 -16
arch/powerpc/platforms/pseries/firmware.c
··· 66 66 * device-tree/ibm,hypertas-functions. Ultimately this functionality may 67 67 * be moved into prom.c prom_init(). 68 68 */ 69 - void __init fw_feature_init(void) 69 + void __init fw_feature_init(const char *hypertas, unsigned long len) 70 70 { 71 - struct device_node *dn; 72 - const char *hypertas, *s; 73 - int len, i; 71 + const char *s; 72 + int i; 74 73 75 74 DBG(" -> fw_feature_init()\n"); 76 - 77 - dn = of_find_node_by_path("/rtas"); 78 - if (dn == NULL) { 79 - printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); 80 - goto out; 81 - } 82 - 83 - hypertas = of_get_property(dn, "ibm,hypertas-functions", &len); 84 - if (hypertas == NULL) 85 - goto out; 86 75 87 76 for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { 88 77 for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { ··· 87 98 } 88 99 } 89 100 90 - out: 91 - of_node_put(dn); 92 101 DBG(" <- fw_feature_init()\n"); 93 102 }
+1 -1
arch/powerpc/platforms/pseries/pseries.h
··· 10 10 #ifndef _PSERIES_PSERIES_H 11 11 #define _PSERIES_PSERIES_H 12 12 13 - extern void __init fw_feature_init(void); 13 + extern void __init fw_feature_init(const char *hypertas, unsigned long len); 14 14 15 15 struct pt_regs; 16 16
+11 -6
arch/powerpc/platforms/pseries/setup.c
··· 320 320 { 321 321 DBG(" -> pSeries_init_early()\n"); 322 322 323 - fw_feature_init(); 324 - 325 323 if (firmware_has_feature(FW_FEATURE_LPAR)) 326 324 find_udbg_vterm(); 327 325 ··· 341 343 const char *uname, int depth, 342 344 void *data) 343 345 { 346 + const char *hypertas; 347 + unsigned long len; 348 + 344 349 if (depth != 1 || 345 350 (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0)) 346 - return 0; 351 + return 0; 347 352 348 - if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL) 349 - powerpc_firmware_features |= FW_FEATURE_LPAR; 353 + hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len); 354 + if (!hypertas) 355 + return 1; 350 356 351 - return 1; 357 + powerpc_firmware_features |= FW_FEATURE_LPAR; 358 + fw_feature_init(hypertas, len); 359 + 360 + return 1; 352 361 } 353 362 354 363 static int __init pSeries_probe(void)
+32
arch/powerpc/sysdev/mpic.c
··· 877 877 878 878 if (hw == mpic->spurious_vec) 879 879 return -EINVAL; 880 + if (mpic->protected && test_bit(hw, mpic->protected)) 881 + return -EINVAL; 880 882 881 883 #ifdef CONFIG_SMP 882 884 else if (hw >= mpic->ipi_vecs[0]) { ··· 1036 1034 if (node && of_get_property(node, "big-endian", NULL) != NULL) 1037 1035 mpic->flags |= MPIC_BIG_ENDIAN; 1038 1036 1037 + /* Look for protected sources */ 1038 + if (node) { 1039 + unsigned int psize, bits, mapsize; 1040 + const u32 *psrc = 1041 + of_get_property(node, "protected-sources", &psize); 1042 + if (psrc) { 1043 + psize /= 4; 1044 + bits = intvec_top + 1; 1045 + mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long); 1046 + mpic->protected = alloc_bootmem(mapsize); 1047 + BUG_ON(mpic->protected == NULL); 1048 + memset(mpic->protected, 0, mapsize); 1049 + for (i = 0; i < psize; i++) { 1050 + if (psrc[i] > intvec_top) 1051 + continue; 1052 + __set_bit(psrc[i], mpic->protected); 1053 + } 1054 + } 1055 + } 1039 1056 1040 1057 #ifdef CONFIG_MPIC_WEIRD 1041 1058 mpic->hw_set = mpic_infos[MPIC_GET_REGSET(flags)]; ··· 1234 1213 u32 vecpri = MPIC_VECPRI_MASK | i | 1235 1214 (8 << MPIC_VECPRI_PRIORITY_SHIFT); 1236 1215 1216 + /* check if protected */ 1217 + if (mpic->protected && test_bit(i, mpic->protected)) 1218 + continue; 1237 1219 /* init hw */ 1238 1220 mpic_irq_write(i, MPIC_INFO(IRQ_VECTOR_PRI), vecpri); 1239 1221 mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), ··· 1431 1407 mpic_eoi(mpic); 1432 1408 return NO_IRQ; 1433 1409 } 1410 + if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { 1411 + if (printk_ratelimit()) 1412 + printk(KERN_WARNING "%s: Got protected source %d !\n", 1413 + mpic->name, (int)src); 1414 + mpic_eoi(mpic); 1415 + return NO_IRQ; 1416 + } 1417 + 1434 1418 return irq_linear_revmap(mpic->irqhost, src); 1435 1419 } 1436 1420
+5
arch/powerpc/xmon/nonstdio.c
··· 132 132 va_end(args); 133 133 xmon_write(xmon_outbuf, n); 134 134 } 135 + 136 + void xmon_puts(const char *str) 137 + { 138 + xmon_write(str, strlen(str)); 139 + }
+2 -1
arch/powerpc/xmon/nonstdio.h
··· 5 5 6 6 extern int xmon_putchar(int c); 7 7 extern int xmon_getchar(void); 8 + extern void xmon_puts(const char *); 8 9 extern char *xmon_gets(char *, int); 9 10 extern void xmon_printf(const char *, ...); 10 11 extern void xmon_map_scc(void); 11 12 extern int xmon_expect(const char *str, unsigned long timeout); 12 - extern int xmon_write(void *ptr, int nb); 13 + extern int xmon_write(const void *ptr, int nb); 13 14 extern int xmon_readchar(void); 14 15 extern int xmon_read_poll(void);
+1 -1
arch/powerpc/xmon/start.c
··· 14 14 { 15 15 } 16 16 17 - int xmon_write(void *ptr, int nb) 17 + int xmon_write(const void *ptr, int nb) 18 18 { 19 19 return udbg_write(ptr, nb); 20 20 }
+1 -1
arch/powerpc/xmon/xmon.c
··· 833 833 mdelay(2000); 834 834 return cmd; 835 835 case '?': 836 - printf(help_string); 836 + xmon_puts(help_string); 837 837 break; 838 838 case 'b': 839 839 bpt_cmds();
+8 -7
arch/ppc/syslib/mv64x60.c
··· 14 14 #include <linux/pci.h> 15 15 #include <linux/slab.h> 16 16 #include <linux/module.h> 17 + #include <linux/mutex.h> 17 18 #include <linux/string.h> 18 19 #include <linux/spinlock.h> 19 20 #include <linux/mv643xx.h> ··· 2360 2359 /* Export the hotswap register via sysfs for enum event monitoring */ 2361 2360 #define VAL_LEN_MAX 11 /* 32-bit hex or dec stringified number + '\n' */ 2362 2361 2363 - DECLARE_MUTEX(mv64xxx_hs_lock); 2362 + static DEFINE_MUTEX(mv64xxx_hs_lock); 2364 2363 2365 2364 static ssize_t 2366 2365 mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count) ··· 2373 2372 if (count < VAL_LEN_MAX) 2374 2373 return -EINVAL; 2375 2374 2376 - if (down_interruptible(&mv64xxx_hs_lock)) 2375 + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) 2377 2376 return -ERESTARTSYS; 2378 2377 save_exclude = mv64x60_pci_exclude_bridge; 2379 2378 mv64x60_pci_exclude_bridge = 0; 2380 2379 early_read_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0), 2381 2380 MV64360_PCICFG_CPCI_HOTSWAP, &v); 2382 2381 mv64x60_pci_exclude_bridge = save_exclude; 2383 - up(&mv64xxx_hs_lock); 2382 + mutex_unlock(&mv64xxx_hs_lock); 2384 2383 2385 2384 return sprintf(buf, "0x%08x\n", v); 2386 2385 } ··· 2397 2396 return -EINVAL; 2398 2397 2399 2398 if (sscanf(buf, "%i", &v) == 1) { 2400 - if (down_interruptible(&mv64xxx_hs_lock)) 2399 + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) 2401 2400 return -ERESTARTSYS; 2402 2401 save_exclude = mv64x60_pci_exclude_bridge; 2403 2402 mv64x60_pci_exclude_bridge = 0; 2404 2403 early_write_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0), 2405 2404 MV64360_PCICFG_CPCI_HOTSWAP, v); 2406 2405 mv64x60_pci_exclude_bridge = save_exclude; 2407 - up(&mv64xxx_hs_lock); 2406 + mutex_unlock(&mv64xxx_hs_lock); 2408 2407 } 2409 2408 else 2410 2409 count = -EINVAL; ··· 2434 2433 pdev = container_of(dev, struct platform_device, dev); 2435 2434 pdp = (struct mv64xxx_pdata *)pdev->dev.platform_data; 2436 2435 2437 - if (down_interruptible(&mv64xxx_hs_lock)) 2436 + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) 2438 2437 return -ERESTARTSYS; 2439 2438 v = pdp->hs_reg_valid; 2440 - up(&mv64xxx_hs_lock); 2439 + mutex_unlock(&mv64xxx_hs_lock); 2441 2440 2442 2441 return sprintf(buf, "%i\n", v); 2443 2442 }
+4 -4
drivers/char/hvc_iseries.c
··· 472 472 } 473 473 } 474 474 475 - static int send_open(HvLpIndex remoteLp, void *sem) 475 + static int __init send_open(HvLpIndex remoteLp, void *sem) 476 476 { 477 477 return HvCallEvent_signalLpEventFast(remoteLp, 478 478 HvLpEvent_Type_VirtualIo, ··· 484 484 0, 0, 0, 0); 485 485 } 486 486 487 - static int hvc_vio_init(void) 487 + static int __init hvc_vio_init(void) 488 488 { 489 489 atomic_t wait_flag; 490 490 int rc; ··· 552 552 } 553 553 module_init(hvc_vio_init); /* after drivers/char/hvc_console.c */ 554 554 555 - static void hvc_vio_exit(void) 555 + static void __exit hvc_vio_exit(void) 556 556 { 557 557 vio_unregister_driver(&hvc_vio_driver); 558 558 } 559 559 module_exit(hvc_vio_exit); 560 560 561 561 /* the device tree order defines our numbering */ 562 - static int hvc_find_vtys(void) 562 + static int __init hvc_find_vtys(void) 563 563 { 564 564 struct device_node *vty; 565 565 int num_found = 0;
+1 -1
drivers/char/hvc_rtas.c
··· 115 115 module_exit(hvc_rtas_exit); 116 116 117 117 /* This will happen prior to module init. There is no tty at this time? */ 118 - static int hvc_rtas_console_init(void) 118 + static int __init hvc_rtas_console_init(void) 119 119 { 120 120 rtascons_put_char_token = rtas_token("put-term-char"); 121 121 if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE)
+4 -4
drivers/char/hvcs.c
··· 210 210 static int hvcs_parm_num_devs = -1; 211 211 module_param(hvcs_parm_num_devs, int, 0); 212 212 213 - char hvcs_driver_name[] = "hvcs"; 214 - char hvcs_device_node[] = "hvcs"; 215 - char hvcs_driver_string[] 213 + static const char hvcs_driver_name[] = "hvcs"; 214 + static const char hvcs_device_node[] = "hvcs"; 215 + static const char hvcs_driver_string[] 216 216 = "IBM hvcs (Hypervisor Virtual Console Server) Driver"; 217 217 218 218 /* Status of partner info rescan triggered via sysfs. */ ··· 1092 1092 * NOTICE: Do NOT hold either the hvcs_struct.lock or hvcs_structs_lock when 1093 1093 * calling this function or you will get deadlock. 1094 1094 */ 1095 - struct hvcs_struct *hvcs_get_by_index(int index) 1095 + static struct hvcs_struct *hvcs_get_by_index(int index) 1096 1096 { 1097 1097 struct hvcs_struct *hvcsd = NULL; 1098 1098 unsigned long flags;
-1
drivers/macintosh/rack-meter.c
··· 30 30 #include <asm/machdep.h> 31 31 #include <asm/pmac_feature.h> 32 32 #include <asm/dbdma.h> 33 - #include <asm/dbdma.h> 34 33 #include <asm/macio.h> 35 34 #include <asm/keylargo.h> 36 35
+1 -1
drivers/pcmcia/m8xx_pcmcia.c
··· 1316 1316 MODULE_DEVICE_TABLE(of, m8xx_pcmcia_match); 1317 1317 1318 1318 static struct of_platform_driver m8xx_pcmcia_driver = { 1319 - .name = (char *)driver_name, 1319 + .name = driver_name, 1320 1320 .match_table = m8xx_pcmcia_match, 1321 1321 .probe = m8xx_probe, 1322 1322 .remove = m8xx_remove,
+3
include/asm-powerpc/mpic.h
··· 296 296 unsigned int dcr_base; 297 297 #endif 298 298 299 + /* Protected sources */ 300 + unsigned long *protected; 301 + 299 302 #ifdef CONFIG_MPIC_WEIRD 300 303 /* Pointer to HW info array */ 301 304 u32 *hw_set;
+1 -1
include/asm-powerpc/prom.h
··· 139 139 140 140 /* For updating the device tree at runtime */ 141 141 extern void of_attach_node(struct device_node *); 142 - extern void of_detach_node(const struct device_node *); 142 + extern void of_detach_node(struct device_node *); 143 143 144 144 /* Other Prototypes */ 145 145 extern void finish_device_tree(void);
+1
include/asm-ppc/system.h
··· 54 54 extern void flush_instruction_cache(void); 55 55 extern void hard_reset_now(void); 56 56 extern void poweroff_now(void); 57 + extern int set_dabr(unsigned long dabr); 57 58 #ifdef CONFIG_6xx 58 59 extern long _get_L2CR(void); 59 60 extern long _get_L3CR(void);
+2 -2
include/linux/of_platform.h
··· 31 31 */ 32 32 struct of_platform_driver 33 33 { 34 - char *name; 35 - struct of_device_id *match_table; 34 + const char *name; 35 + const struct of_device_id *match_table; 36 36 struct module *owner; 37 37 38 38 int (*probe)(struct of_device* dev,