aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/systbls.S9
-rw-r--r--arch/sparc64/defconfig24
-rw-r--r--arch/sparc64/kernel/ds.c6
-rw-r--r--arch/sparc64/kernel/head.S1
-rw-r--r--arch/sparc64/kernel/irq.c4
-rw-r--r--arch/sparc64/kernel/mdesc.c56
-rw-r--r--arch/sparc64/kernel/power.c64
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c12
-rw-r--r--arch/sparc64/kernel/systbls.S11
-rw-r--r--arch/sparc64/kernel/vio.c33
-rw-r--r--drivers/block/sunvdc.c26
-rw-r--r--drivers/net/sunvnet.c2
-rw-r--r--include/asm-sparc/unistd.h6
-rw-r--r--include/asm-sparc64/power.h7
-rw-r--r--include/asm-sparc64/unistd.h6
-rw-r--r--include/asm-sparc64/vio.h2
16 files changed, 136 insertions, 133 deletions
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index 90b52d4dab9a..55722840859c 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -1,8 +1,7 @@
1/* $Id: systbls.S,v 1.103 2002/02/08 03:57:14 davem Exp $ 1/* systbls.S: System call entry point tables for OS compatibility.
2 * systbls.S: System call entry point tables for OS compatibility.
3 * The native Linux system call table lives here also. 2 * The native Linux system call table lives here also.
4 * 3 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
6 * 5 *
7 * Based upon preliminary work which is: 6 * Based upon preliminary work which is:
8 * 7 *
@@ -80,7 +79,7 @@ sys_call_table:
80/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 79/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
81/*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy 80/*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
82/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait 81/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
83/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd 82/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd, sys_fallocate
84 83
85#ifdef CONFIG_SUNOS_EMUL 84#ifdef CONFIG_SUNOS_EMUL
86 /* Now the SunOS syscall table. */ 85 /* Now the SunOS syscall table. */
@@ -198,6 +197,6 @@ sunos_sys_table:
198 .long sunos_nosys, sunos_nosys, sunos_nosys 197 .long sunos_nosys, sunos_nosys, sunos_nosys
199 .long sunos_nosys 198 .long sunos_nosys
200/*310*/ .long sunos_nosys, sunos_nosys, sunos_nosys 199/*310*/ .long sunos_nosys, sunos_nosys, sunos_nosys
201 .long sunos_nosys 200 .long sunos_nosys, sunos_nosys
202 201
203#endif 202#endif
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 45ebf91a280c..10e301970a44 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.22 3# Linux kernel version: 2.6.22
4# Tue Jul 17 01:19:52 2007 4# Thu Jul 19 21:30:37 2007
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -16,6 +16,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
16# CONFIG_ARCH_HAS_ILOG2_U32 is not set 16# CONFIG_ARCH_HAS_ILOG2_U32 is not set
17# CONFIG_ARCH_HAS_ILOG2_U64 is not set 17# CONFIG_ARCH_HAS_ILOG2_U64 is not set
18CONFIG_AUDIT_ARCH=y 18CONFIG_AUDIT_ARCH=y
19CONFIG_ARCH_NO_VIRT_TO_BUS=y
19CONFIG_SPARC64_PAGE_SIZE_8KB=y 20CONFIG_SPARC64_PAGE_SIZE_8KB=y
20# CONFIG_SPARC64_PAGE_SIZE_64KB is not set 21# CONFIG_SPARC64_PAGE_SIZE_64KB is not set
21# CONFIG_SPARC64_PAGE_SIZE_512KB is not set 22# CONFIG_SPARC64_PAGE_SIZE_512KB is not set
@@ -148,7 +149,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
148CONFIG_RESOURCES_64BIT=y 149CONFIG_RESOURCES_64BIT=y
149CONFIG_ZONE_DMA_FLAG=0 150CONFIG_ZONE_DMA_FLAG=0
150CONFIG_NR_QUICK=1 151CONFIG_NR_QUICK=1
151CONFIG_VIRT_TO_BUS=y
152CONFIG_SBUS=y 152CONFIG_SBUS=y
153CONFIG_SBUSCHAR=y 153CONFIG_SBUSCHAR=y
154CONFIG_SUN_AUXIO=y 154CONFIG_SUN_AUXIO=y
@@ -317,7 +317,6 @@ CONFIG_CONNECTOR=m
317# CONFIG_PARPORT is not set 317# CONFIG_PARPORT is not set
318CONFIG_BLK_DEV=y 318CONFIG_BLK_DEV=y
319# CONFIG_BLK_DEV_FD is not set 319# CONFIG_BLK_DEV_FD is not set
320# CONFIG_BLK_CPQ_DA is not set
321# CONFIG_BLK_CPQ_CISS_DA is not set 320# CONFIG_BLK_CPQ_CISS_DA is not set
322# CONFIG_BLK_DEV_DAC960 is not set 321# CONFIG_BLK_DEV_DAC960 is not set
323# CONFIG_BLK_DEV_UMEM is not set 322# CONFIG_BLK_DEV_UMEM is not set
@@ -470,10 +469,6 @@ CONFIG_ISCSI_TCP=m
470# CONFIG_SCSI_SUNESP is not set 469# CONFIG_SCSI_SUNESP is not set
471# CONFIG_SCSI_SRP is not set 470# CONFIG_SCSI_SRP is not set
472# CONFIG_ATA is not set 471# CONFIG_ATA is not set
473
474#
475# Multi-device support (RAID and LVM)
476#
477CONFIG_MD=y 472CONFIG_MD=y
478CONFIG_BLK_DEV_MD=m 473CONFIG_BLK_DEV_MD=m
479CONFIG_MD_LINEAR=m 474CONFIG_MD_LINEAR=m
@@ -610,10 +605,6 @@ CONFIG_SLHC=m
610# CONFIG_NETCONSOLE is not set 605# CONFIG_NETCONSOLE is not set
611# CONFIG_NETPOLL is not set 606# CONFIG_NETPOLL is not set
612# CONFIG_NET_POLL_CONTROLLER is not set 607# CONFIG_NET_POLL_CONTROLLER is not set
613
614#
615# ISDN subsystem
616#
617# CONFIG_ISDN is not set 608# CONFIG_ISDN is not set
618# CONFIG_PHONE is not set 609# CONFIG_PHONE is not set
619 610
@@ -782,6 +773,7 @@ CONFIG_I2C_ALGOBIT=y
782CONFIG_HWMON=y 773CONFIG_HWMON=y
783# CONFIG_HWMON_VID is not set 774# CONFIG_HWMON_VID is not set
784# CONFIG_SENSORS_ABITUGURU is not set 775# CONFIG_SENSORS_ABITUGURU is not set
776# CONFIG_SENSORS_ABITUGURU3 is not set
785# CONFIG_SENSORS_AD7418 is not set 777# CONFIG_SENSORS_AD7418 is not set
786# CONFIG_SENSORS_ADM1021 is not set 778# CONFIG_SENSORS_ADM1021 is not set
787# CONFIG_SENSORS_ADM1025 is not set 779# CONFIG_SENSORS_ADM1025 is not set
@@ -808,11 +800,13 @@ CONFIG_HWMON=y
808# CONFIG_SENSORS_LM87 is not set 800# CONFIG_SENSORS_LM87 is not set
809# CONFIG_SENSORS_LM90 is not set 801# CONFIG_SENSORS_LM90 is not set
810# CONFIG_SENSORS_LM92 is not set 802# CONFIG_SENSORS_LM92 is not set
803# CONFIG_SENSORS_LM93 is not set
811# CONFIG_SENSORS_MAX1619 is not set 804# CONFIG_SENSORS_MAX1619 is not set
812# CONFIG_SENSORS_MAX6650 is not set 805# CONFIG_SENSORS_MAX6650 is not set
813# CONFIG_SENSORS_PC87360 is not set 806# CONFIG_SENSORS_PC87360 is not set
814# CONFIG_SENSORS_PC87427 is not set 807# CONFIG_SENSORS_PC87427 is not set
815# CONFIG_SENSORS_SIS5595 is not set 808# CONFIG_SENSORS_SIS5595 is not set
809# CONFIG_SENSORS_DME1737 is not set
816# CONFIG_SENSORS_SMSC47M1 is not set 810# CONFIG_SENSORS_SMSC47M1 is not set
817# CONFIG_SENSORS_SMSC47M192 is not set 811# CONFIG_SENSORS_SMSC47M192 is not set
818# CONFIG_SENSORS_SMSC47B397 is not set 812# CONFIG_SENSORS_SMSC47B397 is not set
@@ -906,6 +900,7 @@ CONFIG_FB_RADEON_I2C=y
906# CONFIG_PROM_CONSOLE is not set 900# CONFIG_PROM_CONSOLE is not set
907CONFIG_DUMMY_CONSOLE=y 901CONFIG_DUMMY_CONSOLE=y
908CONFIG_FRAMEBUFFER_CONSOLE=y 902CONFIG_FRAMEBUFFER_CONSOLE=y
903CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
909# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 904# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
910CONFIG_FONTS=y 905CONFIG_FONTS=y
911# CONFIG_FONT_8x8 is not set 906# CONFIG_FONT_8x8 is not set
@@ -1196,6 +1191,11 @@ CONFIG_USB_STORAGE=m
1196# 1191#
1197 1192
1198# 1193#
1194# Userspace I/O
1195#
1196# CONFIG_UIO is not set
1197
1198#
1199# Misc Linux/SPARC drivers 1199# Misc Linux/SPARC drivers
1200# 1200#
1201CONFIG_SUN_OPENPROMIO=m 1201CONFIG_SUN_OPENPROMIO=m
@@ -1385,6 +1385,7 @@ CONFIG_SCHEDSTATS=y
1385# CONFIG_DEBUG_MUTEXES is not set 1385# CONFIG_DEBUG_MUTEXES is not set
1386# CONFIG_DEBUG_LOCK_ALLOC is not set 1386# CONFIG_DEBUG_LOCK_ALLOC is not set
1387# CONFIG_PROVE_LOCKING is not set 1387# CONFIG_PROVE_LOCKING is not set
1388# CONFIG_LOCK_STAT is not set
1388# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1389# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1389# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1390# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1390# CONFIG_DEBUG_KOBJECT is not set 1391# CONFIG_DEBUG_KOBJECT is not set
@@ -1461,6 +1462,7 @@ CONFIG_CRC_CCITT=m
1461CONFIG_CRC16=m 1462CONFIG_CRC16=m
1462# CONFIG_CRC_ITU_T is not set 1463# CONFIG_CRC_ITU_T is not set
1463CONFIG_CRC32=y 1464CONFIG_CRC32=y
1465# CONFIG_CRC7 is not set
1464CONFIG_LIBCRC32C=m 1466CONFIG_LIBCRC32C=m
1465CONFIG_ZLIB_INFLATE=y 1467CONFIG_ZLIB_INFLATE=y
1466CONFIG_ZLIB_DEFLATE=y 1468CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/sparc64/kernel/ds.c b/arch/sparc64/kernel/ds.c
index fa1f04d756a2..1a2062ecb0bc 100644
--- a/arch/sparc64/kernel/ds.c
+++ b/arch/sparc64/kernel/ds.c
@@ -13,11 +13,11 @@
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/mutex.h> 14#include <linux/mutex.h>
15#include <linux/kthread.h> 15#include <linux/kthread.h>
16#include <linux/reboot.h>
16#include <linux/cpu.h> 17#include <linux/cpu.h>
17 18
18#include <asm/ldc.h> 19#include <asm/ldc.h>
19#include <asm/vio.h> 20#include <asm/vio.h>
20#include <asm/power.h>
21#include <asm/mdesc.h> 21#include <asm/mdesc.h>
22#include <asm/head.h> 22#include <asm/head.h>
23#include <asm/irq.h> 23#include <asm/irq.h>
@@ -328,7 +328,7 @@ static void domain_shutdown_data(struct ldc_channel *lp,
328 328
329 ds_send(lp, &pkt, sizeof(pkt)); 329 ds_send(lp, &pkt, sizeof(pkt));
330 330
331 wake_up_powerd(); 331 orderly_poweroff(true);
332} 332}
333 333
334struct ds_panic_req { 334struct ds_panic_req {
@@ -1133,8 +1133,6 @@ static int __devinit ds_probe(struct vio_dev *vdev,
1133 1133
1134 ds_info = dp; 1134 ds_info = dp;
1135 1135
1136 start_powerd();
1137
1138 return err; 1136 return err;
1139 1137
1140out_free_ldc: 1138out_free_ldc:
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index 77259526cb15..35feacb6b8ec 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -458,7 +458,6 @@ tlb_fixup_done:
458 or %g6, %lo(init_thread_union), %g6 458 or %g6, %lo(init_thread_union), %g6
459 ldx [%g6 + TI_TASK], %g4 459 ldx [%g6 + TI_TASK], %g4
460 mov %sp, %l6 460 mov %sp, %l6
461 mov %o4, %l7
462 461
463 wr %g0, ASI_P, %asi 462 wr %g0, ASI_P, %asi
464 mov 1, %g1 463 mov 1, %g1
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 8cb3358674f5..c72795666a62 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -701,10 +701,10 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
701{ 701{
702 unsigned long sysino, hv_err; 702 unsigned long sysino, hv_err;
703 703
704 BUG_ON(devhandle & ~IMAP_IGN); 704 BUG_ON(devhandle & devino);
705 BUG_ON(devino & ~IMAP_INO);
706 705
707 sysino = devhandle | devino; 706 sysino = devhandle | devino;
707 BUG_ON(sysino & ~(IMAP_IGN | IMAP_INO));
708 708
709 hv_err = sun4v_vintr_set_cookie(devhandle, devino, sysino); 709 hv_err = sun4v_vintr_set_cookie(devhandle, devino, sysino);
710 if (hv_err) { 710 if (hv_err) {
diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c
index 302ba5e5a0bb..13a79fe5115b 100644
--- a/arch/sparc64/kernel/mdesc.c
+++ b/arch/sparc64/kernel/mdesc.c
@@ -231,6 +231,25 @@ void mdesc_register_notifier(struct mdesc_notifier_client *client)
231 mutex_unlock(&mdesc_mutex); 231 mutex_unlock(&mdesc_mutex);
232} 232}
233 233
234static const u64 *parent_cfg_handle(struct mdesc_handle *hp, u64 node)
235{
236 const u64 *id;
237 u64 a;
238
239 id = NULL;
240 mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) {
241 u64 target;
242
243 target = mdesc_arc_target(hp, a);
244 id = mdesc_get_property(hp, target,
245 "cfg-handle", NULL);
246 if (id)
247 break;
248 }
249
250 return id;
251}
252
234/* Run 'func' on nodes which are in A but not in B. */ 253/* Run 'func' on nodes which are in A but not in B. */
235static void invoke_on_missing(const char *name, 254static void invoke_on_missing(const char *name,
236 struct mdesc_handle *a, 255 struct mdesc_handle *a,
@@ -240,13 +259,42 @@ static void invoke_on_missing(const char *name,
240 u64 node; 259 u64 node;
241 260
242 mdesc_for_each_node_by_name(a, node, name) { 261 mdesc_for_each_node_by_name(a, node, name) {
243 const u64 *id = mdesc_get_property(a, node, "id", NULL); 262 int found = 0, is_vdc_port = 0;
244 int found = 0; 263 const char *name_prop;
264 const u64 *id;
245 u64 fnode; 265 u64 fnode;
246 266
267 name_prop = mdesc_get_property(a, node, "name", NULL);
268 if (name_prop && !strcmp(name_prop, "vdc-port")) {
269 is_vdc_port = 1;
270 id = parent_cfg_handle(a, node);
271 } else
272 id = mdesc_get_property(a, node, "id", NULL);
273
274 if (!id) {
275 printk(KERN_ERR "MD: Cannot find ID for %s node.\n",
276 (name_prop ? name_prop : name));
277 continue;
278 }
279
247 mdesc_for_each_node_by_name(b, fnode, name) { 280 mdesc_for_each_node_by_name(b, fnode, name) {
248 const u64 *fid = mdesc_get_property(b, fnode, 281 const u64 *fid;
249 "id", NULL); 282
283 if (is_vdc_port) {
284 name_prop = mdesc_get_property(b, fnode,
285 "name", NULL);
286 if (!name_prop ||
287 strcmp(name_prop, "vdc-port"))
288 continue;
289 fid = parent_cfg_handle(b, fnode);
290 if (!fid) {
291 printk(KERN_ERR "MD: Cannot find ID "
292 "for vdc-port node.\n");
293 continue;
294 }
295 } else
296 fid = mdesc_get_property(b, fnode,
297 "id", NULL);
250 298
251 if (*id == *fid) { 299 if (*id == *fid) {
252 found = 1; 300 found = 1;
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
index 8dd4294ad21e..39f9f6494d4c 100644
--- a/arch/sparc64/kernel/power.c
+++ b/arch/sparc64/kernel/power.c
@@ -12,13 +12,13 @@
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/pm.h> 13#include <linux/pm.h>
14#include <linux/syscalls.h> 14#include <linux/syscalls.h>
15#include <linux/reboot.h>
15 16
16#include <asm/system.h> 17#include <asm/system.h>
17#include <asm/auxio.h> 18#include <asm/auxio.h>
18#include <asm/prom.h> 19#include <asm/prom.h>
19#include <asm/of_device.h> 20#include <asm/of_device.h>
20#include <asm/io.h> 21#include <asm/io.h>
21#include <asm/power.h>
22#include <asm/sstate.h> 22#include <asm/sstate.h>
23 23
24#include <linux/unistd.h> 24#include <linux/unistd.h>
@@ -31,20 +31,9 @@ int scons_pwroff = 1;
31 31
32static void __iomem *power_reg; 32static void __iomem *power_reg;
33 33
34static DECLARE_WAIT_QUEUE_HEAD(powerd_wait);
35static int button_pressed;
36
37void wake_up_powerd(void)
38{
39 if (button_pressed == 0) {
40 button_pressed = 1;
41 wake_up(&powerd_wait);
42 }
43}
44
45static irqreturn_t power_handler(int irq, void *dev_id) 34static irqreturn_t power_handler(int irq, void *dev_id)
46{ 35{
47 wake_up_powerd(); 36 orderly_poweroff(true);
48 37
49 /* FIXME: Check registers for status... */ 38 /* FIXME: Check registers for status... */
50 return IRQ_HANDLED; 39 return IRQ_HANDLED;
@@ -77,48 +66,6 @@ void machine_power_off(void)
77void (*pm_power_off)(void) = machine_power_off; 66void (*pm_power_off)(void) = machine_power_off;
78EXPORT_SYMBOL(pm_power_off); 67EXPORT_SYMBOL(pm_power_off);
79 68
80static int powerd(void *__unused)
81{
82 static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
83 char *argv[] = { "/sbin/shutdown", "-h", "now", NULL };
84 DECLARE_WAITQUEUE(wait, current);
85
86 daemonize("powerd");
87
88 add_wait_queue(&powerd_wait, &wait);
89
90 for (;;) {
91 set_task_state(current, TASK_INTERRUPTIBLE);
92 if (button_pressed)
93 break;
94 flush_signals(current);
95 schedule();
96 }
97 __set_current_state(TASK_RUNNING);
98 remove_wait_queue(&powerd_wait, &wait);
99
100 /* Ok, down we go... */
101 button_pressed = 0;
102 if (kernel_execve("/sbin/shutdown", argv, envp) < 0) {
103 printk(KERN_ERR "powerd: shutdown execution failed\n");
104 machine_power_off();
105 }
106 return 0;
107}
108
109int start_powerd(void)
110{
111 int err;
112
113 err = kernel_thread(powerd, NULL, CLONE_FS);
114 if (err < 0)
115 printk(KERN_ERR "power: Failed to start power daemon.\n");
116 else
117 printk(KERN_INFO "power: powerd running.\n");
118
119 return err;
120}
121
122static int __init has_button_interrupt(unsigned int irq, struct device_node *dp) 69static int __init has_button_interrupt(unsigned int irq, struct device_node *dp)
123{ 70{
124 if (irq == 0xffffffff) 71 if (irq == 0xffffffff)
@@ -136,20 +83,15 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
136 83
137 power_reg = of_ioremap(res, 0, 0x4, "power"); 84 power_reg = of_ioremap(res, 0, 0x4, "power");
138 85
139 printk("%s: Control reg at %lx ... ", 86 printk(KERN_INFO "%s: Control reg at %lx\n",
140 op->node->name, res->start); 87 op->node->name, res->start);
141 88
142 poweroff_method = machine_halt; /* able to use the standard halt */ 89 poweroff_method = machine_halt; /* able to use the standard halt */
143 90
144 if (has_button_interrupt(irq, op->node)) { 91 if (has_button_interrupt(irq, op->node)) {
145 if (start_powerd() < 0)
146 return 0;
147
148 if (request_irq(irq, 92 if (request_irq(irq,
149 power_handler, 0, "power", NULL) < 0) 93 power_handler, 0, "power", NULL) < 0)
150 printk(KERN_ERR "power: Cannot setup IRQ handler.\n"); 94 printk(KERN_ERR "power: Cannot setup IRQ handler.\n");
151 } else {
152 printk(KERN_INFO "power: Not using powerd.\n");
153 } 95 }
154 96
155 return 0; 97 return 0;
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index abd83129b2e7..e8dce90d05d4 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -1,8 +1,7 @@
1/* $Id: sys_sparc32.c,v 1.184 2002/02/09 19:49:31 davem Exp $ 1/* sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
2 * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls.
3 * 2 *
4 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 3 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net)
6 * 5 *
7 * These routines maintain argument size conversion between 32bit and 64bit 6 * These routines maintain argument size conversion between 32bit and 64bit
8 * environment. 7 * environment.
@@ -1028,3 +1027,10 @@ long compat_sync_file_range(int fd, unsigned long off_high, unsigned long off_lo
1028 (nb_high << 32) | nb_low, 1027 (nb_high << 32) | nb_low,
1029 flags); 1028 flags);
1030} 1029}
1030
1031asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo,
1032 u32 lenhi, u32 lenlo)
1033{
1034 return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
1035 ((loff_t)lenhi << 32) | lenlo);
1036}
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 8765e32155a0..06d10907d8ce 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -1,8 +1,7 @@
1/* $Id: systbls.S,v 1.81 2002/02/08 03:57:14 davem Exp $ 1/* systbls.S: System call entry point tables for OS compatibility.
2 * systbls.S: System call entry point tables for OS compatibility.
3 * The native Linux system call table lives here also. 2 * The native Linux system call table lives here also.
4 * 3 *
5 * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995, 1996, 2007 David S. Miller (davem@davemloft.net)
6 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 5 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
7 * 6 *
8 * Based upon preliminary work which is: 7 * Based upon preliminary work which is:
@@ -81,7 +80,7 @@ sys_call_table32:
81 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 80 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
82/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages, compat_sys_mbind, compat_sys_get_mempolicy 81/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages, compat_sys_mbind, compat_sys_get_mempolicy
83 .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait 82 .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait
84/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, compat_sys_timerfd, sys_eventfd 83/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, compat_sys_timerfd, sys_eventfd, compat_sys_fallocate
85 84
86#endif /* CONFIG_COMPAT */ 85#endif /* CONFIG_COMPAT */
87 86
@@ -153,7 +152,7 @@ sys_call_table:
153 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 152 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
154/*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy 153/*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
155 .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait 154 .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
156/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd 155/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd, sys_eventfd, sys_fallocate
157 156
158#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ 157#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
159 defined(CONFIG_SOLARIS_EMUL_MODULE) 158 defined(CONFIG_SOLARIS_EMUL_MODULE)
@@ -272,6 +271,6 @@ sunos_sys_table:
272 .word sunos_nosys, sunos_nosys, sunos_nosys 271 .word sunos_nosys, sunos_nosys, sunos_nosys
273 .word sunos_nosys 272 .word sunos_nosys
274/*310*/ .word sunos_nosys, sunos_nosys, sunos_nosys 273/*310*/ .word sunos_nosys, sunos_nosys, sunos_nosys
275 .word sunos_nosys 274 .word sunos_nosys, sunos_nosys
276 275
277#endif 276#endif
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c
index 8d3cc4fdb557..491223a6628f 100644
--- a/arch/sparc64/kernel/vio.c
+++ b/arch/sparc64/kernel/vio.c
@@ -103,9 +103,9 @@ static ssize_t devspec_show(struct device *dev,
103 struct vio_dev *vdev = to_vio_dev(dev); 103 struct vio_dev *vdev = to_vio_dev(dev);
104 const char *str = "none"; 104 const char *str = "none";
105 105
106 if (!strcmp(vdev->type, "network")) 106 if (!strcmp(vdev->type, "vnet-port"))
107 str = "vnet"; 107 str = "vnet";
108 else if (!strcmp(vdev->type, "block")) 108 else if (!strcmp(vdev->type, "vdc-port"))
109 str = "vdisk"; 109 str = "vdisk";
110 110
111 return sprintf(buf, "%s\n", str); 111 return sprintf(buf, "%s\n", str);
@@ -221,6 +221,27 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
221 return NULL; 221 return NULL;
222 } 222 }
223 223
224 if (!strcmp(type, "vdc-port")) {
225 u64 a;
226
227 id = NULL;
228 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_BACK) {
229 u64 target;
230
231 target = mdesc_arc_target(hp, a);
232 id = mdesc_get_property(hp, target,
233 "cfg-handle", NULL);
234 if (id)
235 break;
236 }
237 if (!id) {
238 printk(KERN_ERR "VIO: vdc-port lacks parent "
239 "cfg-handle.\n");
240 return NULL;
241 }
242 } else
243 id = mdesc_get_property(hp, mp, "id", NULL);
244
224 bus_id_name = type; 245 bus_id_name = type;
225 if (!strcmp(type, "domain-services-port")) 246 if (!strcmp(type, "domain-services-port"))
226 bus_id_name = "ds"; 247 bus_id_name = "ds";
@@ -260,13 +281,15 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
260 281
261 vio_fill_channel_info(hp, mp, vdev); 282 vio_fill_channel_info(hp, mp, vdev);
262 283
263 id = mdesc_get_property(hp, mp, "id", NULL); 284 if (!id) {
264 if (!id)
265 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s", 285 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s",
266 bus_id_name); 286 bus_id_name);
267 else 287 vdev->dev_no = ~(u64)0;
288 } else {
268 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu", 289 snprintf(vdev->dev.bus_id, BUS_ID_SIZE, "%s-%lu",
269 bus_id_name, *id); 290 bus_id_name, *id);
291 vdev->dev_no = *id;
292 }
270 293
271 vdev->dev.parent = parent; 294 vdev->dev.parent = parent;
272 vdev->dev.bus = &vio_bus_type; 295 vdev->dev.bus = &vio_bus_type;
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 2288b55d916f..d50b82381155 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -64,7 +64,6 @@ struct vdc_port {
64 u64 operations; 64 u64 operations;
65 u32 vdisk_size; 65 u32 vdisk_size;
66 u8 vdisk_type; 66 u8 vdisk_type;
67 u8 dev_no;
68 67
69 char disk_name[32]; 68 char disk_name[32];
70 69
@@ -703,7 +702,7 @@ static int probe_disk(struct vdc_port *port)
703 blk_queue_max_phys_segments(q, port->ring_cookies); 702 blk_queue_max_phys_segments(q, port->ring_cookies);
704 blk_queue_max_sectors(q, port->max_xfer_size); 703 blk_queue_max_sectors(q, port->max_xfer_size);
705 g->major = vdc_major; 704 g->major = vdc_major;
706 g->first_minor = port->dev_no << PARTITION_SHIFT; 705 g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
707 strcpy(g->disk_name, port->disk_name); 706 strcpy(g->disk_name, port->disk_name);
708 707
709 g->fops = &vdc_fops; 708 g->fops = &vdc_fops;
@@ -747,21 +746,16 @@ static int __devinit vdc_port_probe(struct vio_dev *vdev,
747{ 746{
748 struct mdesc_handle *hp; 747 struct mdesc_handle *hp;
749 struct vdc_port *port; 748 struct vdc_port *port;
750 const u64 *port_id;
751 int err; 749 int err;
752 750
753 print_version(); 751 print_version();
754 752
755 hp = mdesc_grab(); 753 hp = mdesc_grab();
756 754
757 port_id = mdesc_get_property(hp, vdev->mp, "id", NULL);
758 err = -ENODEV; 755 err = -ENODEV;
759 if (!port_id) { 756 if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {
760 printk(KERN_ERR PFX "Port lacks id property.\n"); 757 printk(KERN_ERR PFX "Port id [%lu] too large.\n",
761 goto err_out_release_mdesc; 758 vdev->dev_no);
762 }
763 if ((*port_id << PARTITION_SHIFT) & ~(u64)MINORMASK) {
764 printk(KERN_ERR PFX "Port id [%lu] too large.\n", *port_id);
765 goto err_out_release_mdesc; 759 goto err_out_release_mdesc;
766 } 760 }
767 761
@@ -772,16 +766,14 @@ static int __devinit vdc_port_probe(struct vio_dev *vdev,
772 goto err_out_release_mdesc; 766 goto err_out_release_mdesc;
773 } 767 }
774 768
775 port->dev_no = *port_id; 769 if (vdev->dev_no >= 26)
776
777 if (port->dev_no >= 26)
778 snprintf(port->disk_name, sizeof(port->disk_name), 770 snprintf(port->disk_name, sizeof(port->disk_name),
779 VDCBLK_NAME "%c%c", 771 VDCBLK_NAME "%c%c",
780 'a' + (port->dev_no / 26) - 1, 772 'a' + ((int)vdev->dev_no / 26) - 1,
781 'a' + (port->dev_no % 26)); 773 'a' + ((int)vdev->dev_no % 26));
782 else 774 else
783 snprintf(port->disk_name, sizeof(port->disk_name), 775 snprintf(port->disk_name, sizeof(port->disk_name),
784 VDCBLK_NAME "%c", 'a' + (port->dev_no % 26)); 776 VDCBLK_NAME "%c", 'a' + ((int)vdev->dev_no % 26));
785 777
786 err = vio_driver_init(&port->vio, vdev, VDEV_DISK, 778 err = vio_driver_init(&port->vio, vdev, VDEV_DISK,
787 vdc_versions, ARRAY_SIZE(vdc_versions), 779 vdc_versions, ARRAY_SIZE(vdc_versions),
@@ -849,7 +841,7 @@ static struct vio_device_id vdc_port_match[] = {
849 }, 841 },
850 {}, 842 {},
851}; 843};
852MODULE_DEVICE_TABLE(vio, vdc_match); 844MODULE_DEVICE_TABLE(vio, vdc_port_match);
853 845
854static struct vio_driver vdc_port_driver = { 846static struct vio_driver vdc_port_driver = {
855 .id_table = vdc_port_match, 847 .id_table = vdc_port_match,
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c
index b801e3b3a11a..ef0066bab2cf 100644
--- a/drivers/net/sunvnet.c
+++ b/drivers/net/sunvnet.c
@@ -1136,7 +1136,7 @@ static struct vio_device_id vnet_port_match[] = {
1136 }, 1136 },
1137 {}, 1137 {},
1138}; 1138};
1139MODULE_DEVICE_TABLE(vio, vnet_match); 1139MODULE_DEVICE_TABLE(vio, vnet_port_match);
1140 1140
1141static struct vio_driver vnet_port_driver = { 1141static struct vio_driver vnet_port_driver = {
1142 .id_table = vnet_port_match, 1142 .id_table = vnet_port_match,
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 64471bcd96f9..029b3e0d5e4c 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -1,4 +1,3 @@
1/* $Id: unistd.h,v 1.74 2002/02/08 03:57:18 davem Exp $ */
2#ifndef _SPARC_UNISTD_H 1#ifndef _SPARC_UNISTD_H
3#define _SPARC_UNISTD_H 2#define _SPARC_UNISTD_H
4 3
@@ -9,7 +8,7 @@
9 * think of right now to force the arguments into fixed registers 8 * think of right now to force the arguments into fixed registers
10 * before the trap into the system call with gcc 'asm' statements. 9 * before the trap into the system call with gcc 'asm' statements.
11 * 10 *
12 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 11 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
13 * 12 *
14 * SunOS compatibility based upon preliminary work which is: 13 * SunOS compatibility based upon preliminary work which is:
15 * 14 *
@@ -330,8 +329,9 @@
330#define __NR_signalfd 311 329#define __NR_signalfd 311
331#define __NR_timerfd 312 330#define __NR_timerfd 312
332#define __NR_eventfd 313 331#define __NR_eventfd 313
332#define __NR_fallocate 314
333 333
334#define NR_SYSCALLS 314 334#define NR_SYSCALLS 315
335 335
336#ifdef __KERNEL__ 336#ifdef __KERNEL__
337#define __ARCH_WANT_IPC_PARSE_VERSION 337#define __ARCH_WANT_IPC_PARSE_VERSION
diff --git a/include/asm-sparc64/power.h b/include/asm-sparc64/power.h
deleted file mode 100644
index 94495c1ac4f6..000000000000
--- a/include/asm-sparc64/power.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _SPARC64_POWER_H
2#define _SPARC64_POWER_H
3
4extern void wake_up_powerd(void);
5extern int start_powerd(void);
6
7#endif /* !(_SPARC64_POWER_H) */
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 53e96ed9c024..cb751b4d0f56 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -1,4 +1,3 @@
1/* $Id: unistd.h,v 1.50 2002/02/08 03:57:18 davem Exp $ */
2#ifndef _SPARC64_UNISTD_H 1#ifndef _SPARC64_UNISTD_H
3#define _SPARC64_UNISTD_H 2#define _SPARC64_UNISTD_H
4 3
@@ -9,7 +8,7 @@
9 * think of right now to force the arguments into fixed registers 8 * think of right now to force the arguments into fixed registers
10 * before the trap into the system call with gcc 'asm' statements. 9 * before the trap into the system call with gcc 'asm' statements.
11 * 10 *
12 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 11 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
13 * 12 *
14 * SunOS compatibility based upon preliminary work which is: 13 * SunOS compatibility based upon preliminary work which is:
15 * 14 *
@@ -332,8 +331,9 @@
332#define __NR_signalfd 311 331#define __NR_signalfd 311
333#define __NR_timerfd 312 332#define __NR_timerfd 312
334#define __NR_eventfd 313 333#define __NR_eventfd 313
334#define __NR_fallocate 314
335 335
336#define NR_SYSCALLS 314 336#define NR_SYSCALLS 315
337 337
338#ifdef __KERNEL__ 338#ifdef __KERNEL__
339/* sysconf options, for SunOS compatibility */ 339/* sysconf options, for SunOS compatibility */
diff --git a/include/asm-sparc64/vio.h b/include/asm-sparc64/vio.h
index c0a8d4ed5bcb..f7417e91b170 100644
--- a/include/asm-sparc64/vio.h
+++ b/include/asm-sparc64/vio.h
@@ -275,6 +275,8 @@ struct vio_dev {
275 char compat[VIO_MAX_COMPAT_LEN]; 275 char compat[VIO_MAX_COMPAT_LEN];
276 int compat_len; 276 int compat_len;
277 277
278 u64 dev_no;
279
278 unsigned long channel_id; 280 unsigned long channel_id;
279 281
280 unsigned int tx_irq; 282 unsigned int tx_irq;