aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/setup.c18
-rw-r--r--arch/arm/mach-imx/generic.c13
-rw-r--r--arch/i386/kernel/crash.c2
-rw-r--r--arch/i386/kernel/setup.c18
-rw-r--r--arch/mips/Kconfig6
-rw-r--r--arch/mips/kernel/Makefile2
-rw-r--r--arch/mips/kernel/i8253.c28
-rw-r--r--arch/powerpc/kernel/lparcfg.c31
-rw-r--r--arch/powerpc/kernel/rtas.c12
-rw-r--r--arch/powerpc/kernel/setup-common.c24
-rw-r--r--arch/powerpc/kernel/setup_32.c6
-rw-r--r--arch/powerpc/kernel/setup_64.c10
-rw-r--r--arch/powerpc/kernel/systbl.S1
-rw-r--r--arch/powerpc/kernel/traps.c9
-rw-r--r--arch/powerpc/mm/fault.c6
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_sys.c40
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c40
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c1
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c1
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c62
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c19
-rw-r--r--arch/powerpc/platforms/pseries/eeh_event.c30
-rw-r--r--arch/powerpc/platforms/pseries/hvCall.S100
-rw-r--r--arch/powerpc/platforms/pseries/hvconsole.c6
-rw-r--r--arch/powerpc/platforms/pseries/hvcserver.c22
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c31
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
-rw-r--r--arch/powerpc/platforms/pseries/vio.c4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c8
-rw-r--r--arch/sparc/kernel/systbls.S4
-rw-r--r--arch/sparc64/defconfig14
-rw-r--r--arch/sparc64/kernel/smp.c9
-rw-r--r--arch/sparc64/kernel/sys32.S2
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c8
-rw-r--r--arch/sparc64/kernel/systbls.S8
-rw-r--r--arch/sparc64/mm/fault.c6
-rw-r--r--arch/sparc64/mm/hugetlbpage.c7
37 files changed, 430 insertions, 180 deletions
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index dd8769670596..a15e18a00258 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -28,6 +28,7 @@
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/ioport.h> 30#include <linux/ioport.h>
31#include <linux/platform_device.h>
31#include <linux/bootmem.h> 32#include <linux/bootmem.h>
32#include <linux/pci.h> 33#include <linux/pci.h>
33#include <linux/seq_file.h> 34#include <linux/seq_file.h>
@@ -1478,3 +1479,20 @@ alpha_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
1478#endif 1479#endif
1479 return NOTIFY_DONE; 1480 return NOTIFY_DONE;
1480} 1481}
1482
1483static __init int add_pcspkr(void)
1484{
1485 struct platform_device *pd;
1486 int ret;
1487
1488 pd = platform_device_alloc("pcspkr", -1);
1489 if (!pd)
1490 return -ENOMEM;
1491
1492 ret = platform_device_add(pd);
1493 if (ret)
1494 platform_device_put(pd);
1495
1496 return ret;
1497}
1498device_initcall(add_pcspkr);
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
index 37613ad68366..9d8331be2b58 100644
--- a/arch/arm/mach-imx/generic.c
+++ b/arch/arm/mach-imx/generic.c
@@ -33,6 +33,7 @@
33#include <asm/arch/imx-regs.h> 33#include <asm/arch/imx-regs.h>
34 34
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36#include <asm/arch/mmc.h>
36 37
37void imx_gpio_mode(int gpio_mode) 38void imx_gpio_mode(int gpio_mode)
38{ 39{
@@ -175,13 +176,25 @@ static struct resource imx_mmc_resources[] = {
175 }, 176 },
176}; 177};
177 178
179static u64 imxmmmc_dmamask = 0xffffffffUL;
180
178static struct platform_device imx_mmc_device = { 181static struct platform_device imx_mmc_device = {
179 .name = "imx-mmc", 182 .name = "imx-mmc",
180 .id = 0, 183 .id = 0,
184 .dev = {
185 .dma_mask = &imxmmmc_dmamask,
186 .coherent_dma_mask = 0xffffffff,
187 },
181 .num_resources = ARRAY_SIZE(imx_mmc_resources), 188 .num_resources = ARRAY_SIZE(imx_mmc_resources),
182 .resource = imx_mmc_resources, 189 .resource = imx_mmc_resources,
183}; 190};
184 191
192void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
193{
194 imx_mmc_device.dev.platform_data = info;
195}
196EXPORT_SYMBOL(imx_set_mmc_info);
197
185static struct resource imx_uart1_resources[] = { 198static struct resource imx_uart1_resources[] = {
186 [0] = { 199 [0] = {
187 .start = 0x00206000, 200 .start = 0x00206000,
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index e3c5fca0aa8a..2b0cfce24a61 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -69,7 +69,7 @@ static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
69 * for the data I pass, and I need tags 69 * for the data I pass, and I need tags
70 * on the data to indicate what information I have 70 * on the data to indicate what information I have
71 * squirrelled away. ELF notes happen to provide 71 * squirrelled away. ELF notes happen to provide
72 * all of that that no need to invent something new. 72 * all of that, so there is no need to invent something new.
73 */ 73 */
74 buf = (u32*)per_cpu_ptr(crash_notes, cpu); 74 buf = (u32*)per_cpu_ptr(crash_notes, cpu);
75 if (!buf) 75 if (!buf)
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 8c08660b4e5d..eacc3f0a2ea4 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -34,6 +34,7 @@
34#include <linux/initrd.h> 34#include <linux/initrd.h>
35#include <linux/bootmem.h> 35#include <linux/bootmem.h>
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <linux/platform_device.h>
37#include <linux/console.h> 38#include <linux/console.h>
38#include <linux/mca.h> 39#include <linux/mca.h>
39#include <linux/root_dev.h> 40#include <linux/root_dev.h>
@@ -1547,6 +1548,23 @@ void __init setup_arch(char **cmdline_p)
1547#endif 1548#endif
1548} 1549}
1549 1550
1551static __init int add_pcspkr(void)
1552{
1553 struct platform_device *pd;
1554 int ret;
1555
1556 pd = platform_device_alloc("pcspkr", -1);
1557 if (!pd)
1558 return -ENOMEM;
1559
1560 ret = platform_device_add(pd);
1561 if (ret)
1562 platform_device_put(pd);
1563
1564 return ret;
1565}
1566device_initcall(add_pcspkr);
1567
1550#include "setup_arch_post.h" 1568#include "setup_arch_post.h"
1551/* 1569/*
1552 * Local Variables: 1570 * Local Variables:
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 5080ea1799a4..e15709ce8866 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -233,6 +233,7 @@ config MACH_JAZZ
233 select ARC32 233 select ARC32
234 select ARCH_MAY_HAVE_PC_FDC 234 select ARCH_MAY_HAVE_PC_FDC
235 select GENERIC_ISA_DMA 235 select GENERIC_ISA_DMA
236 select I8253
236 select I8259 237 select I8259
237 select ISA 238 select ISA
238 select SYS_HAS_CPU_R4X00 239 select SYS_HAS_CPU_R4X00
@@ -530,6 +531,7 @@ config QEMU
530 select DMA_COHERENT 531 select DMA_COHERENT
531 select GENERIC_ISA_DMA 532 select GENERIC_ISA_DMA
532 select HAVE_STD_PC_SERIAL_PORT 533 select HAVE_STD_PC_SERIAL_PORT
534 select I8253
533 select I8259 535 select I8259
534 select ISA 536 select ISA
535 select SWAP_IO_SPACE 537 select SWAP_IO_SPACE
@@ -714,6 +716,7 @@ config SNI_RM200_PCI
714 select HAVE_STD_PC_SERIAL_PORT 716 select HAVE_STD_PC_SERIAL_PORT
715 select HW_HAS_EISA 717 select HW_HAS_EISA
716 select HW_HAS_PCI 718 select HW_HAS_PCI
719 select I8253
717 select I8259 720 select I8259
718 select ISA 721 select ISA
719 select SYS_HAS_CPU_R4X00 722 select SYS_HAS_CPU_R4X00
@@ -1721,6 +1724,9 @@ config MMU
1721 bool 1724 bool
1722 default y 1725 default y
1723 1726
1727config I8253
1728 bool
1729
1724source "drivers/pcmcia/Kconfig" 1730source "drivers/pcmcia/Kconfig"
1725 1731
1726source "drivers/pci/hotplug/Kconfig" 1732source "drivers/pci/hotplug/Kconfig"
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index f36c4f20ee8a..309d54cceda3 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -59,6 +59,8 @@ obj-$(CONFIG_PROC_FS) += proc.o
59 59
60obj-$(CONFIG_64BIT) += cpu-bugs64.o 60obj-$(CONFIG_64BIT) += cpu-bugs64.o
61 61
62obj-$(CONFIG_I8253) += i8253.o
63
62CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) 64CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
63 65
64EXTRA_AFLAGS := $(CFLAGS) 66EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
new file mode 100644
index 000000000000..475df6904219
--- /dev/null
+++ b/arch/mips/kernel/i8253.c
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2006 IBM Corporation
3 *
4 * Implements device information for i8253 timer chip
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation
9 */
10
11#include <linux/platform_device.h>
12
13static __init int add_pcspkr(void)
14{
15 struct platform_device *pd;
16 int ret;
17
18 pd = platform_device_alloc("pcspkr", -1);
19 if (!pd)
20 return -ENOMEM;
21
22 ret = platform_device_add(pd);
23 if (ret)
24 platform_device_put(pd);
25
26 return ret;
27}
28device_initcall(add_pcspkr);
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 1b73508ecb2b..2cbde865d4f5 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -37,7 +37,7 @@
37#include <asm/prom.h> 37#include <asm/prom.h>
38#include <asm/vdso_datapage.h> 38#include <asm/vdso_datapage.h>
39 39
40#define MODULE_VERS "1.6" 40#define MODULE_VERS "1.7"
41#define MODULE_NAME "lparcfg" 41#define MODULE_NAME "lparcfg"
42 42
43/* #define LPARCFG_DEBUG */ 43/* #define LPARCFG_DEBUG */
@@ -149,17 +149,17 @@ static void log_plpar_hcall_return(unsigned long rc, char *tag)
149 if (rc == 0) /* success, return */ 149 if (rc == 0) /* success, return */
150 return; 150 return;
151/* check for null tag ? */ 151/* check for null tag ? */
152 if (rc == H_Hardware) 152 if (rc == H_HARDWARE)
153 printk(KERN_INFO 153 printk(KERN_INFO
154 "plpar-hcall (%s) failed with hardware fault\n", tag); 154 "plpar-hcall (%s) failed with hardware fault\n", tag);
155 else if (rc == H_Function) 155 else if (rc == H_FUNCTION)
156 printk(KERN_INFO 156 printk(KERN_INFO
157 "plpar-hcall (%s) failed; function not allowed\n", tag); 157 "plpar-hcall (%s) failed; function not allowed\n", tag);
158 else if (rc == H_Authority) 158 else if (rc == H_AUTHORITY)
159 printk(KERN_INFO 159 printk(KERN_INFO
160 "plpar-hcall (%s) failed; not authorized to this function\n", 160 "plpar-hcall (%s) failed; not authorized to this"
161 tag); 161 " function\n", tag);
162 else if (rc == H_Parameter) 162 else if (rc == H_PARAMETER)
163 printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n", 163 printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
164 tag); 164 tag);
165 else 165 else
@@ -209,7 +209,7 @@ static void h_pic(unsigned long *pool_idle_time, unsigned long *num_procs)
209 unsigned long dummy; 209 unsigned long dummy;
210 rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy); 210 rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy);
211 211
212 if (rc != H_Authority) 212 if (rc != H_AUTHORITY)
213 log_plpar_hcall_return(rc, "H_PIC"); 213 log_plpar_hcall_return(rc, "H_PIC");
214} 214}
215 215
@@ -242,7 +242,7 @@ static void parse_system_parameter_string(struct seq_file *m)
242{ 242{
243 int call_status; 243 int call_status;
244 244
245 char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL); 245 unsigned char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
246 if (!local_buffer) { 246 if (!local_buffer) {
247 printk(KERN_ERR "%s %s kmalloc failure at line %d \n", 247 printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
248 __FILE__, __FUNCTION__, __LINE__); 248 __FILE__, __FUNCTION__, __LINE__);
@@ -254,7 +254,8 @@ static void parse_system_parameter_string(struct seq_file *m)
254 call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1, 254 call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
255 NULL, 255 NULL,
256 SPLPAR_CHARACTERISTICS_TOKEN, 256 SPLPAR_CHARACTERISTICS_TOKEN,
257 __pa(rtas_data_buf)); 257 __pa(rtas_data_buf),
258 RTAS_DATA_BUF_SIZE);
258 memcpy(local_buffer, rtas_data_buf, SPLPAR_MAXLENGTH); 259 memcpy(local_buffer, rtas_data_buf, SPLPAR_MAXLENGTH);
259 spin_unlock(&rtas_data_buf_lock); 260 spin_unlock(&rtas_data_buf_lock);
260 261
@@ -275,7 +276,7 @@ static void parse_system_parameter_string(struct seq_file *m)
275#ifdef LPARCFG_DEBUG 276#ifdef LPARCFG_DEBUG
276 printk(KERN_INFO "success calling get-system-parameter \n"); 277 printk(KERN_INFO "success calling get-system-parameter \n");
277#endif 278#endif
278 splpar_strlen = local_buffer[0] * 16 + local_buffer[1]; 279 splpar_strlen = local_buffer[0] * 256 + local_buffer[1];
279 local_buffer += 2; /* step over strlen value */ 280 local_buffer += 2; /* step over strlen value */
280 281
281 memset(workbuffer, 0, SPLPAR_MAXLENGTH); 282 memset(workbuffer, 0, SPLPAR_MAXLENGTH);
@@ -529,13 +530,13 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
529 retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr, 530 retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
530 *new_weight_ptr); 531 *new_weight_ptr);
531 532
532 if (retval == H_Success || retval == H_Constrained) { 533 if (retval == H_SUCCESS || retval == H_CONSTRAINED) {
533 retval = count; 534 retval = count;
534 } else if (retval == H_Busy) { 535 } else if (retval == H_BUSY) {
535 retval = -EBUSY; 536 retval = -EBUSY;
536 } else if (retval == H_Hardware) { 537 } else if (retval == H_HARDWARE) {
537 retval = -EIO; 538 retval = -EIO;
538 } else if (retval == H_Parameter) { 539 } else if (retval == H_PARAMETER) {
539 retval = -EINVAL; 540 retval = -EINVAL;
540 } else { 541 } else {
541 printk(KERN_WARNING "%s: received unknown hv return code %ld", 542 printk(KERN_WARNING "%s: received unknown hv return code %ld",
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 06636c927a7e..0112318213ab 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -578,18 +578,18 @@ static void rtas_percpu_suspend_me(void *info)
578 * We use "waiting" to indicate our state. As long 578 * We use "waiting" to indicate our state. As long
579 * as it is >0, we are still trying to all join up. 579 * as it is >0, we are still trying to all join up.
580 * If it goes to 0, we have successfully joined up and 580 * If it goes to 0, we have successfully joined up and
581 * one thread got H_Continue. If any error happens, 581 * one thread got H_CONTINUE. If any error happens,
582 * we set it to <0. 582 * we set it to <0.
583 */ 583 */
584 local_irq_save(flags); 584 local_irq_save(flags);
585 do { 585 do {
586 rc = plpar_hcall_norets(H_JOIN); 586 rc = plpar_hcall_norets(H_JOIN);
587 smp_rmb(); 587 smp_rmb();
588 } while (rc == H_Success && data->waiting > 0); 588 } while (rc == H_SUCCESS && data->waiting > 0);
589 if (rc == H_Success) 589 if (rc == H_SUCCESS)
590 goto out; 590 goto out;
591 591
592 if (rc == H_Continue) { 592 if (rc == H_CONTINUE) {
593 data->waiting = 0; 593 data->waiting = 0;
594 data->args->args[data->args->nargs] = 594 data->args->args[data->args->nargs] =
595 rtas_call(ibm_suspend_me_token, 0, 1, NULL); 595 rtas_call(ibm_suspend_me_token, 0, 1, NULL);
@@ -597,7 +597,7 @@ static void rtas_percpu_suspend_me(void *info)
597 plpar_hcall_norets(H_PROD,i); 597 plpar_hcall_norets(H_PROD,i);
598 } else { 598 } else {
599 data->waiting = -EBUSY; 599 data->waiting = -EBUSY;
600 printk(KERN_ERR "Error on H_Join hypervisor call\n"); 600 printk(KERN_ERR "Error on H_JOIN hypervisor call\n");
601 } 601 }
602 602
603out: 603out:
@@ -624,7 +624,7 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
624 printk(KERN_ERR "Error doing global join\n"); 624 printk(KERN_ERR "Error doing global join\n");
625 625
626 /* Prod each CPU. This won't hurt, and will wake 626 /* Prod each CPU. This won't hurt, and will wake
627 * anyone we successfully put to sleep with H_Join 627 * anyone we successfully put to sleep with H_JOIN.
628 */ 628 */
629 for_each_possible_cpu(i) 629 for_each_possible_cpu(i)
630 plpar_hcall_norets(H_PROD, i); 630 plpar_hcall_norets(H_PROD, i);
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index c607f3b9ca17..1d93e73a7003 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -21,6 +21,7 @@
21#include <linux/reboot.h> 21#include <linux/reboot.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/initrd.h> 23#include <linux/initrd.h>
24#include <linux/platform_device.h>
24#include <linux/ide.h> 25#include <linux/ide.h>
25#include <linux/seq_file.h> 26#include <linux/seq_file.h>
26#include <linux/ioport.h> 27#include <linux/ioport.h>
@@ -462,6 +463,29 @@ static int __init early_xmon(char *p)
462early_param("xmon", early_xmon); 463early_param("xmon", early_xmon);
463#endif 464#endif
464 465
466static __init int add_pcspkr(void)
467{
468 struct device_node *np;
469 struct platform_device *pd;
470 int ret;
471
472 np = of_find_compatible_node(NULL, NULL, "pnpPNP,100");
473 of_node_put(np);
474 if (!np)
475 return -ENODEV;
476
477 pd = platform_device_alloc("pcspkr", -1);
478 if (!pd)
479 return -ENOMEM;
480
481 ret = platform_device_add(pd);
482 if (ret)
483 platform_device_put(pd);
484
485 return ret;
486}
487device_initcall(add_pcspkr);
488
465void probe_machine(void) 489void probe_machine(void)
466{ 490{
467 extern struct machdep_calls __machine_desc_start; 491 extern struct machdep_calls __machine_desc_start;
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index a72bf5dceeee..69ac25701344 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -50,7 +50,6 @@
50#include <asm/kgdb.h> 50#include <asm/kgdb.h>
51#endif 51#endif
52 52
53extern void platform_init(void);
54extern void bootx_init(unsigned long r4, unsigned long phys); 53extern void bootx_init(unsigned long r4, unsigned long phys);
55 54
56boot_infos_t *boot_infos; 55boot_infos_t *boot_infos;
@@ -138,12 +137,7 @@ void __init machine_init(unsigned long dt_ptr, unsigned long phys)
138 strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line)); 137 strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
139#endif /* CONFIG_CMDLINE */ 138#endif /* CONFIG_CMDLINE */
140 139
141#ifdef CONFIG_PPC_MULTIPLATFORM
142 probe_machine(); 140 probe_machine();
143#else
144 /* Base init based on machine type. Obsoloete, please kill ! */
145 platform_init();
146#endif
147 141
148#ifdef CONFIG_6xx 142#ifdef CONFIG_6xx
149 if (cpu_has_feature(CPU_FTR_CAN_DOZE) || 143 if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 59aa92cd6fa4..13e91c4d70a8 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -215,12 +215,10 @@ void __init early_setup(unsigned long dt_ptr)
215 /* 215 /*
216 * Initialize stab / SLB management except on iSeries 216 * Initialize stab / SLB management except on iSeries
217 */ 217 */
218 if (!firmware_has_feature(FW_FEATURE_ISERIES)) { 218 if (cpu_has_feature(CPU_FTR_SLB))
219 if (cpu_has_feature(CPU_FTR_SLB)) 219 slb_initialize();
220 slb_initialize(); 220 else if (!firmware_has_feature(FW_FEATURE_ISERIES))
221 else 221 stab_initialize(get_paca()->stab_real);
222 stab_initialize(get_paca()->stab_real);
223 }
224 222
225 DBG(" <- early_setup()\n"); 223 DBG(" <- early_setup()\n");
226} 224}
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index 1ad55f0466fd..1424eab450ee 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -322,3 +322,4 @@ SYSCALL(spu_create)
322COMPAT_SYS(pselect6) 322COMPAT_SYS(pselect6)
323COMPAT_SYS(ppoll) 323COMPAT_SYS(ppoll)
324SYSCALL(unshare) 324SYSCALL(unshare)
325SYSCALL(splice)
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 4cbde211eb69..064a52564692 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -228,7 +228,7 @@ void system_reset_exception(struct pt_regs *regs)
228 */ 228 */
229static inline int check_io_access(struct pt_regs *regs) 229static inline int check_io_access(struct pt_regs *regs)
230{ 230{
231#ifdef CONFIG_PPC_PMAC 231#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
232 unsigned long msr = regs->msr; 232 unsigned long msr = regs->msr;
233 const struct exception_table_entry *entry; 233 const struct exception_table_entry *entry;
234 unsigned int *nip = (unsigned int *)regs->nip; 234 unsigned int *nip = (unsigned int *)regs->nip;
@@ -261,7 +261,7 @@ static inline int check_io_access(struct pt_regs *regs)
261 return 1; 261 return 1;
262 } 262 }
263 } 263 }
264#endif /* CONFIG_PPC_PMAC */ 264#endif /* CONFIG_PPC_PMAC && CONFIG_PPC32 */
265 return 0; 265 return 0;
266} 266}
267 267
@@ -308,8 +308,8 @@ platform_machine_check(struct pt_regs *regs)
308 308
309void machine_check_exception(struct pt_regs *regs) 309void machine_check_exception(struct pt_regs *regs)
310{ 310{
311#ifdef CONFIG_PPC64
312 int recover = 0; 311 int recover = 0;
312 unsigned long reason = get_mc_reason(regs);
313 313
314 /* See if any machine dependent calls */ 314 /* See if any machine dependent calls */
315 if (ppc_md.machine_check_exception) 315 if (ppc_md.machine_check_exception)
@@ -317,8 +317,6 @@ void machine_check_exception(struct pt_regs *regs)
317 317
318 if (recover) 318 if (recover)
319 return; 319 return;
320#else
321 unsigned long reason = get_mc_reason(regs);
322 320
323 if (user_mode(regs)) { 321 if (user_mode(regs)) {
324 regs->msr |= MSR_RI; 322 regs->msr |= MSR_RI;
@@ -462,7 +460,6 @@ void machine_check_exception(struct pt_regs *regs)
462 * additional info, e.g. bus error registers. 460 * additional info, e.g. bus error registers.
463 */ 461 */
464 platform_machine_check(regs); 462 platform_machine_check(regs);
465#endif /* CONFIG_PPC64 */
466 463
467 if (debugger_fault_handler(regs)) 464 if (debugger_fault_handler(regs))
468 return; 465 return;
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 5aea0909a5ec..fdbba4206d59 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -177,15 +177,15 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
177 177
178 /* When running in the kernel we expect faults to occur only to 178 /* When running in the kernel we expect faults to occur only to
179 * addresses in user space. All other faults represent errors in the 179 * addresses in user space. All other faults represent errors in the
180 * kernel and should generate an OOPS. Unfortunatly, in the case of an 180 * kernel and should generate an OOPS. Unfortunately, in the case of an
181 * erroneous fault occuring in a code path which already holds mmap_sem 181 * erroneous fault occurring in a code path which already holds mmap_sem
182 * we will deadlock attempting to validate the fault against the 182 * we will deadlock attempting to validate the fault against the
183 * address space. Luckily the kernel only validly references user 183 * address space. Luckily the kernel only validly references user
184 * space from well defined areas of code, which are listed in the 184 * space from well defined areas of code, which are listed in the
185 * exceptions table. 185 * exceptions table.
186 * 186 *
187 * As the vast majority of faults will be valid we will only perform 187 * As the vast majority of faults will be valid we will only perform
188 * the source reference check when there is a possibilty of a deadlock. 188 * the source reference check when there is a possibility of a deadlock.
189 * Attempt to lock the address space, if we cannot we then validate the 189 * Attempt to lock the address space, if we cannot we then validate the
190 * source. If this is invalid we can skip the address space check, 190 * source. If this is invalid we can skip the address space check,
191 * thus avoiding the deadlock. 191 * thus avoiding the deadlock.
diff --git a/arch/powerpc/platforms/83xx/mpc834x_sys.c b/arch/powerpc/platforms/83xx/mpc834x_sys.c
index 7c18b4cd5db4..7e789d2420ba 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_sys.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_sys.c
@@ -158,25 +158,25 @@ static int __init mpc834x_rtc_hookup(void)
158late_initcall(mpc834x_rtc_hookup); 158late_initcall(mpc834x_rtc_hookup);
159#endif 159#endif
160 160
161void __init platform_init(void) 161/*
162 * Called very early, MMU is off, device-tree isn't unflattened
163 */
164static int __init mpc834x_sys_probe(void)
162{ 165{
163 /* setup the PowerPC module struct */ 166 /* We always match for now, eventually we should look at the flat
164 ppc_md.setup_arch = mpc834x_sys_setup_arch; 167 dev tree to ensure this is the board we are suppose to run on
165 168 */
166 ppc_md.init_IRQ = mpc834x_sys_init_IRQ; 169 return 1;
167 ppc_md.get_irq = ipic_get_irq;
168
169 ppc_md.restart = mpc83xx_restart;
170
171 ppc_md.time_init = mpc83xx_time_init;
172 ppc_md.set_rtc_time = NULL;
173 ppc_md.get_rtc_time = NULL;
174 ppc_md.calibrate_decr = generic_calibrate_decr;
175
176 ppc_md.progress = udbg_progress;
177
178 if (ppc_md.progress)
179 ppc_md.progress("mpc834x_sys_init(): exit", 0);
180
181 return;
182} 170}
171
172define_machine(mpc834x_sys) {
173 .name = "MPC834x SYS",
174 .probe = mpc834x_sys_probe,
175 .setup_arch = mpc834x_sys_setup_arch,
176 .init_IRQ = mpc834x_sys_init_IRQ,
177 .get_irq = ipic_get_irq,
178 .restart = mpc83xx_restart,
179 .time_init = mpc83xx_time_init,
180 .calibrate_decr = generic_calibrate_decr,
181 .progress = udbg_progress,
182};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index b7821dbae00d..5eeff370f5fc 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -220,25 +220,25 @@ void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
220 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024)); 220 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
221} 221}
222 222
223void __init platform_init(void) 223/*
224 * Called very early, device-tree isn't unflattened
225 */
226static int __init mpc85xx_ads_probe(void)
224{ 227{
225 ppc_md.setup_arch = mpc85xx_ads_setup_arch; 228 /* We always match for now, eventually we should look at the flat
226 ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo; 229 dev tree to ensure this is the board we are suppose to run on
227 230 */
228 ppc_md.init_IRQ = mpc85xx_ads_pic_init; 231 return 1;
229 ppc_md.get_irq = mpic_get_irq;
230
231 ppc_md.restart = mpc85xx_restart;
232 ppc_md.power_off = NULL;
233 ppc_md.halt = NULL;
234
235 ppc_md.time_init = NULL;
236 ppc_md.set_rtc_time = NULL;
237 ppc_md.get_rtc_time = NULL;
238 ppc_md.calibrate_decr = generic_calibrate_decr;
239
240 ppc_md.progress = udbg_progress;
241
242 if (ppc_md.progress)
243 ppc_md.progress("mpc85xx_ads platform_init(): exit", 0);
244} 232}
233
234define_machine(mpc85xx_ads) {
235 .name = "MPC85xx ADS",
236 .probe = mpc85xx_ads_probe,
237 .setup_arch = mpc85xx_ads_setup_arch,
238 .init_IRQ = mpc85xx_ads_pic_init,
239 .show_cpuinfo = mpc85xx_ads_show_cpuinfo,
240 .get_irq = mpic_get_irq,
241 .restart = mpc85xx_restart,
242 .calibrate_decr = generic_calibrate_decr,
243 .progress = udbg_progress,
244};
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 3a4245c926ad..6594bec73882 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -316,6 +316,7 @@ void *spu_syscall_table[] = {
316 [__NR_pselect6] sys_ni_syscall, /* sys_pselect */ 316 [__NR_pselect6] sys_ni_syscall, /* sys_pselect */
317 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */ 317 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */
318 [__NR_unshare] sys_unshare, 318 [__NR_unshare] sys_unshare,
319 [__NR_splice] sys_splice,
319}; 320};
320 321
321long spu_sys_callback(struct spu_syscall_block *s) 322long spu_sys_callback(struct spu_syscall_block *s)
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index c04e078c0fe5..483c8b76232c 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -2,6 +2,7 @@
2#include <linux/ptrace.h> 2#include <linux/ptrace.h>
3 3
4#include <asm/spu.h> 4#include <asm/spu.h>
5#include <asm/unistd.h>
5 6
6#include "spufs.h" 7#include "spufs.h"
7 8
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 9b2b1cb117b3..780fb27a0099 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -865,7 +865,7 @@ void __init eeh_init(void)
865 * on the CEC architecture, type of the device, on earlier boot 865 * on the CEC architecture, type of the device, on earlier boot
866 * command-line arguments & etc. 866 * command-line arguments & etc.
867 */ 867 */
868void eeh_add_device_early(struct device_node *dn) 868static void eeh_add_device_early(struct device_node *dn)
869{ 869{
870 struct pci_controller *phb; 870 struct pci_controller *phb;
871 struct eeh_early_enable_info info; 871 struct eeh_early_enable_info info;
@@ -882,7 +882,6 @@ void eeh_add_device_early(struct device_node *dn)
882 info.buid_lo = BUID_LO(phb->buid); 882 info.buid_lo = BUID_LO(phb->buid);
883 early_enable_eeh(dn, &info); 883 early_enable_eeh(dn, &info);
884} 884}
885EXPORT_SYMBOL_GPL(eeh_add_device_early);
886 885
887void eeh_add_device_tree_early(struct device_node *dn) 886void eeh_add_device_tree_early(struct device_node *dn)
888{ 887{
@@ -893,20 +892,6 @@ void eeh_add_device_tree_early(struct device_node *dn)
893} 892}
894EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); 893EXPORT_SYMBOL_GPL(eeh_add_device_tree_early);
895 894
896void eeh_add_device_tree_late(struct pci_bus *bus)
897{
898 struct pci_dev *dev;
899
900 list_for_each_entry(dev, &bus->devices, bus_list) {
901 eeh_add_device_late(dev);
902 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
903 struct pci_bus *subbus = dev->subordinate;
904 if (subbus)
905 eeh_add_device_tree_late(subbus);
906 }
907 }
908}
909
910/** 895/**
911 * eeh_add_device_late - perform EEH initialization for the indicated pci device 896 * eeh_add_device_late - perform EEH initialization for the indicated pci device
912 * @dev: pci device for which to set up EEH 897 * @dev: pci device for which to set up EEH
@@ -914,7 +899,7 @@ void eeh_add_device_tree_late(struct pci_bus *bus)
914 * This routine must be used to complete EEH initialization for PCI 899 * This routine must be used to complete EEH initialization for PCI
915 * devices that were added after system boot (e.g. hotplug, dlpar). 900 * devices that were added after system boot (e.g. hotplug, dlpar).
916 */ 901 */
917void eeh_add_device_late(struct pci_dev *dev) 902static void eeh_add_device_late(struct pci_dev *dev)
918{ 903{
919 struct device_node *dn; 904 struct device_node *dn;
920 struct pci_dn *pdn; 905 struct pci_dn *pdn;
@@ -933,16 +918,33 @@ void eeh_add_device_late(struct pci_dev *dev)
933 918
934 pci_addr_cache_insert_device (dev); 919 pci_addr_cache_insert_device (dev);
935} 920}
936EXPORT_SYMBOL_GPL(eeh_add_device_late); 921
922void eeh_add_device_tree_late(struct pci_bus *bus)
923{
924 struct pci_dev *dev;
925
926 list_for_each_entry(dev, &bus->devices, bus_list) {
927 eeh_add_device_late(dev);
928 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
929 struct pci_bus *subbus = dev->subordinate;
930 if (subbus)
931 eeh_add_device_tree_late(subbus);
932 }
933 }
934}
935EXPORT_SYMBOL_GPL(eeh_add_device_tree_late);
937 936
938/** 937/**
939 * eeh_remove_device - undo EEH setup for the indicated pci device 938 * eeh_remove_device - undo EEH setup for the indicated pci device
940 * @dev: pci device to be removed 939 * @dev: pci device to be removed
941 * 940 *
942 * This routine should be when a device is removed from a running 941 * This routine should be called when a device is removed from
943 * system (e.g. by hotplug or dlpar). 942 * a running system (e.g. by hotplug or dlpar). It unregisters
943 * the PCI device from the EEH subsystem. I/O errors affecting
944 * this device will no longer be detected after this call; thus,
945 * i/o errors affecting this slot may leave this device unusable.
944 */ 946 */
945void eeh_remove_device(struct pci_dev *dev) 947static void eeh_remove_device(struct pci_dev *dev)
946{ 948{
947 struct device_node *dn; 949 struct device_node *dn;
948 if (!dev || !eeh_subsystem_enabled) 950 if (!dev || !eeh_subsystem_enabled)
@@ -958,21 +960,17 @@ void eeh_remove_device(struct pci_dev *dev)
958 PCI_DN(dn)->pcidev = NULL; 960 PCI_DN(dn)->pcidev = NULL;
959 pci_dev_put (dev); 961 pci_dev_put (dev);
960} 962}
961EXPORT_SYMBOL_GPL(eeh_remove_device);
962 963
963void eeh_remove_bus_device(struct pci_dev *dev) 964void eeh_remove_bus_device(struct pci_dev *dev)
964{ 965{
966 struct pci_bus *bus = dev->subordinate;
967 struct pci_dev *child, *tmp;
968
965 eeh_remove_device(dev); 969 eeh_remove_device(dev);
966 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 970
967 struct pci_bus *bus = dev->subordinate; 971 if (bus && dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
968 struct list_head *ln; 972 list_for_each_entry_safe(child, tmp, &bus->devices, bus_list)
969 if (!bus) 973 eeh_remove_bus_device(child);
970 return;
971 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
972 struct pci_dev *pdev = pci_dev_b(ln);
973 if (pdev)
974 eeh_remove_bus_device(pdev);
975 }
976 } 974 }
977} 975}
978EXPORT_SYMBOL_GPL(eeh_remove_bus_device); 976EXPORT_SYMBOL_GPL(eeh_remove_bus_device);
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index cc2495a0cdd5..1fba695e32e8 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -293,15 +293,16 @@ void handle_eeh_events (struct eeh_event *event)
293 frozen_pdn = PCI_DN(frozen_dn); 293 frozen_pdn = PCI_DN(frozen_dn);
294 frozen_pdn->eeh_freeze_count++; 294 frozen_pdn->eeh_freeze_count++;
295 295
296 pci_str = pci_name (frozen_pdn->pcidev); 296 if (frozen_pdn->pcidev) {
297 drv_str = pcid_name (frozen_pdn->pcidev); 297 pci_str = pci_name (frozen_pdn->pcidev);
298 if (!pci_str) { 298 drv_str = pcid_name (frozen_pdn->pcidev);
299 } else {
299 pci_str = pci_name (event->dev); 300 pci_str = pci_name (event->dev);
300 drv_str = pcid_name (event->dev); 301 drv_str = pcid_name (event->dev);
301 } 302 }
302 303
303 if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES) 304 if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
304 goto hard_fail; 305 goto excess_failures;
305 306
306 /* If the reset state is a '5' and the time to reset is 0 (infinity) 307 /* If the reset state is a '5' and the time to reset is 0 (infinity)
307 * or is more then 15 seconds, then mark this as a permanent failure. 308 * or is more then 15 seconds, then mark this as a permanent failure.
@@ -356,7 +357,7 @@ void handle_eeh_events (struct eeh_event *event)
356 357
357 return; 358 return;
358 359
359hard_fail: 360excess_failures:
360 /* 361 /*
361 * About 90% of all real-life EEH failures in the field 362 * About 90% of all real-life EEH failures in the field
362 * are due to poorly seated PCI cards. Only 10% or so are 363 * are due to poorly seated PCI cards. Only 10% or so are
@@ -367,7 +368,15 @@ hard_fail:
367 "and has been permanently disabled. Please try reseating\n" 368 "and has been permanently disabled. Please try reseating\n"
368 "this device or replacing it.\n", 369 "this device or replacing it.\n",
369 drv_str, pci_str, frozen_pdn->eeh_freeze_count); 370 drv_str, pci_str, frozen_pdn->eeh_freeze_count);
371 goto perm_error;
372
373hard_fail:
374 printk(KERN_ERR
375 "EEH: Unable to recover from failure of PCI device %s - %s\n"
376 "Please try reseating this device or replacing it.\n",
377 drv_str, pci_str);
370 378
379perm_error:
371 eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */); 380 eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */);
372 381
373 /* Notify all devices that they're about to go down. */ 382 /* Notify all devices that they're about to go down. */
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c
index 9a9961f27480..a1bda6f96fd1 100644
--- a/arch/powerpc/platforms/pseries/eeh_event.c
+++ b/arch/powerpc/platforms/pseries/eeh_event.c
@@ -19,7 +19,9 @@
19 */ 19 */
20 20
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/mutex.h>
22#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/workqueue.h>
23#include <asm/eeh_event.h> 25#include <asm/eeh_event.h>
24#include <asm/ppc-pci.h> 26#include <asm/ppc-pci.h>
25 27
@@ -37,14 +39,18 @@ LIST_HEAD(eeh_eventlist);
37static void eeh_thread_launcher(void *); 39static void eeh_thread_launcher(void *);
38DECLARE_WORK(eeh_event_wq, eeh_thread_launcher, NULL); 40DECLARE_WORK(eeh_event_wq, eeh_thread_launcher, NULL);
39 41
42/* Serialize reset sequences for a given pci device */
43DEFINE_MUTEX(eeh_event_mutex);
44
40/** 45/**
41 * eeh_event_handler - dispatch EEH events. The detection of a frozen 46 * eeh_event_handler - dispatch EEH events.
42 * slot can occur inside an interrupt, where it can be hard to do
43 * anything about it. The goal of this routine is to pull these
44 * detection events out of the context of the interrupt handler, and
45 * re-dispatch them for processing at a later time in a normal context.
46 *
47 * @dummy - unused 47 * @dummy - unused
48 *
49 * The detection of a frozen slot can occur inside an interrupt,
50 * where it can be hard to do anything about it. The goal of this
51 * routine is to pull these detection events out of the context
52 * of the interrupt handler, and re-dispatch them for processing
53 * at a later time in a normal context.
48 */ 54 */
49static int eeh_event_handler(void * dummy) 55static int eeh_event_handler(void * dummy)
50{ 56{
@@ -64,23 +70,24 @@ static int eeh_event_handler(void * dummy)
64 event = list_entry(eeh_eventlist.next, struct eeh_event, list); 70 event = list_entry(eeh_eventlist.next, struct eeh_event, list);
65 list_del(&event->list); 71 list_del(&event->list);
66 } 72 }
67
68 if (event)
69 eeh_mark_slot(event->dn, EEH_MODE_RECOVERING);
70
71 spin_unlock_irqrestore(&eeh_eventlist_lock, flags); 73 spin_unlock_irqrestore(&eeh_eventlist_lock, flags);
74
72 if (event == NULL) 75 if (event == NULL)
73 break; 76 break;
74 77
78 /* Serialize processing of EEH events */
79 mutex_lock(&eeh_event_mutex);
80 eeh_mark_slot(event->dn, EEH_MODE_RECOVERING);
81
75 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", 82 printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n",
76 pci_name(event->dev)); 83 pci_name(event->dev));
77 84
78 handle_eeh_events(event); 85 handle_eeh_events(event);
79 86
80 eeh_clear_slot(event->dn, EEH_MODE_RECOVERING); 87 eeh_clear_slot(event->dn, EEH_MODE_RECOVERING);
81
82 pci_dev_put(event->dev); 88 pci_dev_put(event->dev);
83 kfree(event); 89 kfree(event);
90 mutex_unlock(&eeh_event_mutex);
84 } 91 }
85 92
86 return 0; 93 return 0;
@@ -88,7 +95,6 @@ static int eeh_event_handler(void * dummy)
88 95
89/** 96/**
90 * eeh_thread_launcher 97 * eeh_thread_launcher
91 *
92 * @dummy - unused 98 * @dummy - unused
93 */ 99 */
94static void eeh_thread_launcher(void *dummy) 100static void eeh_thread_launcher(void *dummy)
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index db7c19fe9297..c9ff547f9d25 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -127,3 +127,103 @@ _GLOBAL(plpar_hcall_4out)
127 127
128 mtcrf 0xff,r0 128 mtcrf 0xff,r0
129 blr /* return r3 = status */ 129 blr /* return r3 = status */
130
131/* plpar_hcall_7arg_7ret(unsigned long opcode, R3
132 unsigned long arg1, R4
133 unsigned long arg2, R5
134 unsigned long arg3, R6
135 unsigned long arg4, R7
136 unsigned long arg5, R8
137 unsigned long arg6, R9
138 unsigned long arg7, R10
139 unsigned long *out1, 112(R1)
140 unsigned long *out2, 110(R1)
141 unsigned long *out3, 108(R1)
142 unsigned long *out4, 106(R1)
143 unsigned long *out5, 104(R1)
144 unsigned long *out6, 102(R1)
145 unsigned long *out7); 100(R1)
146*/
147_GLOBAL(plpar_hcall_7arg_7ret)
148 HMT_MEDIUM
149
150 mfcr r0
151 stw r0,8(r1)
152
153 HVSC /* invoke the hypervisor */
154
155 lwz r0,8(r1)
156
157 ld r11,STK_PARM(r11)(r1) /* Fetch r4 ret arg */
158 std r4,0(r11)
159 ld r11,STK_PARM(r12)(r1) /* Fetch r5 ret arg */
160 std r5,0(r11)
161 ld r11,STK_PARM(r13)(r1) /* Fetch r6 ret arg */
162 std r6,0(r11)
163 ld r11,STK_PARM(r14)(r1) /* Fetch r7 ret arg */
164 std r7,0(r11)
165 ld r11,STK_PARM(r15)(r1) /* Fetch r8 ret arg */
166 std r8,0(r11)
167 ld r11,STK_PARM(r16)(r1) /* Fetch r9 ret arg */
168 std r9,0(r11)
169 ld r11,STK_PARM(r17)(r1) /* Fetch r10 ret arg */
170 std r10,0(r11)
171
172 mtcrf 0xff,r0
173
174 blr /* return r3 = status */
175
176/* plpar_hcall_9arg_9ret(unsigned long opcode, R3
177 unsigned long arg1, R4
178 unsigned long arg2, R5
179 unsigned long arg3, R6
180 unsigned long arg4, R7
181 unsigned long arg5, R8
182 unsigned long arg6, R9
183 unsigned long arg7, R10
184 unsigned long arg8, 112(R1)
185 unsigned long arg9, 110(R1)
186 unsigned long *out1, 108(R1)
187 unsigned long *out2, 106(R1)
188 unsigned long *out3, 104(R1)
189 unsigned long *out4, 102(R1)
190 unsigned long *out5, 100(R1)
191 unsigned long *out6, 98(R1)
192 unsigned long *out7); 96(R1)
193 unsigned long *out8, 94(R1)
194 unsigned long *out9, 92(R1)
195*/
196_GLOBAL(plpar_hcall_9arg_9ret)
197 HMT_MEDIUM
198
199 mfcr r0
200 stw r0,8(r1)
201
202 ld r11,STK_PARM(r11)(r1) /* put arg8 in R11 */
203 ld r12,STK_PARM(r12)(r1) /* put arg9 in R12 */
204
205 HVSC /* invoke the hypervisor */
206
207 ld r0,STK_PARM(r13)(r1) /* Fetch r4 ret arg */
208 stdx r4,r0,r0
209 ld r0,STK_PARM(r14)(r1) /* Fetch r5 ret arg */
210 stdx r5,r0,r0
211 ld r0,STK_PARM(r15)(r1) /* Fetch r6 ret arg */
212 stdx r6,r0,r0
213 ld r0,STK_PARM(r16)(r1) /* Fetch r7 ret arg */
214 stdx r7,r0,r0
215 ld r0,STK_PARM(r17)(r1) /* Fetch r8 ret arg */
216 stdx r8,r0,r0
217 ld r0,STK_PARM(r18)(r1) /* Fetch r9 ret arg */
218 stdx r9,r0,r0
219 ld r0,STK_PARM(r19)(r1) /* Fetch r10 ret arg */
220 stdx r10,r0,r0
221 ld r0,STK_PARM(r20)(r1) /* Fetch r11 ret arg */
222 stdx r11,r0,r0
223 ld r0,STK_PARM(r21)(r1) /* Fetch r12 ret arg */
224 stdx r12,r0,r0
225
226 lwz r0,8(r1)
227 mtcrf 0xff,r0
228
229 blr /* return r3 = status */
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c
index ba6befd96636..a72a987f1d4d 100644
--- a/arch/powerpc/platforms/pseries/hvconsole.c
+++ b/arch/powerpc/platforms/pseries/hvconsole.c
@@ -41,7 +41,7 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count)
41 unsigned long got; 41 unsigned long got;
42 42
43 if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got, 43 if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
44 (unsigned long *)buf, (unsigned long *)buf+1) == H_Success) 44 (unsigned long *)buf, (unsigned long *)buf+1) == H_SUCCESS)
45 return got; 45 return got;
46 return 0; 46 return 0;
47} 47}
@@ -69,9 +69,9 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
69 69
70 ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0], 70 ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
71 lbuf[1]); 71 lbuf[1]);
72 if (ret == H_Success) 72 if (ret == H_SUCCESS)
73 return count; 73 return count;
74 if (ret == H_Busy) 74 if (ret == H_BUSY)
75 return 0; 75 return 0;
76 return -EIO; 76 return -EIO;
77} 77}
diff --git a/arch/powerpc/platforms/pseries/hvcserver.c b/arch/powerpc/platforms/pseries/hvcserver.c
index 22bfb5c89db9..fcf4b4cbeaf3 100644
--- a/arch/powerpc/platforms/pseries/hvcserver.c
+++ b/arch/powerpc/platforms/pseries/hvcserver.c
@@ -43,21 +43,21 @@ MODULE_VERSION(HVCS_ARCH_VERSION);
43static int hvcs_convert(long to_convert) 43static int hvcs_convert(long to_convert)
44{ 44{
45 switch (to_convert) { 45 switch (to_convert) {
46 case H_Success: 46 case H_SUCCESS:
47 return 0; 47 return 0;
48 case H_Parameter: 48 case H_PARAMETER:
49 return -EINVAL; 49 return -EINVAL;
50 case H_Hardware: 50 case H_HARDWARE:
51 return -EIO; 51 return -EIO;
52 case H_Busy: 52 case H_BUSY:
53 case H_LongBusyOrder1msec: 53 case H_LONG_BUSY_ORDER_1_MSEC:
54 case H_LongBusyOrder10msec: 54 case H_LONG_BUSY_ORDER_10_MSEC:
55 case H_LongBusyOrder100msec: 55 case H_LONG_BUSY_ORDER_100_MSEC:
56 case H_LongBusyOrder1sec: 56 case H_LONG_BUSY_ORDER_1_SEC:
57 case H_LongBusyOrder10sec: 57 case H_LONG_BUSY_ORDER_10_SEC:
58 case H_LongBusyOrder100sec: 58 case H_LONG_BUSY_ORDER_100_SEC:
59 return -EBUSY; 59 return -EBUSY;
60 case H_Function: /* fall through */ 60 case H_FUNCTION: /* fall through */
61 default: 61 default:
62 return -EPERM; 62 return -EPERM;
63 } 63 }
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8952528d31ac..634b7d06d3cc 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -54,7 +54,8 @@ EXPORT_SYMBOL(plpar_hcall);
54EXPORT_SYMBOL(plpar_hcall_4out); 54EXPORT_SYMBOL(plpar_hcall_4out);
55EXPORT_SYMBOL(plpar_hcall_norets); 55EXPORT_SYMBOL(plpar_hcall_norets);
56EXPORT_SYMBOL(plpar_hcall_8arg_2ret); 56EXPORT_SYMBOL(plpar_hcall_8arg_2ret);
57 57EXPORT_SYMBOL(plpar_hcall_7arg_7ret);
58EXPORT_SYMBOL(plpar_hcall_9arg_9ret);
58extern void pSeries_find_serial_port(void); 59extern void pSeries_find_serial_port(void);
59 60
60 61
@@ -72,7 +73,7 @@ static void udbg_hvsi_putc(char c)
72 73
73 do { 74 do {
74 rc = plpar_put_term_char(vtermno, sizeof(packet), packet); 75 rc = plpar_put_term_char(vtermno, sizeof(packet), packet);
75 } while (rc == H_Busy); 76 } while (rc == H_BUSY);
76} 77}
77 78
78static long hvsi_udbg_buf_len; 79static long hvsi_udbg_buf_len;
@@ -85,7 +86,7 @@ static int udbg_hvsi_getc_poll(void)
85 86
86 if (hvsi_udbg_buf_len == 0) { 87 if (hvsi_udbg_buf_len == 0) {
87 rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf); 88 rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf);
88 if (rc != H_Success || hvsi_udbg_buf[0] != 0xff) { 89 if (rc != H_SUCCESS || hvsi_udbg_buf[0] != 0xff) {
89 /* bad read or non-data packet */ 90 /* bad read or non-data packet */
90 hvsi_udbg_buf_len = 0; 91 hvsi_udbg_buf_len = 0;
91 } else { 92 } else {
@@ -139,7 +140,7 @@ static void udbg_putcLP(char c)
139 buf[0] = c; 140 buf[0] = c;
140 do { 141 do {
141 rc = plpar_put_term_char(vtermno, 1, buf); 142 rc = plpar_put_term_char(vtermno, 1, buf);
142 } while(rc == H_Busy); 143 } while(rc == H_BUSY);
143} 144}
144 145
145/* Buffered chars getc */ 146/* Buffered chars getc */
@@ -158,7 +159,7 @@ static int udbg_getc_pollLP(void)
158 /* get some more chars. */ 159 /* get some more chars. */
159 inbuflen = 0; 160 inbuflen = 0;
160 rc = plpar_get_term_char(vtermno, &inbuflen, buf); 161 rc = plpar_get_term_char(vtermno, &inbuflen, buf);
161 if (rc != H_Success) 162 if (rc != H_SUCCESS)
162 inbuflen = 0; /* otherwise inbuflen is garbage */ 163 inbuflen = 0; /* otherwise inbuflen is garbage */
163 } 164 }
164 if (inbuflen <= 0 || inbuflen > 16) { 165 if (inbuflen <= 0 || inbuflen > 16) {
@@ -304,7 +305,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
304 305
305 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v, 306 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
306 hpte_r, &slot, &dummy0, &dummy1); 307 hpte_r, &slot, &dummy0, &dummy1);
307 if (unlikely(lpar_rc == H_PTEG_Full)) { 308 if (unlikely(lpar_rc == H_PTEG_FULL)) {
308 if (!(vflags & HPTE_V_BOLTED)) 309 if (!(vflags & HPTE_V_BOLTED))
309 DBG_LOW(" full\n"); 310 DBG_LOW(" full\n");
310 return -1; 311 return -1;
@@ -315,7 +316,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
315 * will fail. However we must catch the failure in hash_page 316 * will fail. However we must catch the failure in hash_page
316 * or we will loop forever, so return -2 in this case. 317 * or we will loop forever, so return -2 in this case.
317 */ 318 */
318 if (unlikely(lpar_rc != H_Success)) { 319 if (unlikely(lpar_rc != H_SUCCESS)) {
319 if (!(vflags & HPTE_V_BOLTED)) 320 if (!(vflags & HPTE_V_BOLTED))
320 DBG_LOW(" lpar err %d\n", lpar_rc); 321 DBG_LOW(" lpar err %d\n", lpar_rc);
321 return -2; 322 return -2;
@@ -346,9 +347,9 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
346 /* don't remove a bolted entry */ 347 /* don't remove a bolted entry */
347 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset, 348 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
348 (0x1UL << 4), &dummy1, &dummy2); 349 (0x1UL << 4), &dummy1, &dummy2);
349 if (lpar_rc == H_Success) 350 if (lpar_rc == H_SUCCESS)
350 return i; 351 return i;
351 BUG_ON(lpar_rc != H_Not_Found); 352 BUG_ON(lpar_rc != H_NOT_FOUND);
352 353
353 slot_offset++; 354 slot_offset++;
354 slot_offset &= 0x7; 355 slot_offset &= 0x7;
@@ -391,14 +392,14 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
391 392
392 lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN); 393 lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
393 394
394 if (lpar_rc == H_Not_Found) { 395 if (lpar_rc == H_NOT_FOUND) {
395 DBG_LOW("not found !\n"); 396 DBG_LOW("not found !\n");
396 return -1; 397 return -1;
397 } 398 }
398 399
399 DBG_LOW("ok\n"); 400 DBG_LOW("ok\n");
400 401
401 BUG_ON(lpar_rc != H_Success); 402 BUG_ON(lpar_rc != H_SUCCESS);
402 403
403 return 0; 404 return 0;
404} 405}
@@ -417,7 +418,7 @@ static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot)
417 418
418 lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1); 419 lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1);
419 420
420 BUG_ON(lpar_rc != H_Success); 421 BUG_ON(lpar_rc != H_SUCCESS);
421 422
422 return dword0; 423 return dword0;
423} 424}
@@ -468,7 +469,7 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
468 flags = newpp & 7; 469 flags = newpp & 7;
469 lpar_rc = plpar_pte_protect(flags, slot, 0); 470 lpar_rc = plpar_pte_protect(flags, slot, 0);
470 471
471 BUG_ON(lpar_rc != H_Success); 472 BUG_ON(lpar_rc != H_SUCCESS);
472} 473}
473 474
474static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, 475static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
@@ -484,10 +485,10 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
484 want_v = hpte_encode_v(va, psize); 485 want_v = hpte_encode_v(va, psize);
485 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN, 486 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN,
486 &dummy1, &dummy2); 487 &dummy1, &dummy2);
487 if (lpar_rc == H_Not_Found) 488 if (lpar_rc == H_NOT_FOUND)
488 return; 489 return;
489 490
490 BUG_ON(lpar_rc != H_Success); 491 BUG_ON(lpar_rc != H_SUCCESS);
491} 492}
492 493
493/* 494/*
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index b2fbf8ba8fbb..5eb55ef1c91c 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -463,7 +463,7 @@ static void pseries_dedicated_idle_sleep(void)
463 * very low priority. The cede enables interrupts, which 463 * very low priority. The cede enables interrupts, which
464 * doesn't matter here. 464 * doesn't matter here.
465 */ 465 */
466 if (!lppaca[cpu ^ 1].idle || poll_pending() == H_Pending) 466 if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
467 cede_processor(); 467 cede_processor();
468 468
469out: 469out:
diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 866379b80c09..8e53e04ada8b 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -258,7 +258,7 @@ EXPORT_SYMBOL(vio_find_node);
258int vio_enable_interrupts(struct vio_dev *dev) 258int vio_enable_interrupts(struct vio_dev *dev)
259{ 259{
260 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE); 260 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
261 if (rc != H_Success) 261 if (rc != H_SUCCESS)
262 printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc); 262 printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
263 return rc; 263 return rc;
264} 264}
@@ -267,7 +267,7 @@ EXPORT_SYMBOL(vio_enable_interrupts);
267int vio_disable_interrupts(struct vio_dev *dev) 267int vio_disable_interrupts(struct vio_dev *dev)
268{ 268{
269 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE); 269 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
270 if (rc != H_Success) 270 if (rc != H_SUCCESS)
271 printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc); 271 printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
272 return rc; 272 return rc;
273} 273}
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 4864cb32be25..2d60ea30fed6 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -168,7 +168,7 @@ static int pSeriesLP_xirr_info_get(int n_cpu)
168 unsigned long return_value; 168 unsigned long return_value;
169 169
170 lpar_rc = plpar_xirr(&return_value); 170 lpar_rc = plpar_xirr(&return_value);
171 if (lpar_rc != H_Success) 171 if (lpar_rc != H_SUCCESS)
172 panic(" bad return code xirr - rc = %lx \n", lpar_rc); 172 panic(" bad return code xirr - rc = %lx \n", lpar_rc);
173 return (int)return_value; 173 return (int)return_value;
174} 174}
@@ -179,7 +179,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
179 unsigned long val64 = value & 0xffffffff; 179 unsigned long val64 = value & 0xffffffff;
180 180
181 lpar_rc = plpar_eoi(val64); 181 lpar_rc = plpar_eoi(val64);
182 if (lpar_rc != H_Success) 182 if (lpar_rc != H_SUCCESS)
183 panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc, 183 panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
184 val64); 184 val64);
185} 185}
@@ -189,7 +189,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value)
189 unsigned long lpar_rc; 189 unsigned long lpar_rc;
190 190
191 lpar_rc = plpar_cppr(value); 191 lpar_rc = plpar_cppr(value);
192 if (lpar_rc != H_Success) 192 if (lpar_rc != H_SUCCESS)
193 panic("bad return code cppr - rc = %lx\n", lpar_rc); 193 panic("bad return code cppr - rc = %lx\n", lpar_rc);
194} 194}
195 195
@@ -198,7 +198,7 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value)
198 unsigned long lpar_rc; 198 unsigned long lpar_rc;
199 199
200 lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value); 200 lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
201 if (lpar_rc != H_Success) 201 if (lpar_rc != H_SUCCESS)
202 panic("bad return code qirr - rc = %lx\n", lpar_rc); 202 panic("bad return code qirr - rc = %lx\n", lpar_rc);
203} 203}
204 204
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index 768de64b371f..fbbec5e761c6 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -64,13 +64,13 @@ sys_call_table:
64/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex 64/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex
65/*220*/ .long sys_sigprocmask, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid 65/*220*/ .long sys_sigprocmask, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid
66/*225*/ .long sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16 66/*225*/ .long sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16
67/*230*/ .long sys_select, sys_time, sys_nis_syscall, sys_stime, sys_statfs64 67/*230*/ .long sys_select, sys_time, sys_splice, sys_stime, sys_statfs64
68 /* "We are the Knights of the Forest of Ni!!" */ 68 /* "We are the Knights of the Forest of Ni!!" */
69/*235*/ .long sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall 69/*235*/ .long sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall
70/*240*/ .long sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler 70/*240*/ .long sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler
71/*245*/ .long sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep 71/*245*/ .long sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep
72/*250*/ .long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl 72/*250*/ .long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
73/*255*/ .long sys_nis_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep 73/*255*/ .long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
74/*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun 74/*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
75/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy 75/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy
76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 900fb0b940d8..30389085a359 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16 3# Linux kernel version: 2.6.16
4# Sun Mar 26 14:58:11 2006 4# Fri Mar 31 01:40:57 2006
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -180,6 +180,7 @@ CONFIG_SYN_COOKIES=y
180CONFIG_INET_AH=y 180CONFIG_INET_AH=y
181CONFIG_INET_ESP=y 181CONFIG_INET_ESP=y
182CONFIG_INET_IPCOMP=y 182CONFIG_INET_IPCOMP=y
183CONFIG_INET_XFRM_TUNNEL=y
183CONFIG_INET_TUNNEL=y 184CONFIG_INET_TUNNEL=y
184CONFIG_INET_DIAG=y 185CONFIG_INET_DIAG=y
185CONFIG_INET_TCP_DIAG=y 186CONFIG_INET_TCP_DIAG=y
@@ -203,6 +204,7 @@ CONFIG_IPV6_ROUTE_INFO=y
203CONFIG_INET6_AH=m 204CONFIG_INET6_AH=m
204CONFIG_INET6_ESP=m 205CONFIG_INET6_ESP=m
205CONFIG_INET6_IPCOMP=m 206CONFIG_INET6_IPCOMP=m
207CONFIG_INET6_XFRM_TUNNEL=m
206CONFIG_INET6_TUNNEL=m 208CONFIG_INET6_TUNNEL=m
207CONFIG_IPV6_TUNNEL=m 209CONFIG_IPV6_TUNNEL=m
208# CONFIG_NETFILTER is not set 210# CONFIG_NETFILTER is not set
@@ -308,7 +310,6 @@ CONFIG_BLK_DEV_NBD=m
308# CONFIG_BLK_DEV_SX8 is not set 310# CONFIG_BLK_DEV_SX8 is not set
309CONFIG_BLK_DEV_UB=m 311CONFIG_BLK_DEV_UB=m
310# CONFIG_BLK_DEV_RAM is not set 312# CONFIG_BLK_DEV_RAM is not set
311CONFIG_BLK_DEV_RAM_COUNT=16
312# CONFIG_BLK_DEV_INITRD is not set 313# CONFIG_BLK_DEV_INITRD is not set
313CONFIG_CDROM_PKTCDVD=m 314CONFIG_CDROM_PKTCDVD=m
314CONFIG_CDROM_PKTCDVD_BUFFERS=8 315CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -449,6 +450,7 @@ CONFIG_MD_RAID0=m
449CONFIG_MD_RAID1=m 450CONFIG_MD_RAID1=m
450CONFIG_MD_RAID10=m 451CONFIG_MD_RAID10=m
451CONFIG_MD_RAID5=m 452CONFIG_MD_RAID5=m
453# CONFIG_MD_RAID5_RESHAPE is not set
452CONFIG_MD_RAID6=m 454CONFIG_MD_RAID6=m
453CONFIG_MD_MULTIPATH=m 455CONFIG_MD_MULTIPATH=m
454# CONFIG_MD_FAULTY is not set 456# CONFIG_MD_FAULTY is not set
@@ -741,9 +743,7 @@ CONFIG_I2C_ALGOBIT=y
741# CONFIG_SENSORS_PCF8574 is not set 743# CONFIG_SENSORS_PCF8574 is not set
742# CONFIG_SENSORS_PCA9539 is not set 744# CONFIG_SENSORS_PCA9539 is not set
743# CONFIG_SENSORS_PCF8591 is not set 745# CONFIG_SENSORS_PCF8591 is not set
744# CONFIG_SENSORS_RTC8564 is not set
745# CONFIG_SENSORS_MAX6875 is not set 746# CONFIG_SENSORS_MAX6875 is not set
746# CONFIG_RTC_X1205_I2C is not set
747# CONFIG_I2C_DEBUG_CORE is not set 747# CONFIG_I2C_DEBUG_CORE is not set
748# CONFIG_I2C_DEBUG_ALGO is not set 748# CONFIG_I2C_DEBUG_ALGO is not set
749# CONFIG_I2C_DEBUG_BUS is not set 749# CONFIG_I2C_DEBUG_BUS is not set
@@ -826,6 +826,7 @@ CONFIG_FB_CFB_FILLRECT=y
826CONFIG_FB_CFB_COPYAREA=y 826CONFIG_FB_CFB_COPYAREA=y
827CONFIG_FB_CFB_IMAGEBLIT=y 827CONFIG_FB_CFB_IMAGEBLIT=y
828# CONFIG_FB_MACMODES is not set 828# CONFIG_FB_MACMODES is not set
829# CONFIG_FB_FIRMWARE_EDID is not set
829CONFIG_FB_MODE_HELPERS=y 830CONFIG_FB_MODE_HELPERS=y
830CONFIG_FB_TILEBLITTING=y 831CONFIG_FB_TILEBLITTING=y
831# CONFIG_FB_CIRRUS is not set 832# CONFIG_FB_CIRRUS is not set
@@ -1117,6 +1118,11 @@ CONFIG_USB_HIDDEV=y
1117# 1118#
1118 1119
1119# 1120#
1121# Real Time Clock
1122#
1123# CONFIG_RTC_CLASS is not set
1124
1125#
1120# Misc Linux/SPARC drivers 1126# Misc Linux/SPARC drivers
1121# 1127#
1122CONFIG_SUN_OPENPROMIO=m 1128CONFIG_SUN_OPENPROMIO=m
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 7dc28a484268..8175a6968c6b 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -830,9 +830,16 @@ void smp_call_function_client(int irq, struct pt_regs *regs)
830 830
831static void tsb_sync(void *info) 831static void tsb_sync(void *info)
832{ 832{
833 struct trap_per_cpu *tp = &trap_block[raw_smp_processor_id()];
833 struct mm_struct *mm = info; 834 struct mm_struct *mm = info;
834 835
835 if (current->active_mm == mm) 836 /* It is not valid to test "currrent->active_mm == mm" here.
837 *
838 * The value of "current" is not changed atomically with
839 * switch_mm(). But that's OK, we just need to check the
840 * current cpu's trap block PGD physical address.
841 */
842 if (tp->pgd_paddr == __pa(mm->pgd))
836 tsb_context_switch(mm); 843 tsb_context_switch(mm);
837} 844}
838 845
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index c4a1cef4b1e5..86dd5cb81e09 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -136,6 +136,8 @@ SIGN1(sys32_getpeername, sys_getpeername, %o0)
136SIGN1(sys32_getsockname, sys_getsockname, %o0) 136SIGN1(sys32_getsockname, sys_getsockname, %o0)
137SIGN2(sys32_ioprio_get, sys_ioprio_get, %o0, %o1) 137SIGN2(sys32_ioprio_get, sys_ioprio_get, %o0, %o1)
138SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2) 138SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2)
139SIGN2(sys32_splice, sys_splice, %o0, %o1)
140SIGN2(sys32_sync_file_range, compat_sync_file_range, %o0, %o5)
139 141
140 .globl sys32_mmap2 142 .globl sys32_mmap2
141sys32_mmap2: 143sys32_mmap2:
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 2e906bad56fa..31030bf00f1a 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -1069,3 +1069,11 @@ long sys32_lookup_dcookie(unsigned long cookie_high,
1069 return sys_lookup_dcookie((cookie_high << 32) | cookie_low, 1069 return sys_lookup_dcookie((cookie_high << 32) | cookie_low,
1070 buf, len); 1070 buf, len);
1071} 1071}
1072
1073long compat_sync_file_range(int fd, unsigned long off_high, unsigned long off_low, unsigned long nb_high, unsigned long nb_low, int flags)
1074{
1075 return sys_sync_file_range(fd,
1076 (off_high << 32) | off_low,
1077 (nb_high << 32) | nb_low,
1078 flags);
1079}
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 3b250f2318fd..857b82c82875 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -66,12 +66,12 @@ sys_call_table32:
66 .word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, compat_sys_adjtimex 66 .word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, compat_sys_adjtimex
67/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid 67/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
68 .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16 68 .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
69/*230*/ .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64 69/*230*/ .word sys32_select, compat_sys_time, sys32_splice, compat_sys_stime, compat_sys_statfs64
70 .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall 70 .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall
71/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler 71/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
72 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep 72 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
73/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl 73/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
74 .word sys_ni_syscall, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep 74 .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
75/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun 75/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
76 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy 76 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink 77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
@@ -135,12 +135,12 @@ sys_call_table:
135 .word sys_ipc, sys_nis_syscall, sys_clone, sys_ioprio_get, sys_adjtimex 135 .word sys_ipc, sys_nis_syscall, sys_clone, sys_ioprio_get, sys_adjtimex
136/*220*/ .word sys_nis_syscall, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid 136/*220*/ .word sys_nis_syscall, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid
137 .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid 137 .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid
138/*230*/ .word sys_select, sys_nis_syscall, sys_nis_syscall, sys_stime, sys_statfs64 138/*230*/ .word sys_select, sys_nis_syscall, sys_splice, sys_stime, sys_statfs64
139 .word sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall 139 .word sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall
140/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler 140/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler
141 .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep 141 .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep
142/*250*/ .word sys64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl 142/*250*/ .word sys64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
143 .word sys_ni_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep 143 .word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
144/*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun 144/*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
145 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy 145 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
146/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 146/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 0db2f7d9fab5..6e002aacb961 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -327,8 +327,12 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
327 insn = get_fault_insn(regs, 0); 327 insn = get_fault_insn(regs, 0);
328 if (!insn) 328 if (!insn)
329 goto continue_fault; 329 goto continue_fault;
330 /* All loads, stores and atomics have bits 30 and 31 both set
331 * in the instruction. Bit 21 is set in all stores, but we
332 * have to avoid prefetches which also have bit 21 set.
333 */
330 if ((insn & 0xc0200000) == 0xc0200000 && 334 if ((insn & 0xc0200000) == 0xc0200000 &&
331 (insn & 0x1780000) != 0x1680000) { 335 (insn & 0x01780000) != 0x01680000) {
332 /* Don't bother updating thread struct value, 336 /* Don't bother updating thread struct value,
333 * because update_mmu_cache only cares which tlb 337 * because update_mmu_cache only cares which tlb
334 * the access came from. 338 * the access came from.
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
index 074620d413d4..fbbbebbad8a4 100644
--- a/arch/sparc64/mm/hugetlbpage.c
+++ b/arch/sparc64/mm/hugetlbpage.c
@@ -198,6 +198,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
198 pmd_t *pmd; 198 pmd_t *pmd;
199 pte_t *pte = NULL; 199 pte_t *pte = NULL;
200 200
201 /* We must align the address, because our caller will run
202 * set_huge_pte_at() on whatever we return, which writes out
203 * all of the sub-ptes for the hugepage range. So we have
204 * to give it the first such sub-pte.
205 */
206 addr &= HPAGE_MASK;
207
201 pgd = pgd_offset(mm, addr); 208 pgd = pgd_offset(mm, addr);
202 pud = pud_alloc(mm, pgd, addr); 209 pud = pud_alloc(mm, pgd, addr);
203 if (pud) { 210 if (pud) {