From 1e57ba8dddcbb384b293f948cba190c5199cf945 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 17 Jul 2007 02:35:38 +1000 Subject: [POWERPC] cell: CONFIG_SPE_BASE is a typo The config symbol for SPE support is called CONFIG_SPU_BASE, not CONFIG_SPE_BASE. Signed-off-by: Geert Uytterhoeven Acked-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/powerpc/mm/hash_utils_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 2ce9491b48d..bc7b0cedae5 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c @@ -609,7 +609,7 @@ static void demote_segment_4k(struct mm_struct *mm, unsigned long addr) mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp; #endif /* CONFIG_PPC_MM_SLICES */ -#ifdef CONFIG_SPE_BASE +#ifdef CONFIG_SPU_BASE spu_flush_all_slbs(mm); #endif } @@ -744,7 +744,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) "to 4kB pages because of " "non-cacheable mapping\n"); psize = mmu_vmalloc_psize = MMU_PAGE_4K; -#ifdef CONFIG_SPE_BASE +#ifdef CONFIG_SPU_BASE spu_flush_all_slbs(mm); #endif } -- cgit v1.2.3 From f8eb77d6fbdf13b94bcea48023d4e1dce4b3bffe Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Wed, 18 Jul 2007 08:21:29 +1000 Subject: [POWERPC] Fix misspelled "CONFIG_CHECK_CACHE_COHERENCY" Kconfig option. Signed-off-by: Robert P. J. Day Signed-off-by: Paul Mackerras --- arch/powerpc/configs/prpmc2800_defconfig | 2 +- arch/powerpc/platforms/Kconfig.cputype | 2 +- arch/powerpc/platforms/embedded6xx/Kconfig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/configs/prpmc2800_defconfig b/arch/powerpc/configs/prpmc2800_defconfig index fb504a71462..858f865f2d5 100644 --- a/arch/powerpc/configs/prpmc2800_defconfig +++ b/arch/powerpc/configs/prpmc2800_defconfig @@ -48,7 +48,7 @@ CONFIG_PPC_STD_MMU_32=y # CONFIG_PPC_MM_SLICES is not set # CONFIG_SMP is not set CONFIG_NOT_COHERENT_CACHE=y -CONFIG_CONFIG_CHECK_CACHE_COHERENCY=y +CONFIG_CHECK_CACHE_COHERENCY=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index b8b5fde9466..e4b2aee53a7 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype @@ -215,7 +215,7 @@ config NOT_COHERENT_CACHE depends on 4xx || 8xx || E200 default y -config CONFIG_CHECK_CACHE_COHERENCY +config CHECK_CACHE_COHERENCY bool endmenu diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig index bec772674e4..2d12f77e46b 100644 --- a/arch/powerpc/platforms/embedded6xx/Kconfig +++ b/arch/powerpc/platforms/embedded6xx/Kconfig @@ -59,7 +59,7 @@ config MPC10X_BRIDGE config MV64X60 bool select PPC_INDIRECT_PCI - select CONFIG_CHECK_CACHE_COHERENCY + select CHECK_CACHE_COHERENCY config MPC10X_OPENPIC bool -- cgit v1.2.3 From 776568d4c93fe8def5ab4060344af554fe2b44be Mon Sep 17 00:00:00 2001 From: Ishizaki Kou Date: Wed, 18 Jul 2007 19:30:29 +1000 Subject: [POWERPC] Make xmon_write accept a const buffer Because xmon_write doesn't change the buffer, we should add 'const' qualifier to the argument which points it. Signed-off-by: Kou Ishizaki Signed-off-by: Paul Mackerras --- arch/powerpc/xmon/nonstdio.h | 2 +- arch/powerpc/xmon/start.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h index 47cebbd2b1b..22ec1bb8b72 100644 --- a/arch/powerpc/xmon/nonstdio.h +++ b/arch/powerpc/xmon/nonstdio.h @@ -9,6 +9,6 @@ extern char *xmon_gets(char *, int); extern void xmon_printf(const char *, ...); extern void xmon_map_scc(void); extern int xmon_expect(const char *str, unsigned long timeout); -extern int xmon_write(void *ptr, int nb); +extern int xmon_write(const void *ptr, int nb); extern int xmon_readchar(void); extern int xmon_read_poll(void); diff --git a/arch/powerpc/xmon/start.c b/arch/powerpc/xmon/start.c index 712552c4f24..8864de2af38 100644 --- a/arch/powerpc/xmon/start.c +++ b/arch/powerpc/xmon/start.c @@ -14,7 +14,7 @@ void xmon_map_scc(void) { } -int xmon_write(void *ptr, int nb) +int xmon_write(const void *ptr, int nb) { return udbg_write(ptr, nb); } -- cgit v1.2.3 From 4d404edce30f911004850d472e05a31efd751662 Mon Sep 17 00:00:00 2001 From: Ishizaki Kou Date: Wed, 18 Jul 2007 19:26:40 +1000 Subject: [POWERPC] fix showing xmon help In some configuration, xmon help string is larger than xmon_printf buffer. We need not to use printf. This patch adds xmon_puts and change to use it to show help string. Signed-off-by: Kou Ishizaki Signed-off-by: Paul Mackerras --- arch/powerpc/xmon/nonstdio.c | 5 +++++ arch/powerpc/xmon/nonstdio.h | 1 + arch/powerpc/xmon/xmon.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c index 78765833f4c..bfac84fbe78 100644 --- a/arch/powerpc/xmon/nonstdio.c +++ b/arch/powerpc/xmon/nonstdio.c @@ -132,3 +132,8 @@ void xmon_printf(const char *format, ...) va_end(args); xmon_write(xmon_outbuf, n); } + +void xmon_puts(const char *str) +{ + xmon_write(str, strlen(str)); +} diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h index 22ec1bb8b72..23dd95f4599 100644 --- a/arch/powerpc/xmon/nonstdio.h +++ b/arch/powerpc/xmon/nonstdio.h @@ -5,6 +5,7 @@ extern int xmon_putchar(int c); extern int xmon_getchar(void); +extern void xmon_puts(const char *); extern char *xmon_gets(char *, int); extern void xmon_printf(const char *, ...); extern void xmon_map_scc(void); diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 669e6566ad7..121b04d165d 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -833,7 +833,7 @@ cmds(struct pt_regs *excp) mdelay(2000); return cmd; case '?': - printf(help_string); + xmon_puts(help_string); break; case 'b': bpt_cmds(); -- cgit v1.2.3 From ca8ffc974d43033be6e1d4277a45822d2c3656f4 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Thu, 19 Jul 2007 07:56:32 +1000 Subject: [POWERPC] Fix future firmware feature fixups function failure Move firmware feature initialisation from pSeries_init_early to the earlier pSeries_probe_hypertas so they are initialised before firmware feature fixups are applied. Currently firmware feature sections are only used for iSeries which initialises the these features much earlier. This is a bug in waiting on pSeries. Also adds some whitespace fixups. Signed-off-by: Michael Neuling Acked-by: Arnd Bergmann Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/firmware.c | 19 +++---------------- arch/powerpc/platforms/pseries/pseries.h | 2 +- arch/powerpc/platforms/pseries/setup.c | 17 +++++++++++------ 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index 29bf83bfb1f..8b18a1c4009 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c @@ -66,24 +66,13 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = { * device-tree/ibm,hypertas-functions. Ultimately this functionality may * be moved into prom.c prom_init(). */ -void __init fw_feature_init(void) +void __init fw_feature_init(const char *hypertas, unsigned long len) { - struct device_node *dn; - const char *hypertas, *s; - int len, i; + const char *s; + int i; DBG(" -> fw_feature_init()\n"); - dn = of_find_node_by_path("/rtas"); - if (dn == NULL) { - printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); - goto out; - } - - hypertas = of_get_property(dn, "ibm,hypertas-functions", &len); - if (hypertas == NULL) - goto out; - for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { /* check value against table of strings */ @@ -98,7 +87,5 @@ void __init fw_feature_init(void) } } -out: - of_node_put(dn); DBG(" <- fw_feature_init()\n"); } diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h index 61e19f78b92..61136d01955 100644 --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h @@ -10,7 +10,7 @@ #ifndef _PSERIES_PSERIES_H #define _PSERIES_PSERIES_H -extern void __init fw_feature_init(void); +extern void __init fw_feature_init(const char *hypertas, unsigned long len); struct pt_regs; diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 59e69f085cb..f0b7146a110 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -320,8 +320,6 @@ static void __init pSeries_init_early(void) { DBG(" -> pSeries_init_early()\n"); - fw_feature_init(); - if (firmware_has_feature(FW_FEATURE_LPAR)) find_udbg_vterm(); @@ -343,14 +341,21 @@ static int __init pSeries_probe_hypertas(unsigned long node, const char *uname, int depth, void *data) { + const char *hypertas; + unsigned long len; + if (depth != 1 || (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0)) - return 0; + return 0; + + hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len); + if (!hypertas) + return 1; - if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL) - powerpc_firmware_features |= FW_FEATURE_LPAR; + powerpc_firmware_features |= FW_FEATURE_LPAR; + fw_feature_init(hypertas, len); - return 1; + return 1; } static int __init pSeries_probe(void) -- cgit v1.2.3 From 08ae6cc15db201fa20cc4893d9500c1f6b20e560 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 19 Jul 2007 10:00:20 +1000 Subject: [POWERPC] Allow exec faults on readable areas on classic 32-bit PowerPC Classic 32-bit PowerPC CPUs, and the early 64-bit PowerPC CPUs, don't provide a way to prevent execution from readable pages, that is, the MMU doesn't distinguish between data reads and instruction reads, although a different exception is taken for faults in data accesses and instruction accesses. Commit 9ba4ace39fdfe22268daca9f28c5df384ae462cf, in the course of fixing another bug, added a check that meant that a page fault due to an instruction access would fail if the vma did not have the VM_EXEC flag set. This gives an inconsistent enforcement on these CPUs of the no-execute status of the vma (since reading from the page is sufficient to allow subsequent execution from it), and causes old versions of ppc32 glibc (2.2 and earlier) to fail, since they rely on executing the word before the GOT but don't have it marked executable. This fixes the problem by allowing execution from readable (or writable) areas on CPUs which do not provide separate control over data and instruction reads. Signed-off-by: Paul Mackerras Acked-by: Jon Loeliger --- arch/powerpc/mm/fault.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 3767211b3d0..ab3546c5ac3 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -283,7 +283,13 @@ good_area: /* protection fault */ if (error_code & DSISR_PROTFAULT) goto bad_area; - if (!(vma->vm_flags & VM_EXEC)) + /* + * Allow execution from readable areas if the MMU does not + * provide separate controls over reading and executing. + */ + if (!(vma->vm_flags & VM_EXEC) && + (cpu_has_feature(CPU_FTR_NOEXECUTE) || + !(vma->vm_flags & (VM_READ | VM_WRITE)))) goto bad_area; #else pte_t *ptep; -- cgit v1.2.3 From adff093d6c545c882f1503607f6af14ddd90bb89 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Fri, 20 Jul 2007 01:33:48 +1000 Subject: [POWERPC] Allow smp_call_function_single() to current cpu This removes the requirement for callers to get_cpu() to check in simple cases. i386 and x86_64 already received a similar treatment. Signed-off-by: Avi Kivity Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/smp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index d577b71db37..087c92f2a3e 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -284,7 +284,7 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int int wait) { cpumask_t map = CPU_MASK_NONE; - int ret = -EBUSY; + int ret = 0; if (!cpu_online(cpu)) return -EINVAL; @@ -292,6 +292,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int cpu_set(cpu, map); if (cpu != get_cpu()) ret = smp_call_function_map(func,info,nonatomic,wait,map); + else { + local_irq_disable(); + func(info); + local_irq_enable(); + } put_cpu(); return ret; } -- cgit v1.2.3 From 461e666723b6669bc6f7ef90b49b615396d70eb8 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 20 Jul 2007 07:50:49 +1000 Subject: [POWERPC] mv64x60: Use mutex instead of semaphore Signed-off-by: Christoph Hellwig Acked-by: Mark A. Greer Signed-off-by: Paul Mackerras --- arch/ppc/syslib/mv64x60.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c index 032f4b7f422..d212b1c418a 100644 --- a/arch/ppc/syslib/mv64x60.c +++ b/arch/ppc/syslib/mv64x60.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -2359,7 +2360,7 @@ mv64460_chip_specific_init(struct mv64x60_handle *bh, /* Export the hotswap register via sysfs for enum event monitoring */ #define VAL_LEN_MAX 11 /* 32-bit hex or dec stringified number + '\n' */ -DECLARE_MUTEX(mv64xxx_hs_lock); +static DEFINE_MUTEX(mv64xxx_hs_lock); static ssize_t mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -2372,14 +2373,14 @@ mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count) if (count < VAL_LEN_MAX) return -EINVAL; - if (down_interruptible(&mv64xxx_hs_lock)) + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) return -ERESTARTSYS; save_exclude = mv64x60_pci_exclude_bridge; mv64x60_pci_exclude_bridge = 0; early_read_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0), MV64360_PCICFG_CPCI_HOTSWAP, &v); mv64x60_pci_exclude_bridge = save_exclude; - up(&mv64xxx_hs_lock); + mutex_unlock(&mv64xxx_hs_lock); return sprintf(buf, "0x%08x\n", v); } @@ -2396,14 +2397,14 @@ mv64xxx_hs_reg_write(struct kobject *kobj, char *buf, loff_t off, size_t count) return -EINVAL; if (sscanf(buf, "%i", &v) == 1) { - if (down_interruptible(&mv64xxx_hs_lock)) + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) return -ERESTARTSYS; save_exclude = mv64x60_pci_exclude_bridge; mv64x60_pci_exclude_bridge = 0; early_write_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0), MV64360_PCICFG_CPCI_HOTSWAP, v); mv64x60_pci_exclude_bridge = save_exclude; - up(&mv64xxx_hs_lock); + mutex_unlock(&mv64xxx_hs_lock); } else count = -EINVAL; @@ -2433,10 +2434,10 @@ mv64xxx_hs_reg_valid_show(struct device *dev, struct device_attribute *attr, pdev = container_of(dev, struct platform_device, dev); pdp = (struct mv64xxx_pdata *)pdev->dev.platform_data; - if (down_interruptible(&mv64xxx_hs_lock)) + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) return -ERESTARTSYS; v = pdp->hs_reg_valid; - up(&mv64xxx_hs_lock); + mutex_unlock(&mv64xxx_hs_lock); return sprintf(buf, "%i\n", v); } -- cgit v1.2.3 From dd68c048d7a41b725ca3c2e23155598a5781dcbb Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Fri, 20 Jul 2007 13:11:10 +1000 Subject: [POWERPC] Fix ARCH=ppc builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The recent signal rework broke ARCH=ppc builds with the following error: CC arch/powerpc/kernel/signal.o arch/powerpc/kernel/signal.c: In function ‘do_signal’: arch/powerpc/kernel/signal.c:142: error: implicit declaration of function ‘set_dabr’ make[1]: *** [arch/powerpc/kernel/signal.o] Error 1 This fixes it by including a function prototype in asm-ppc/system.h. Acked-by: Kumar Gala Signed-off-by: Josh Boyer Signed-off-by: Paul Mackerras --- include/asm-ppc/system.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index f1311a8f310..cc45780421c 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -54,6 +54,7 @@ extern void show_regs(struct pt_regs * regs); extern void flush_instruction_cache(void); extern void hard_reset_now(void); extern void poweroff_now(void); +extern int set_dabr(unsigned long dabr); #ifdef CONFIG_6xx extern long _get_L2CR(void); extern long _get_L3CR(void); -- cgit v1.2.3 From 34f329db54e8154cf7faf0e7c45e7c16facfbbfe Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Fri, 20 Jul 2007 15:58:38 +1000 Subject: [POWERPC] of_detach_node()'s device node argument cannot be const ...since it modifies it (when it sets the OF_DETACHED flag). Signed-off-by: Segher Boessenkool Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/prom.c | 2 +- include/asm-powerpc/prom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index bdcd23d8d8b..a38197b12d3 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -1218,7 +1218,7 @@ void of_attach_node(struct device_node *np) * a reference to the node. The memory associated with the node * is not freed until its refcount goes to zero. */ -void of_detach_node(const struct device_node *np) +void of_detach_node(struct device_node *np) { struct device_node *parent; diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 6e391c9894c..672083787a1 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h @@ -139,7 +139,7 @@ extern unsigned long __init of_get_flat_dt_root(void); /* For updating the device tree at runtime */ extern void of_attach_node(struct device_node *); -extern void of_detach_node(const struct device_node *); +extern void of_detach_node(struct device_node *); /* Other Prototypes */ extern void finish_device_tree(void); -- cgit v1.2.3 From 7fd7218610600b16f6f0af3f9d9353ba0265c09f Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sat, 21 Jul 2007 09:55:21 +1000 Subject: [POWERPC] MPIC protected sources Some HW platforms, such as the new cell blades, requires some MPIC sources to be left alone by the operating system. This implements support for a "protected-sources" property in the mpic controller node containing a list of source numbers to be protected against operating system interference. For those interested in the gory details, the MPIC on the southbridge of those blades has some of the processor outputs routed to the cell, and at least one routed as a GPIO to the service processor. It will be used in the GA product for routing some of the southbridge error interrupts to the service processor which implements some of the RAS stuff, such as checkstopping when fatal errors occurs before they can propagate. Signed-off-by: Benjamin Herrenschmidt Acked-by: Arnd Bergmann Signed-off-by: Paul Mackerras --- arch/powerpc/sysdev/mpic.c | 32 ++++++++++++++++++++++++++++++++ include/asm-powerpc/mpic.h | 3 +++ 2 files changed, 35 insertions(+) diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 75aad38179f..74c64c0d3b7 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -877,6 +877,8 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq, if (hw == mpic->spurious_vec) return -EINVAL; + if (mpic->protected && test_bit(hw, mpic->protected)) + return -EINVAL; #ifdef CONFIG_SMP else if (hw >= mpic->ipi_vecs[0]) { @@ -1034,6 +1036,25 @@ struct mpic * __init mpic_alloc(struct device_node *node, if (node && of_get_property(node, "big-endian", NULL) != NULL) mpic->flags |= MPIC_BIG_ENDIAN; + /* Look for protected sources */ + if (node) { + unsigned int psize, bits, mapsize; + const u32 *psrc = + of_get_property(node, "protected-sources", &psize); + if (psrc) { + psize /= 4; + bits = intvec_top + 1; + mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long); + mpic->protected = alloc_bootmem(mapsize); + BUG_ON(mpic->protected == NULL); + memset(mpic->protected, 0, mapsize); + for (i = 0; i < psize; i++) { + if (psrc[i] > intvec_top) + continue; + __set_bit(psrc[i], mpic->protected); + } + } + } #ifdef CONFIG_MPIC_WEIRD mpic->hw_set = mpic_infos[MPIC_GET_REGSET(flags)]; @@ -1213,6 +1234,9 @@ void __init mpic_init(struct mpic *mpic) u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT); + /* check if protected */ + if (mpic->protected && test_bit(i, mpic->protected)) + continue; /* init hw */ mpic_irq_write(i, MPIC_INFO(IRQ_VECTOR_PRI), vecpri); mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), @@ -1407,6 +1431,14 @@ unsigned int mpic_get_one_irq(struct mpic *mpic) mpic_eoi(mpic); return NO_IRQ; } + if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { + if (printk_ratelimit()) + printk(KERN_WARNING "%s: Got protected source %d !\n", + mpic->name, (int)src); + mpic_eoi(mpic); + return NO_IRQ; + } + return irq_linear_revmap(mpic->irqhost, src); } diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index 2ffb06abe88..262db6b8da7 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h @@ -296,6 +296,9 @@ struct mpic unsigned int dcr_base; #endif + /* Protected sources */ + unsigned long *protected; + #ifdef CONFIG_MPIC_WEIRD /* Pointer to HW info array */ u32 *hw_set; -- cgit v1.2.3 From 8bf8df7120006b8c97ad3a9fcc79e2ba894c46dd Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sun, 22 Jul 2007 00:23:03 +1000 Subject: [POWERPC] Constify of_platform_driver name Signed-off-by: Stephen Rothwell Acked-by: David S. Miller Signed-off-by: Paul Mackerras --- drivers/pcmcia/m8xx_pcmcia.c | 2 +- include/linux/of_platform.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index 3c45142c40b..b0198549846 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c @@ -1316,7 +1316,7 @@ static struct of_device_id m8xx_pcmcia_match[] = { MODULE_DEVICE_TABLE(of, m8xx_pcmcia_match); static struct of_platform_driver m8xx_pcmcia_driver = { - .name = (char *)driver_name, + .name = driver_name, .match_table = m8xx_pcmcia_match, .probe = m8xx_probe, .remove = m8xx_remove, diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 5fd44e63fb2..22c3837784b 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -31,7 +31,7 @@ extern struct bus_type of_platform_bus_type; */ struct of_platform_driver { - char *name; + const char *name; struct of_device_id *match_table; struct module *owner; -- cgit v1.2.3 From b1c30115f4861c9dd2dcaaac2a01acc67dd4cf94 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sun, 22 Jul 2007 00:25:00 +1000 Subject: [POWERPC] hvcs: Make some things static and const Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/char/hvcs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index 17f96e04266..69d8866de78 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c @@ -210,9 +210,9 @@ static struct ktermios hvcs_tty_termios = { static int hvcs_parm_num_devs = -1; module_param(hvcs_parm_num_devs, int, 0); -char hvcs_driver_name[] = "hvcs"; -char hvcs_device_node[] = "hvcs"; -char hvcs_driver_string[] +static const char hvcs_driver_name[] = "hvcs"; +static const char hvcs_device_node[] = "hvcs"; +static const char hvcs_driver_string[] = "IBM hvcs (Hypervisor Virtual Console Server) Driver"; /* Status of partner info rescan triggered via sysfs. */ @@ -1092,7 +1092,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address, * NOTICE: Do NOT hold either the hvcs_struct.lock or hvcs_structs_lock when * calling this function or you will get deadlock. */ -struct hvcs_struct *hvcs_get_by_index(int index) +static struct hvcs_struct *hvcs_get_by_index(int index) { struct hvcs_struct *hvcsd = NULL; unsigned long flags; -- cgit v1.2.3 From 51d261122d0ffac8cf91cc6e74ffcfea23faeb1c Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sun, 22 Jul 2007 00:27:01 +1000 Subject: [POWERPC] Constify of_platform_driver match_table Signed-off-by: Stephen Rothwell Acked-by: David S. Miller Signed-off-by: Paul Mackerras --- include/linux/of_platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 22c3837784b..448f70b30a0 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -32,7 +32,7 @@ extern struct bus_type of_platform_bus_type; struct of_platform_driver { const char *name; - struct of_device_id *match_table; + const struct of_device_id *match_table; struct module *owner; int (*probe)(struct of_device* dev, -- cgit v1.2.3 From a6dfe1dc074cc2218b2e32f67ce3a1ed4f89b200 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sun, 22 Jul 2007 00:31:28 +1000 Subject: [POWERPC] Quiet section mismatch in hvc_rtas.c WARNING: vmlinux.o(.text+0x2066f0): Section mismatch: reference to .init.text:.add_preferred_console (between '.hvc_rtas_console_init' and '.hvc_beat_put_chars') Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/char/hvc_rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hvc_rtas.c b/drivers/char/hvc_rtas.c index 4b97eaf1860..bb09413d5a2 100644 --- a/drivers/char/hvc_rtas.c +++ b/drivers/char/hvc_rtas.c @@ -115,7 +115,7 @@ static void __exit hvc_rtas_exit(void) module_exit(hvc_rtas_exit); /* This will happen prior to module init. There is no tty at this time? */ -static int hvc_rtas_console_init(void) +static int __init hvc_rtas_console_init(void) { rtascons_put_char_token = rtas_token("put-term-char"); if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE) -- cgit v1.2.3 From 1ad528ebfd1a32e33a7ade23a7e4eeb250ef64a7 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sun, 22 Jul 2007 00:33:11 +1000 Subject: [POWERPC] init and exit markings for hvc_iseries Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/char/hvc_iseries.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c index b37f1d5a5be..a08f8f981c1 100644 --- a/drivers/char/hvc_iseries.c +++ b/drivers/char/hvc_iseries.c @@ -472,7 +472,7 @@ static void hvc_handle_event(struct HvLpEvent *event) } } -static int send_open(HvLpIndex remoteLp, void *sem) +static int __init send_open(HvLpIndex remoteLp, void *sem) { return HvCallEvent_signalLpEventFast(remoteLp, HvLpEvent_Type_VirtualIo, @@ -484,7 +484,7 @@ static int send_open(HvLpIndex remoteLp, void *sem) 0, 0, 0, 0); } -static int hvc_vio_init(void) +static int __init hvc_vio_init(void) { atomic_t wait_flag; int rc; @@ -552,14 +552,14 @@ static int hvc_vio_init(void) } module_init(hvc_vio_init); /* after drivers/char/hvc_console.c */ -static void hvc_vio_exit(void) +static void __exit hvc_vio_exit(void) { vio_unregister_driver(&hvc_vio_driver); } module_exit(hvc_vio_exit); /* the device tree order defines our numbering */ -static int hvc_find_vtys(void) +static int __init hvc_find_vtys(void) { struct device_node *vty; int num_found = 0; -- cgit v1.2.3 From a2b7390af4f6a9aec079dfc15874528c3adaeccb Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sun, 22 Jul 2007 00:37:38 +1000 Subject: [POWERPC] Quiet section mismatch warning on pcibios_setup WARNING: vmlinux.o(.text+0x1cefcc): Section mismatch: reference to .init.text:.pcibios_setup (between '.pci_setup' and '.pci_init') pci_setup() is marked __devinit and calls pcibios_setup. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/pci-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 94b4a028232..fe7d1255e11 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -166,7 +166,7 @@ int pcibios_add_platform_entries(struct pci_dev *pdev) } -char __init *pcibios_setup(char *str) +char __devinit *pcibios_setup(char *str) { return str; } -- cgit v1.2.3 From 7bd02a20d5fcb69e1623c3bf2b68959fe7a77fa4 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Sun, 22 Jul 2007 01:02:30 +1000 Subject: [POWERPC] Clean up duplicate includes in drivers/macintosh/ Signed-off-by: Jesper Juhl Acked-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- drivers/macintosh/rack-meter.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 4177ff00475..2c21d4f25cc 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3