Skip to content

Commit

Permalink
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Oct 17, 2006
2 parents 7786ce1 + 284a940 commit 20f8595
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 30 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/configs/mpc834x_itx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/cputable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions arch/powerpc/kernel/pci_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,14 @@ update_bridge_base(struct pci_bus *bus, int i)
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);

Expand Down
10 changes: 8 additions & 2 deletions arch/powerpc/kernel/pci_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,14 @@ struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
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;
}

Expand Down
10 changes: 2 additions & 8 deletions arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,6 @@ struct task_struct *__switch_to(struct task_struct *prev,

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;
Expand All @@ -366,7 +359,8 @@ static void show_instructions(struct pt_regs *regs)
* 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)
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,14 +900,13 @@ void kernel_fp_unavailable_exception(struct pt_regs *regs)

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);
Expand Down
13 changes: 13 additions & 0 deletions arch/powerpc/platforms/83xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions arch/powerpc/platforms/83xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions arch/powerpc/platforms/83xx/mpc8360e_pb.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/root_dev.h>
#include <linux/initrd.h>

#include <asm/of_device.h>
#include <asm/system.h>
#include <asm/atomic.h>
#include <asm/time.h>
Expand Down Expand Up @@ -141,6 +142,24 @@ static void __init mpc8360_sys_setup_arch(void)
#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)
{

Expand Down
15 changes: 11 additions & 4 deletions arch/powerpc/platforms/cell/spu_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,17 +781,24 @@ static int __init create_spu(struct device_node *spe)
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)
ret = spu_map_device_old(spu, spe);
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);
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/cell/spufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file)

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,
Expand Down
4 changes: 4 additions & 0 deletions arch/ppc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include <asm/cache.h>
#include <asm/8xx_immap.h>
#include <asm/machdep.h>
#include <asm/irq_regs.h>

#include <asm/time.h>

Expand Down Expand Up @@ -129,6 +130,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);
Expand All @@ -137,6 +139,7 @@ void timer_interrupt(struct pt_regs * regs)
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) {
Expand Down Expand Up @@ -188,6 +191,7 @@ void timer_interrupt(struct pt_regs * regs)
ppc_md.heartbeat();

irq_exit();
set_irq_regs(old_regs);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions arch/ppc/platforms/mpc8272ads_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static void __init mpc8272ads_fixup_enet_pdata(struct platform_device *pdev,
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;
}

Expand All @@ -222,7 +222,7 @@ static void mpc8272ads_fixup_uart_pdata(struct platform_device *pdev,
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;
Expand Down
4 changes: 2 additions & 2 deletions arch/ppc/platforms/mpc866ads_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static void mpc866ads_fixup_enet_pdata(struct platform_device *pdev, int fs_no)
/* 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;
}
Expand Down Expand Up @@ -305,7 +305,7 @@ static void __init mpc866ads_fixup_uart_pdata(struct platform_device *pdev,
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;
Expand Down
4 changes: 2 additions & 2 deletions arch/ppc/platforms/mpc885ads_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static void mpc885ads_fixup_enet_pdata(struct platform_device *pdev, int fs_no)
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;
}
Expand Down Expand Up @@ -371,7 +371,7 @@ static void __init mpc885ads_fixup_uart_pdata(struct platform_device *pdev,
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;
Expand Down

0 comments on commit 20f8595

Please sign in to comment.