commit 20f85957667ccc53183b5ffac22213d75e317408 Merge: 7786ce1... 284a940... Author: Linus Torvalds Date: Tue Oct 17 08:20:57 2006 -0700 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] Check for offline nodes in pci NUMA code [POWERPC] Better check in show_instructions [POWERPC] POWER6 has 6 PMCs [POWERPC] Never panic when taking altivec exceptions from userspace [POWERPC] Fix IO Window Updates on P2P bridges. [POWERPC] Add Makefile entry for MPC832x_mds support [POWERPC] Fix MPC8360EMDS PB board support [POWERPC] ppc: Add missing calls to set_irq_regs [POWERPC] Off-by-one in /arch/ppc/platforms/mpc8* [POWERPC] Add DOS partition table support to mpc834x_itx_defconfig [POWERPC] spufs: fix support for read/write on cntl [POWERPC] Don't crash on cell with 2 BEs when !CONFIG_NUMA commit 284a940675a64df253e3dffc60b09bb4bbb149e4 Author: Anton Blanchard Date: Fri Oct 13 12:26:57 2006 +1000 [POWERPC] Check for offline nodes in pci NUMA code During boot we bring up all memory and cpu nodes. Normally a PCI device will be in one of these online nodes, however in some weird setups it may not. We have only seen this in the lab but we may as well check for the case and fallback to -1 (all nodes). Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras commit 00ae36de49cc718d4122e1c8aac96fd1a5a2553c Author: Anton Blanchard Date: Fri Oct 13 12:17:16 2006 +1000 [POWERPC] Better check in show_instructions Instead of just checking that an address is in the right range, use the provided __kernel_text_address() helper which covers both the kernel and module text sections. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras commit 99f48610252b736908fa5bdea505a480368308d6 Author: Anton Blanchard Date: Fri Oct 13 12:13:12 2006 +1000 [POWERPC] POWER6 has 6 PMCs Change ->num_pmcs to match the number of PMCs in POWER6. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras commit 6c4841c2b6c32a134f9f36e5e08857138cc12b10 Author: Anton Blanchard Date: Fri Oct 13 11:41:00 2006 +1000 [POWERPC] Never panic when taking altivec exceptions from userspace At the moment we rely on a cpu feature bit or a firmware property to detect altivec. If we dont have either of these and the cpu does in fact support altivec we can cause a panic from userspace. It seems safer to always send a signal if we manage to get an 0xf20 exception from userspace. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras commit 60b2a46cd60c54bd6551ddfa01f0aab08ca58a5d Author: Randy Vinson Date: Thu Oct 12 13:36:23 2006 -0700 [POWERPC] Fix IO Window Updates on P2P bridges. When update_bridge_base() updates the IO window on a PCI-to-PCI bridge, it fails to zero the upper 16 bits of the base and limit registers if the window size is less than 64K. This fixes it. Signed-off-by: Paul Mackerras commit 8ba738c2bb8fb83c0c99f680444d3ffd4c178ca2 Author: Li Yang Date: Wed Oct 11 19:27:57 2006 +0800 [POWERPC] Add Makefile entry for MPC832x_mds support Add missing entry in Makefile for MPC832x MDS support. It also change white space to tab in MPC8360 entry. Signed-off-by: Li Yang Signed-off-by: Paul Mackerras commit f5a37b066165f9938a93653f6940f3dc85ce751d Author: Li Yang Date: Wed Oct 11 19:04:22 2006 +0800 [POWERPC] Fix MPC8360EMDS PB board support MPC8360EMDS PB support is broken as some code was missing in last submission. This patch adds missing code and makes MPC8360EMDS PB support working. Signed-off-by: Li Yang Signed-off-by: Kim Phillips Signed-off-by: Paul Mackerras commit 7d2bd30f67e231920091d55d0fffc3a4bf43e68a Author: Kumar Gala Date: Wed Oct 11 02:06:59 2006 -0500 [POWERPC] ppc: Add missing calls to set_irq_regs In the timer_interrupt we were not calling set_irq_regs() and if we are profiling we will end up calling get_irq_regs(). This causes bad things to happen. Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras commit bb579cf1d413b930be0241987b848e0f0c1b292f Author: Eric Sesterhenn Date: Tue Oct 10 14:37:29 2006 -0700 [POWERPC] Off-by-one in /arch/ppc/platforms/mpc8* A find -iname \*.[ch] | xargs grep "> ARRAY_SIZE(" revealed several incorrect usages of ARRAY_SIZE in the mpc drivers. The last element in the array is always ARRAY_SIZE()-1, this patch modifies the bounds checks accordingly. Signed-off-by: Eric Sesterhenn Cc: Vitaly Bordug Signed-off-by: Andrew Morton Signed-off-by: Paul Mackerras commit ee4ea82c07fa8aa46037962ec3e8b40c5144b5eb Author: Timur Tabi Date: Tue Oct 10 11:53:26 2006 -0500 [POWERPC] Add DOS partition table support to mpc834x_itx_defconfig The default configuration file for the MPC8349E-mITX reference board, mpc834x_itx_defconfig, did not include support for DOS partition table types. This support is necessary because the hard drive that comes with the ITX is formatted with this partition table type. Without this config option, no partitions on the drive can be mounted. Signed-off-by: Timur Tabi Signed-off-by: Paul Mackerras commit 654e4aee495bec1e4fc71ba1af25735da7cadc15 Author: Noguchi, Masato Date: Tue Oct 10 10:27:29 2006 +0200 [POWERPC] spufs: fix support for read/write on cntl This fixes a memory leak introduced by "spufs: add support for read/write oncntl", which was missing a call to simple_attr_close. Signed-off-by: Masato Noguchi Signed-off-by: Arnd Bergmann Signed-off-by: Paul Mackerras commit e5267b4b376cfbdc4518abcc68d5a7fffb505638 Author: Benjamin Herrenschmidt Date: Tue Oct 10 15:14:12 2006 +1000 [POWERPC] Don't crash on cell with 2 BEs when !CONFIG_NUMA The SPU code will crash if CONFIG_NUMA is not set and SPUs are found on a non-0 node. This workaround will ignore those SPEs and just print an message in the kernel log. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras Index: linux-2.6/arch/powerpc/configs/mpc834x_itx_defconfig =================================================================== --- linux-2.6.orig/arch/powerpc/configs/mpc834x_itx_defconfig +++ linux-2.6/arch/powerpc/configs/mpc834x_itx_defconfig @@ -1248,7 +1248,7 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set # CONFIG_MAC_PARTITION is not set -# CONFIG_MSDOS_PARTITION is not set +CONFIG_MSDOS_PARTITION=y # CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set Index: linux-2.6/arch/powerpc/kernel/cputable.c =================================================================== --- linux-2.6.orig/arch/powerpc/kernel/cputable.c +++ linux-2.6/arch/powerpc/kernel/cputable.c @@ -268,7 +268,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER_POWER6, .icache_bsize = 128, .dcache_bsize = 128, - .num_pmcs = 8, + .num_pmcs = 6, .oprofile_cpu_type = "ppc64/power6", .oprofile_type = PPC_OPROFILE_POWER4, .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV, Index: linux-2.6/arch/powerpc/kernel/pci_32.c =================================================================== --- linux-2.6.orig/arch/powerpc/kernel/pci_32.c +++ linux-2.6/arch/powerpc/kernel/pci_32.c @@ -441,14 +441,14 @@ update_bridge_base(struct pci_bus *bus, end = res->end - off; io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK; io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK; - if (end > 0xffff) { - pci_write_config_word(dev, PCI_IO_BASE_UPPER16, - start >> 16); - pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, - end >> 16); + if (end > 0xffff) io_base_lo |= PCI_IO_RANGE_TYPE_32; - } else + else io_base_lo |= PCI_IO_RANGE_TYPE_16; + pci_write_config_word(dev, PCI_IO_BASE_UPPER16, + start >> 16); + pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, + end >> 16); pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo); pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo); Index: linux-2.6/arch/powerpc/kernel/pci_64.c =================================================================== --- linux-2.6.orig/arch/powerpc/kernel/pci_64.c +++ linux-2.6/arch/powerpc/kernel/pci_64.c @@ -199,8 +199,14 @@ struct pci_controller * pcibios_alloc_co pci_setup_pci_controller(phb); phb->arch_data = dev; phb->is_dynamic = mem_init_done; - if (dev) - PHB_SET_NODE(phb, of_node_to_nid(dev)); + if (dev) { + int nid = of_node_to_nid(dev); + + if (nid < 0 || !node_online(nid)) + nid = -1; + + PHB_SET_NODE(phb, nid); + } return phb; } Index: linux-2.6/arch/powerpc/kernel/process.c =================================================================== --- linux-2.6.orig/arch/powerpc/kernel/process.c +++ linux-2.6/arch/powerpc/kernel/process.c @@ -341,13 +341,6 @@ struct task_struct *__switch_to(struct t static int instructions_to_print = 16; -#ifdef CONFIG_PPC64 -#define BAD_PC(pc) ((REGION_ID(pc) != KERNEL_REGION_ID) && \ - (REGION_ID(pc) != VMALLOC_REGION_ID)) -#else -#define BAD_PC(pc) ((pc) < KERNELBASE) -#endif - static void show_instructions(struct pt_regs *regs) { int i; @@ -366,7 +359,8 @@ static void show_instructions(struct pt_ * bad address because the pc *should* only be a * kernel address. */ - if (BAD_PC(pc) || __get_user(instr, (unsigned int __user *)pc)) { + if (!__kernel_text_address(pc) || + __get_user(instr, (unsigned int __user *)pc)) { printk("XXXXXXXX "); } else { if (regs->nip == pc) Index: linux-2.6/arch/powerpc/kernel/traps.c =================================================================== --- linux-2.6.orig/arch/powerpc/kernel/traps.c +++ linux-2.6/arch/powerpc/kernel/traps.c @@ -900,14 +900,13 @@ void kernel_fp_unavailable_exception(str void altivec_unavailable_exception(struct pt_regs *regs) { -#if !defined(CONFIG_ALTIVEC) if (user_mode(regs)) { /* A user program has executed an altivec instruction, but this kernel doesn't support altivec. */ _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); return; } -#endif + printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception " "%lx at %lx\n", regs->trap, regs->nip); die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); Index: linux-2.6/arch/powerpc/platforms/83xx/Kconfig =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/83xx/Kconfig +++ linux-2.6/arch/powerpc/platforms/83xx/Kconfig @@ -32,6 +32,13 @@ config MPC834x_ITX Be aware that PCI initialization is the bootloader's responsiblilty. +config MPC8360E_PB + bool "Freescale MPC8360E PB" + select DEFAULT_UIMAGE + select QUICC_ENGINE + help + This option enables support for the MPC836x EMDS Processor Board. + endchoice config PPC_MPC832x @@ -46,4 +53,10 @@ config MPC834x select PPC_INDIRECT_PCI default y if MPC834x_SYS || MPC834x_ITX +config PPC_MPC836x + bool + select PPC_UDBG_16550 + select PPC_INDIRECT_PCI + default y if MPC8360E_PB + endmenu Index: linux-2.6/arch/powerpc/platforms/83xx/Makefile =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/83xx/Makefile +++ linux-2.6/arch/powerpc/platforms/83xx/Makefile @@ -5,3 +5,5 @@ obj-y := misc.o obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_MPC834x_SYS) += mpc834x_sys.o obj-$(CONFIG_MPC834x_ITX) += mpc834x_itx.o +obj-$(CONFIG_MPC8360E_PB) += mpc8360e_pb.o +obj-$(CONFIG_MPC832x_MDS) += mpc832x_mds.o Index: linux-2.6/arch/powerpc/platforms/83xx/mpc8360e_pb.c =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/83xx/mpc8360e_pb.c +++ linux-2.6/arch/powerpc/platforms/83xx/mpc8360e_pb.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -141,6 +142,24 @@ static void __init mpc8360_sys_setup_arc #endif } +static int __init mpc8360_declare_of_platform_devices(void) +{ + struct device_node *np; + + for (np = NULL; (np = of_find_compatible_node(np, "network", + "ucc_geth")) != NULL;) { + int ucc_num; + char bus_id[BUS_ID_SIZE]; + + ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1; + snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num); + of_platform_device_create(np, bus_id, NULL); + } + + return 0; +} +device_initcall(mpc8360_declare_of_platform_devices); + void __init mpc8360_sys_init_IRQ(void) { Index: linux-2.6/arch/powerpc/platforms/cell/spu_base.c =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/cell/spu_base.c +++ linux-2.6/arch/powerpc/platforms/cell/spu_base.c @@ -781,6 +781,17 @@ static int __init create_spu(struct devi if (!spu) goto out; + spu->node = find_spu_node_id(spe); + if (spu->node >= MAX_NUMNODES) { + printk(KERN_WARNING "SPE %s on node %d ignored," + " node number too big\n", spe->full_name, spu->node); + printk(KERN_WARNING "Check if CONFIG_NUMA is enabled.\n"); + return -ENODEV; + } + spu->nid = of_node_to_nid(spe); + if (spu->nid == -1) + spu->nid = 0; + ret = spu_map_device(spu, spe); /* try old method */ if (ret) @@ -788,10 +799,6 @@ static int __init create_spu(struct devi if (ret) goto out_free; - spu->node = find_spu_node_id(spe); - spu->nid = of_node_to_nid(spe); - if (spu->nid == -1) - spu->nid = 0; ret = spu_map_interrupts(spu, spe); if (ret) ret = spu_map_interrupts_old(spu, spe); Index: linux-2.6/arch/powerpc/platforms/cell/spufs/file.c =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/file.c +++ linux-2.6/arch/powerpc/platforms/cell/spufs/file.c @@ -246,6 +246,7 @@ static int spufs_cntl_open(struct inode static struct file_operations spufs_cntl_fops = { .open = spufs_cntl_open, + .release = simple_attr_close, .read = simple_attr_read, .write = simple_attr_write, .mmap = spufs_cntl_mmap, Index: linux-2.6/arch/ppc/kernel/time.c =================================================================== --- linux-2.6.orig/arch/ppc/kernel/time.c +++ linux-2.6/arch/ppc/kernel/time.c @@ -62,6 +62,7 @@ #include #include #include +#include #include @@ -131,6 +132,7 @@ void wakeup_decrementer(void) */ void timer_interrupt(struct pt_regs * regs) { + struct pt_regs *old_regs; int next_dec; unsigned long cpu = smp_processor_id(); unsigned jiffy_stamp = last_jiffy_stamp(cpu); @@ -139,6 +141,7 @@ void timer_interrupt(struct pt_regs * re if (atomic_read(&ppc_n_lost_interrupts) != 0) do_IRQ(regs); + old_regs = set_irq_regs(regs); irq_enter(); while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) { @@ -191,6 +194,7 @@ void timer_interrupt(struct pt_regs * re ppc_md.heartbeat(); irq_exit(); + set_irq_regs(old_regs); } /* Index: linux-2.6/arch/ppc/platforms/mpc8272ads_setup.c =================================================================== --- linux-2.6.orig/arch/ppc/platforms/mpc8272ads_setup.c +++ linux-2.6/arch/ppc/platforms/mpc8272ads_setup.c @@ -196,7 +196,7 @@ static void __init mpc8272ads_fixup_enet bd_t* bi = (void*)__res; int fs_no = fsid_fcc1+pdev->id-1; - if(fs_no > ARRAY_SIZE(mpc82xx_enet_pdata)) { + if(fs_no >= ARRAY_SIZE(mpc82xx_enet_pdata)) { return; } @@ -222,7 +222,7 @@ static void mpc8272ads_fixup_uart_pdata( int id = fs_uart_id_scc2fsid(idx); /* no need to alter anything if console */ - if ((id <= num) && (!pdev->dev.platform_data)) { + if ((id < num) && (!pdev->dev.platform_data)) { pinfo = &mpc8272_uart_pdata[id]; pinfo->uart_clk = bd->bi_intfreq; pdev->dev.platform_data = pinfo; Index: linux-2.6/arch/ppc/platforms/mpc866ads_setup.c =================================================================== --- linux-2.6.orig/arch/ppc/platforms/mpc866ads_setup.c +++ linux-2.6/arch/ppc/platforms/mpc866ads_setup.c @@ -259,7 +259,7 @@ static void mpc866ads_fixup_enet_pdata(s /* Get pointer to Communication Processor */ cp = cpmp; - if(fs_no > ARRAY_SIZE(mpc8xx_enet_pdata)) { + if(fs_no >= ARRAY_SIZE(mpc8xx_enet_pdata)) { printk(KERN_ERR"No network-suitable #%d device on bus", fs_no); return; } @@ -305,7 +305,7 @@ static void __init mpc866ads_fixup_uart_ int id = fs_uart_id_smc2fsid(idx); /* no need to alter anything if console */ - if ((id <= num) && (!pdev->dev.platform_data)) { + if ((id < num) && (!pdev->dev.platform_data)) { pinfo = &mpc866_uart_pdata[id]; pinfo->uart_clk = bd->bi_intfreq; pdev->dev.platform_data = pinfo; Index: linux-2.6/arch/ppc/platforms/mpc885ads_setup.c =================================================================== --- linux-2.6.orig/arch/ppc/platforms/mpc885ads_setup.c +++ linux-2.6/arch/ppc/platforms/mpc885ads_setup.c @@ -263,7 +263,7 @@ static void mpc885ads_fixup_enet_pdata(s char *e; int i; - if(fs_no > ARRAY_SIZE(mpc8xx_enet_pdata)) { + if(fs_no >= ARRAY_SIZE(mpc8xx_enet_pdata)) { printk(KERN_ERR"No network-suitable #%d device on bus", fs_no); return; } @@ -371,7 +371,7 @@ static void __init mpc885ads_fixup_uart_ int id = fs_uart_id_smc2fsid(idx); /* no need to alter anything if console */ - if ((id <= num) && (!pdev->dev.platform_data)) { + if ((id < num) && (!pdev->dev.platform_data)) { pinfo = &mpc885_uart_pdata[id]; pinfo->uart_clk = bd->bi_intfreq; pdev->dev.platform_data = pinfo;