aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS6
-rw-r--r--Makefile4
-rw-r--r--arch/alpha/kernel/machvec_impl.h2
-rw-r--r--arch/arm/kernel/calls.S8
-rw-r--r--arch/arm/kernel/entry-armv.S49
-rw-r--r--arch/arm/kernel/entry-common.S20
-rw-r--r--arch/i386/mm/ioremap.c2
-rw-r--r--arch/i386/pci/mmconfig.c2
-rw-r--r--arch/ia64/configs/sn2_defconfig2
-rw-r--r--arch/ia64/kernel/time.c29
-rw-r--r--arch/ia64/kernel/uncached.c6
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S3
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c2
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_reg.c48
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c12
-rw-r--r--arch/powerpc/kernel/syscalls.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_dma.c1
-rw-r--r--arch/sparc/kernel/ebus.c24
-rw-r--r--arch/sparc/kernel/led.c2
-rw-r--r--arch/sparc/kernel/pcic.c2
-rw-r--r--arch/sparc/kernel/time.c4
-rw-r--r--arch/sparc/mm/sun4c.c2
-rw-r--r--arch/um/Kconfig2
-rw-r--r--arch/um/Makefile-x86_644
-rw-r--r--arch/um/include/sysdep-i386/stub.h29
-rw-r--r--arch/um/include/sysdep-x86_64/stub.h30
-rw-r--r--arch/um/kernel/skas/clone.c23
-rw-r--r--arch/um/scripts/Makefile.rules5
-rw-r--r--arch/x86_64/mm/ioremap.c2
-rw-r--r--arch/x86_64/pci/mmconfig.c14
-rw-r--r--block/scsi_ioctl.c45
-rw-r--r--drivers/atm/adummy.c2
-rw-r--r--drivers/base/memory.c1
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/drm/radeon_cp.c11
-rw-r--r--drivers/char/drm/radeon_drv.h1
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c6
-rw-r--r--drivers/char/mwave/mwavepub.h2
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c13
-rw-r--r--drivers/char/watchdog/booke_wdt.c15
-rw-r--r--drivers/char/watchdog/wdrtas.c2
-rw-r--r--drivers/firmware/dell_rbu.c6
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c11
-rw-r--r--drivers/ieee1394/hosts.h1
-rw-r--r--drivers/ieee1394/nodemgr.c67
-rw-r--r--drivers/input/misc/wistron_btns.c2
-rw-r--r--drivers/macintosh/therm_pm72.c2
-rw-r--r--drivers/md/md.c2
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c6
-rw-r--r--drivers/media/dvb/ttpci/av7110.c3
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.h3
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c42
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c8
-rw-r--r--drivers/media/video/em28xx/em28xx-i2c.c2
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c2
-rw-r--r--drivers/media/video/em28xx/em28xx.h8
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c2
-rw-r--r--drivers/media/video/tveeprom.c2
-rw-r--r--drivers/message/i2o/pci.c6
-rw-r--r--drivers/mtd/onenand/generic.c4
-rw-r--r--drivers/mtd/onenand/onenand_base.c53
-rw-r--r--drivers/mtd/onenand/onenand_bbt.c4
-rw-r--r--drivers/net/s2io.c10
-rw-r--r--drivers/net/tg3.c186
-rw-r--r--drivers/pci/Makefile7
-rw-r--r--drivers/sbus/char/jsflash.c19
-rw-r--r--drivers/sbus/char/uctrl.c10
-rw-r--r--drivers/sbus/char/vfc.h2
-rw-r--r--drivers/sbus/char/vfc_dev.c6
-rw-r--r--drivers/scsi/dpt_i2o.c25
-rw-r--r--drivers/scsi/iscsi_tcp.c2
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c2
-rw-r--r--drivers/usb/host/uhci-hcd.c2
-rw-r--r--drivers/usb/input/hid-input.c1
-rw-r--r--drivers/usb/misc/auerswald.c2
-rw-r--r--drivers/video/arcfb.c2
-rw-r--r--drivers/video/cyber2000fb.c4
-rw-r--r--drivers/video/intelfb/intelfb.h5
-rw-r--r--drivers/video/intelfb/intelfbdrv.c51
-rw-r--r--fs/lockd/clntlock.c4
-rw-r--r--fs/nfs/direct.c24
-rw-r--r--fs/nfs/file.c23
-rw-r--r--fs/nfs/inode.c28
-rw-r--r--fs/xfs/quota/xfs_qm.c4
-rw-r--r--include/asm-ia64/delay.h10
-rw-r--r--include/asm-ppc/ppc4xx_dma.h3
-rw-r--r--include/asm-sparc/memreg.h2
-rw-r--r--include/asm-sparc/pcic.h6
-rw-r--r--include/linux/cache.h2
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mtd/onenand.h5
-rw-r--r--include/linux/nfs_fs.h1
-rw-r--r--include/linux/rtnetlink.h4
-rw-r--r--include/net/xfrm.h1
-rw-r--r--mm/memory.c3
-rw-r--r--mm/mmap.c2
-rw-r--r--mm/mremap.c2
-rw-r--r--mm/page_alloc.c2
-rw-r--r--net/bridge/br_netfilter.c17
-rw-r--r--net/ipv4/netfilter/Makefile3
-rw-r--r--net/ipv4/xfrm4_policy.c1
-rw-r--r--net/ipv6/addrconf.c16
-rw-r--r--net/ipv6/netfilter/Kconfig2
-rw-r--r--net/ipv6/route.c2
-rw-r--r--net/ipv6/xfrm6_policy.c1
-rw-r--r--net/sctp/socket.c16
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c6
-rw-r--r--net/sunrpc/rpc_pipe.c4
-rw-r--r--net/sunrpc/xprtsock.c2
-rw-r--r--net/xfrm/xfrm_policy.c19
-rw-r--r--net/xfrm/xfrm_state.c5
-rw-r--r--sound/oss/au1550_ac97.c29
112 files changed, 750 insertions, 513 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index da6973adacda..6af683025ae0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -536,7 +536,7 @@ P: Mauro Carvalho Chehab
536M: mchehab@brturbo.com.br 536M: mchehab@brturbo.com.br
537L: video4linux-list@redhat.com 537L: video4linux-list@redhat.com
538W: http://linuxtv.org 538W: http://linuxtv.org
539T: quilt http://www.linuxtv.org/download/quilt/ 539T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
540S: Maintained 540S: Maintained
541 541
542BUSLOGIC SCSI DRIVER 542BUSLOGIC SCSI DRIVER
@@ -834,7 +834,7 @@ P: LinuxTV.org Project
834M: linux-dvb-maintainer@linuxtv.org 834M: linux-dvb-maintainer@linuxtv.org
835L: linux-dvb@linuxtv.org (subscription required) 835L: linux-dvb@linuxtv.org (subscription required)
836W: http://linuxtv.org/ 836W: http://linuxtv.org/
837T: quilt http://www.linuxtv.org/download/quilt/ 837T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
838S: Supported 838S: Supported
839 839
840EATA-DMA SCSI DRIVER 840EATA-DMA SCSI DRIVER
@@ -2896,7 +2896,7 @@ P: Mauro Carvalho Chehab
2896M: mchehab@brturbo.com.br 2896M: mchehab@brturbo.com.br
2897L: video4linux-list@redhat.com 2897L: video4linux-list@redhat.com
2898W: http://linuxtv.org 2898W: http://linuxtv.org
2899T: quilt http://www.linuxtv.org/download/quilt/ 2899T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
2900S: Maintained 2900S: Maintained
2901 2901
2902W1 DALLAS'S 1-WIRE BUS 2902W1 DALLAS'S 1-WIRE BUS
diff --git a/Makefile b/Makefile
index ad457e1bd0d2..f4218b5db827 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 15 3SUBLEVEL = 15
4EXTRAVERSION =-rc5 4EXTRAVERSION =-rc6
5NAME=Affluent Albatross 5NAME=Sliding Snow Leopard
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
8# To see a list of typical targets execute "make help" 8# To see a list of typical targets execute "make help"
diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h
index 4959b7a3e1e6..11f996f24fde 100644
--- a/arch/alpha/kernel/machvec_impl.h
+++ b/arch/alpha/kernel/machvec_impl.h
@@ -41,7 +41,7 @@
41#define CAT1(x,y) x##y 41#define CAT1(x,y) x##y
42#define CAT(x,y) CAT1(x,y) 42#define CAT(x,y) CAT1(x,y)
43 43
44#define DO_DEFAULT_RTC rtc_port: 0x70 44#define DO_DEFAULT_RTC .rtc_port = 0x70
45 45
46#define DO_EV4_MMU \ 46#define DO_EV4_MMU \
47 .max_asn = EV4_MAX_ASN, \ 47 .max_asn = EV4_MAX_ASN, \
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 2ad4aa2a1536..55076a75e5bf 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -131,7 +131,7 @@ __syscall_start:
131 .long sys_wait4 131 .long sys_wait4
132/* 115 */ .long sys_swapoff 132/* 115 */ .long sys_swapoff
133 .long sys_sysinfo 133 .long sys_sysinfo
134 .long sys_ipc_wrapper 134 .long sys_ipc
135 .long sys_fsync 135 .long sys_fsync
136 .long sys_sigreturn_wrapper 136 .long sys_sigreturn_wrapper
137/* 120 */ .long sys_clone_wrapper 137/* 120 */ .long sys_clone_wrapper
@@ -254,7 +254,7 @@ __syscall_start:
254 .long sys_fremovexattr 254 .long sys_fremovexattr
255 .long sys_tkill 255 .long sys_tkill
256 .long sys_sendfile64 256 .long sys_sendfile64
257/* 240 */ .long sys_futex_wrapper 257/* 240 */ .long sys_futex
258 .long sys_sched_setaffinity 258 .long sys_sched_setaffinity
259 .long sys_sched_getaffinity 259 .long sys_sched_getaffinity
260 .long sys_io_setup 260 .long sys_io_setup
@@ -284,7 +284,7 @@ __syscall_start:
284 .long sys_fstatfs64 284 .long sys_fstatfs64
285 .long sys_tgkill 285 .long sys_tgkill
286 .long sys_utimes 286 .long sys_utimes
287/* 270 */ .long sys_arm_fadvise64_64_wrapper 287/* 270 */ .long sys_arm_fadvise64_64
288 .long sys_pciconfig_iobase 288 .long sys_pciconfig_iobase
289 .long sys_pciconfig_read 289 .long sys_pciconfig_read
290 .long sys_pciconfig_write 290 .long sys_pciconfig_write
@@ -333,7 +333,7 @@ __syscall_start:
333 .long sys_inotify_init 333 .long sys_inotify_init
334 .long sys_inotify_add_watch 334 .long sys_inotify_add_watch
335 .long sys_inotify_rm_watch 335 .long sys_inotify_rm_watch
336 .long sys_mbind_wrapper 336 .long sys_mbind
337/* 320 */ .long sys_get_mempolicy 337/* 320 */ .long sys_get_mempolicy
338 .long sys_set_mempolicy 338 .long sys_set_mempolicy
339__syscall_end: 339__syscall_end:
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index d9fb819bf7cc..2a8d27e18fa7 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -614,6 +614,47 @@ __kuser_helper_start:
614/* 614/*
615 * Reference prototype: 615 * Reference prototype:
616 * 616 *
617 * void __kernel_memory_barrier(void)
618 *
619 * Input:
620 *
621 * lr = return address
622 *
623 * Output:
624 *
625 * none
626 *
627 * Clobbered:
628 *
629 * the Z flag might be lost
630 *
631 * Definition and user space usage example:
632 *
633 * typedef void (__kernel_dmb_t)(void);
634 * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)
635 *
636 * Apply any needed memory barrier to preserve consistency with data modified
637 * manually and __kuser_cmpxchg usage.
638 *
639 * This could be used as follows:
640 *
641 * #define __kernel_dmb() \
642 * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
643 * : : : "lr","cc" )
644 */
645
646__kuser_memory_barrier: @ 0xffff0fa0
647
648#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
649 mcr p15, 0, r0, c7, c10, 5 @ dmb
650#endif
651 mov pc, lr
652
653 .align 5
654
655/*
656 * Reference prototype:
657 *
617 * int __kernel_cmpxchg(int oldval, int newval, int *ptr) 658 * int __kernel_cmpxchg(int oldval, int newval, int *ptr)
618 * 659 *
619 * Input: 660 * Input:
@@ -642,6 +683,8 @@ __kuser_helper_start:
642 * The C flag is also set if *ptr was changed to allow for assembly 683 * The C flag is also set if *ptr was changed to allow for assembly
643 * optimization in the calling code. 684 * optimization in the calling code.
644 * 685 *
686 * Note: this routine already includes memory barriers as needed.
687 *
645 * For example, a user space atomic_add implementation could look like this: 688 * For example, a user space atomic_add implementation could look like this:
646 * 689 *
647 * #define atomic_add(ptr, val) \ 690 * #define atomic_add(ptr, val) \
@@ -698,10 +741,16 @@ __kuser_cmpxchg: @ 0xffff0fc0
698 741
699#else 742#else
700 743
744#ifdef CONFIG_SMP
745 mcr p15, 0, r0, c7, c10, 5 @ dmb
746#endif
701 ldrex r3, [r2] 747 ldrex r3, [r2]
702 subs r3, r3, r0 748 subs r3, r3, r0
703 strexeq r3, r1, [r2] 749 strexeq r3, r1, [r2]
704 rsbs r0, r3, #0 750 rsbs r0, r3, #0
751#ifdef CONFIG_SMP
752 mcr p15, 0, r0, c7, c10, 5 @ dmb
753#endif
705 mov pc, lr 754 mov pc, lr
706 755
707#endif 756#endif
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index f7f183075237..e2b42997ad33 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -145,7 +145,7 @@ ENTRY(vector_swi)
145#endif 145#endif
146 enable_irq 146 enable_irq
147 147
148 str r4, [sp, #-S_OFF]! @ push fifth arg 148 stmdb sp!, {r4, r5} @ push fifth and sixth args
149 149
150 get_thread_info tsk 150 get_thread_info tsk
151 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing 151 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing
@@ -204,7 +204,7 @@ ENTRY(sys_call_table)
204 * Special system call wrappers 204 * Special system call wrappers
205 */ 205 */
206@ r0 = syscall number 206@ r0 = syscall number
207@ r5 = syscall table 207@ r8 = syscall table
208 .type sys_syscall, #function 208 .type sys_syscall, #function
209sys_syscall: 209sys_syscall:
210 eor scno, r0, #__NR_SYSCALL_BASE 210 eor scno, r0, #__NR_SYSCALL_BASE
@@ -255,22 +255,6 @@ sys_sigaltstack_wrapper:
255 ldr r2, [sp, #S_OFF + S_SP] 255 ldr r2, [sp, #S_OFF + S_SP]
256 b do_sigaltstack 256 b do_sigaltstack
257 257
258sys_futex_wrapper:
259 str r5, [sp, #4] @ push sixth arg
260 b sys_futex
261
262sys_arm_fadvise64_64_wrapper:
263 str r5, [sp, #4] @ push r5 to stack
264 b sys_arm_fadvise64_64
265
266sys_mbind_wrapper:
267 str r5, [sp, #4]
268 b sys_mbind
269
270sys_ipc_wrapper:
271 str r5, [sp, #4] @ push sixth arg
272 b sys_ipc
273
274/* 258/*
275 * Note: off_4k (r5) is always units of 4K. If we can't do the requested 259 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
276 * offset, we return EINVAL. 260 * offset, we return EINVAL.
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c
index 8498b5ac3955..247fde76aaed 100644
--- a/arch/i386/mm/ioremap.c
+++ b/arch/i386/mm/ioremap.c
@@ -245,7 +245,7 @@ void iounmap(volatile void __iomem *addr)
245 addr < phys_to_virt(ISA_END_ADDRESS)) 245 addr < phys_to_virt(ISA_END_ADDRESS))
246 return; 246 return;
247 247
248 addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr); 248 addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);
249 249
250 /* Use the vm area unlocked, assuming the caller 250 /* Use the vm area unlocked, assuming the caller
251 ensures there isn't another iounmap for the same address 251 ensures there isn't another iounmap for the same address
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 08a084901212..4bb4d4b0f73a 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -155,7 +155,7 @@ static __init void unreachable_devices(void)
155 addr = get_base_addr(0, 0, PCI_DEVFN(i, 0)); 155 addr = get_base_addr(0, 0, PCI_DEVFN(i, 0));
156 if (addr != 0) 156 if (addr != 0)
157 pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0)); 157 pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0));
158 if (addr == 0 || readl((u32 *)addr) != val1) 158 if (addr == 0 || readl((u32 __iomem *)mmcfg_virt_addr) != val1)
159 set_bit(i, fallback_slots); 159 set_bit(i, fallback_slots);
160 spin_unlock_irqrestore(&pci_config_lock, flags); 160 spin_unlock_irqrestore(&pci_config_lock, flags);
161 } 161 }
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index e1924cc9687b..ff8bb3770c9d 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -113,7 +113,7 @@ CONFIG_IOSAPIC=y
113CONFIG_IA64_SGI_SN_XP=m 113CONFIG_IA64_SGI_SN_XP=m
114CONFIG_FORCE_MAX_ZONEORDER=17 114CONFIG_FORCE_MAX_ZONEORDER=17
115CONFIG_SMP=y 115CONFIG_SMP=y
116CONFIG_NR_CPUS=512 116CONFIG_NR_CPUS=1024
117# CONFIG_HOTPLUG_CPU is not set 117# CONFIG_HOTPLUG_CPU is not set
118CONFIG_SCHED_SMT=y 118CONFIG_SCHED_SMT=y
119CONFIG_PREEMPT=y 119CONFIG_PREEMPT=y
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 5b7e736f3b49..028a2b95936c 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -249,3 +249,32 @@ time_init (void)
249 */ 249 */
250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); 250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
251} 251}
252
253#define SMALLUSECS 100
254
255void
256udelay (unsigned long usecs)
257{
258 unsigned long start;
259 unsigned long cycles;
260 unsigned long smallusecs;
261
262 /*
263 * Execute the non-preemptible delay loop (because the ITC might
264 * not be synchronized between CPUS) in relatively short time
265 * chunks, allowing preemption between the chunks.
266 */
267 while (usecs > 0) {
268 smallusecs = (usecs > SMALLUSECS) ? SMALLUSECS : usecs;
269 preempt_disable();
270 cycles = smallusecs*local_cpu_data->cyc_per_usec;
271 start = ia64_get_itc();
272
273 while (ia64_get_itc() - start < cycles)
274 cpu_relax();
275
276 preempt_enable();
277 usecs -= smallusecs;
278 }
279}
280EXPORT_SYMBOL(udelay);
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index c6d40446c2c4..b631cf86ed44 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -53,7 +53,7 @@ static void uncached_ipi_visibility(void *data)
53 if ((status != PAL_VISIBILITY_OK) && 53 if ((status != PAL_VISIBILITY_OK) &&
54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED)) 54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
55 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on " 55 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "
56 "CPU %i\n", status, get_cpu()); 56 "CPU %i\n", status, raw_smp_processor_id());
57} 57}
58 58
59 59
@@ -63,7 +63,7 @@ static void uncached_ipi_mc_drain(void *data)
63 status = ia64_pal_mc_drain(); 63 status = ia64_pal_mc_drain();
64 if (status) 64 if (status)
65 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on " 65 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "
66 "CPU %i\n", status, get_cpu()); 66 "CPU %i\n", status, raw_smp_processor_id());
67} 67}
68 68
69 69
@@ -105,7 +105,7 @@ uncached_get_new_chunk(struct gen_pool *poolp)
105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL); 105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
106 106
107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n", 107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n",
108 status, get_cpu()); 108 status, raw_smp_processor_id());
109 109
110 if (!status) { 110 if (!status) {
111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1); 111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 30d8564e9603..73af6267d2ef 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -177,6 +177,9 @@ SECTIONS
177 } 177 }
178 . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose kernel data */ 178 . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose kernel data */
179 179
180 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
181 { *(.data.read_mostly) }
182
180 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) 183 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET)
181 { *(.data.cacheline_aligned) } 184 { *(.data.cacheline_aligned) }
182 185
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index 5d54f5f4e926..471bbaa65d1b 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -202,7 +202,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
202 unsigned long end, unsigned long nbits) 202 unsigned long end, unsigned long nbits)
203{ 203{
204 int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0; 204 int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0;
205 int mymm = (mm == current->active_mm); 205 int mymm = (mm == current->active_mm && current->mm);
206 volatile unsigned long *ptc0, *ptc1; 206 volatile unsigned long *ptc0, *ptc1;
207 unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value; 207 unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value;
208 short nasids[MAX_NUMNODES], nix; 208 short nasids[MAX_NUMNODES], nix;
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_reg.c b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
index 5d534091262c..79fdb91d7259 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_reg.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
@@ -25,7 +25,7 @@ union br_ptr {
25 */ 25 */
26void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) 26void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
27{ 27{
28 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 28 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
29 29
30 if (pcibus_info) { 30 if (pcibus_info) {
31 switch (pcibus_info->pbi_bridge_type) { 31 switch (pcibus_info->pbi_bridge_type) {
@@ -38,14 +38,14 @@ void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
38 default: 38 default:
39 panic 39 panic
40 ("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p", 40 ("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p",
41 (void *)ptr); 41 ptr);
42 } 42 }
43 } 43 }
44} 44}
45 45
46void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) 46void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
47{ 47{
48 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 48 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
49 49
50 if (pcibus_info) { 50 if (pcibus_info) {
51 switch (pcibus_info->pbi_bridge_type) { 51 switch (pcibus_info->pbi_bridge_type) {
@@ -58,7 +58,7 @@ void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
58 default: 58 default:
59 panic 59 panic
60 ("pcireg_control_bit_set: unknown bridgetype bridge 0x%p", 60 ("pcireg_control_bit_set: unknown bridgetype bridge 0x%p",
61 (void *)ptr); 61 ptr);
62 } 62 }
63 } 63 }
64} 64}
@@ -68,7 +68,7 @@ void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
68 */ 68 */
69uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info) 69uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info)
70{ 70{
71 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 71 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
72 uint64_t ret = 0; 72 uint64_t ret = 0;
73 73
74 if (pcibus_info) { 74 if (pcibus_info) {
@@ -82,7 +82,7 @@ uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info)
82 default: 82 default:
83 panic 83 panic
84 ("pcireg_tflush_get: unknown bridgetype bridge 0x%p", 84 ("pcireg_tflush_get: unknown bridgetype bridge 0x%p",
85 (void *)ptr); 85 ptr);
86 } 86 }
87 } 87 }
88 88
@@ -98,7 +98,7 @@ uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info)
98 */ 98 */
99uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info) 99uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info)
100{ 100{
101 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 101 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
102 uint64_t ret = 0; 102 uint64_t ret = 0;
103 103
104 if (pcibus_info) { 104 if (pcibus_info) {
@@ -112,7 +112,7 @@ uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info)
112 default: 112 default:
113 panic 113 panic
114 ("pcireg_intr_status_get: unknown bridgetype bridge 0x%p", 114 ("pcireg_intr_status_get: unknown bridgetype bridge 0x%p",
115 (void *)ptr); 115 ptr);
116 } 116 }
117 } 117 }
118 return ret; 118 return ret;
@@ -123,7 +123,7 @@ uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info)
123 */ 123 */
124void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) 124void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
125{ 125{
126 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 126 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
127 127
128 if (pcibus_info) { 128 if (pcibus_info) {
129 switch (pcibus_info->pbi_bridge_type) { 129 switch (pcibus_info->pbi_bridge_type) {
@@ -136,14 +136,14 @@ void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
136 default: 136 default:
137 panic 137 panic
138 ("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p", 138 ("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p",
139 (void *)ptr); 139 ptr);
140 } 140 }
141 } 141 }
142} 142}
143 143
144void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) 144void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
145{ 145{
146 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 146 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
147 147
148 if (pcibus_info) { 148 if (pcibus_info) {
149 switch (pcibus_info->pbi_bridge_type) { 149 switch (pcibus_info->pbi_bridge_type) {
@@ -156,7 +156,7 @@ void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
156 default: 156 default:
157 panic 157 panic
158 ("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p", 158 ("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p",
159 (void *)ptr); 159 ptr);
160 } 160 }
161 } 161 }
162} 162}
@@ -167,7 +167,7 @@ void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
167void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n, 167void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
168 uint64_t addr) 168 uint64_t addr)
169{ 169{
170 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 170 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
171 171
172 if (pcibus_info) { 172 if (pcibus_info) {
173 switch (pcibus_info->pbi_bridge_type) { 173 switch (pcibus_info->pbi_bridge_type) {
@@ -186,7 +186,7 @@ void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
186 default: 186 default:
187 panic 187 panic
188 ("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p", 188 ("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p",
189 (void *)ptr); 189 ptr);
190 } 190 }
191 } 191 }
192} 192}
@@ -196,7 +196,7 @@ void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
196 */ 196 */
197void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n) 197void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n)
198{ 198{
199 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 199 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
200 200
201 if (pcibus_info) { 201 if (pcibus_info) {
202 switch (pcibus_info->pbi_bridge_type) { 202 switch (pcibus_info->pbi_bridge_type) {
@@ -209,7 +209,7 @@ void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n)
209 default: 209 default:
210 panic 210 panic
211 ("pcireg_force_intr_set: unknown bridgetype bridge 0x%p", 211 ("pcireg_force_intr_set: unknown bridgetype bridge 0x%p",
212 (void *)ptr); 212 ptr);
213 } 213 }
214 } 214 }
215} 215}
@@ -219,7 +219,7 @@ void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n)
219 */ 219 */
220uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device) 220uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
221{ 221{
222 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 222 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
223 uint64_t ret = 0; 223 uint64_t ret = 0;
224 224
225 if (pcibus_info) { 225 if (pcibus_info) {
@@ -233,7 +233,7 @@ uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
233 __sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]); 233 __sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]);
234 break; 234 break;
235 default: 235 default:
236 panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", (void *)ptr); 236 panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", ptr);
237 } 237 }
238 238
239 } 239 }
@@ -244,7 +244,7 @@ uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
244void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index, 244void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index,
245 uint64_t val) 245 uint64_t val)
246{ 246{
247 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 247 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
248 248
249 if (pcibus_info) { 249 if (pcibus_info) {
250 switch (pcibus_info->pbi_bridge_type) { 250 switch (pcibus_info->pbi_bridge_type) {
@@ -257,15 +257,15 @@ void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index,
257 default: 257 default:
258 panic 258 panic
259 ("pcireg_int_ate_set: unknown bridgetype bridge 0x%p", 259 ("pcireg_int_ate_set: unknown bridgetype bridge 0x%p",
260 (void *)ptr); 260 ptr);
261 } 261 }
262 } 262 }
263} 263}
264 264
265uint64_t *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index) 265uint64_t __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
266{ 266{
267 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 267 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
268 uint64_t *ret = (uint64_t *) 0; 268 uint64_t __iomem *ret = NULL;
269 269
270 if (pcibus_info) { 270 if (pcibus_info) {
271 switch (pcibus_info->pbi_bridge_type) { 271 switch (pcibus_info->pbi_bridge_type) {
@@ -278,7 +278,7 @@ uint64_t *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
278 default: 278 default:
279 panic 279 panic
280 ("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p", 280 ("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p",
281 (void *)ptr); 281 ptr);
282 } 282 }
283 } 283 }
284 return ret; 284 return ret;
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 46b646a6d345..27aa1842dacc 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -38,10 +38,10 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
38 uint64_t offset; 38 uint64_t offset;
39 struct page *tmp; 39 struct page *tmp;
40 struct tioca_common *tioca_common; 40 struct tioca_common *tioca_common;
41 struct tioca *ca_base; 41 struct tioca __iomem *ca_base;
42 42
43 tioca_common = tioca_kern->ca_common; 43 tioca_common = tioca_kern->ca_common;
44 ca_base = (struct tioca *)tioca_common->ca_common.bs_base; 44 ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base;
45 45
46 if (list_empty(tioca_kern->ca_devices)) 46 if (list_empty(tioca_kern->ca_devices))
47 return 0; 47 return 0;
@@ -215,7 +215,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
215{ 215{
216 int cap_ptr; 216 int cap_ptr;
217 uint32_t reg; 217 uint32_t reg;
218 struct tioca *tioca_base; 218 struct tioca __iomem *tioca_base;
219 struct pci_dev *pdev; 219 struct pci_dev *pdev;
220 struct tioca_common *common; 220 struct tioca_common *common;
221 221
@@ -257,7 +257,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
257 * Set ca's fw to match 257 * Set ca's fw to match
258 */ 258 */
259 259
260 tioca_base = (struct tioca *)common->ca_common.bs_base; 260 tioca_base = (struct tioca __iomem*)common->ca_common.bs_base;
261 __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE); 261 __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE);
262} 262}
263 263
@@ -322,7 +322,7 @@ static uint64_t
322tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr) 322tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
323{ 323{
324 struct tioca_common *tioca_common; 324 struct tioca_common *tioca_common;
325 struct tioca *ca_base; 325 struct tioca __iomem *ca_base;
326 uint64_t ct_addr; 326 uint64_t ct_addr;
327 dma_addr_t bus_addr; 327 dma_addr_t bus_addr;
328 uint32_t node_upper; 328 uint32_t node_upper;
@@ -330,7 +330,7 @@ tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
330 struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev); 330 struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev);
331 331
332 tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info; 332 tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info;
333 ca_base = (struct tioca *)tioca_common->ca_common.bs_base; 333 ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base;
334 334
335 ct_addr = PHYS_TO_TIODMA(paddr); 335 ct_addr = PHYS_TO_TIODMA(paddr);
336 if (!ct_addr) 336 if (!ct_addr)
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index f72ced11212d..91b93d917b64 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -247,7 +247,7 @@ long ppc64_personality(unsigned long personality)
247#define OVERRIDE_MACHINE 0 247#define OVERRIDE_MACHINE 0
248#endif 248#endif
249 249
250static inline int override_machine(char *mach) 250static inline int override_machine(char __user *mach)
251{ 251{
252 if (OVERRIDE_MACHINE) { 252 if (OVERRIDE_MACHINE) {
253 /* change ppc64 to ppc */ 253 /* change ppc64 to ppc */
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c
index f15e64285f96..05ccd598dd4e 100644
--- a/arch/ppc/syslib/ppc4xx_dma.c
+++ b/arch/ppc/syslib/ppc4xx_dma.c
@@ -30,6 +30,7 @@
30 30
31#include <asm/system.h> 31#include <asm/system.h>
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/dma.h>
33#include <asm/ppc4xx_dma.h> 34#include <asm/ppc4xx_dma.h>
34 35
35ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS]; 36ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS];
diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c
index 1754192c69d0..5c3529ceb5d6 100644
--- a/arch/sparc/kernel/ebus.c
+++ b/arch/sparc/kernel/ebus.c
@@ -22,7 +22,7 @@
22#include <asm/oplib.h> 22#include <asm/oplib.h>
23#include <asm/bpp.h> 23#include <asm/bpp.h>
24 24
25struct linux_ebus *ebus_chain = 0; 25struct linux_ebus *ebus_chain = NULL;
26 26
27/* We are together with pcic.c under CONFIG_PCI. */ 27/* We are together with pcic.c under CONFIG_PCI. */
28extern unsigned int pcic_pin_to_irq(unsigned int, char *name); 28extern unsigned int pcic_pin_to_irq(unsigned int, char *name);
@@ -46,7 +46,7 @@ static struct ebus_device_irq je1_1[] = {
46 { "SUNW,CS4231", 0 }, 46 { "SUNW,CS4231", 0 },
47 { "parallel", 0 }, 47 { "parallel", 0 },
48 { "se", 2 }, 48 { "se", 2 },
49 { 0, 0 } 49 { NULL, 0 }
50}; 50};
51 51
52/* 52/*
@@ -55,7 +55,7 @@ static struct ebus_device_irq je1_1[] = {
55 */ 55 */
56static struct ebus_system_entry ebus_blacklist[] = { 56static struct ebus_system_entry ebus_blacklist[] = {
57 { "SUNW,JavaEngine1", je1_1 }, 57 { "SUNW,JavaEngine1", je1_1 },
58 { 0, 0 } 58 { NULL, NULL }
59}; 59};
60 60
61static struct ebus_device_irq *ebus_blackp = NULL; 61static struct ebus_device_irq *ebus_blackp = NULL;
@@ -233,7 +233,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
233 ebus_alloc(sizeof(struct linux_ebus_child)); 233 ebus_alloc(sizeof(struct linux_ebus_child));
234 234
235 child = dev->children; 235 child = dev->children;
236 child->next = 0; 236 child->next = NULL;
237 child->parent = dev; 237 child->parent = dev;
238 child->bus = dev->bus; 238 child->bus = dev->bus;
239 fill_ebus_child(node, &regs[0], child); 239 fill_ebus_child(node, &regs[0], child);
@@ -243,7 +243,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
243 ebus_alloc(sizeof(struct linux_ebus_child)); 243 ebus_alloc(sizeof(struct linux_ebus_child));
244 244
245 child = child->next; 245 child = child->next;
246 child->next = 0; 246 child->next = NULL;
247 child->parent = dev; 247 child->parent = dev;
248 child->bus = dev->bus; 248 child->bus = dev->bus;
249 fill_ebus_child(node, &regs[0], child); 249 fill_ebus_child(node, &regs[0], child);
@@ -275,7 +275,7 @@ void __init ebus_init(void)
275 } 275 }
276 } 276 }
277 277
278 pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, 0); 278 pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, NULL);
279 if (!pdev) { 279 if (!pdev) {
280 return; 280 return;
281 } 281 }
@@ -284,7 +284,7 @@ void __init ebus_init(void)
284 284
285 ebus_chain = ebus = (struct linux_ebus *) 285 ebus_chain = ebus = (struct linux_ebus *)
286 ebus_alloc(sizeof(struct linux_ebus)); 286 ebus_alloc(sizeof(struct linux_ebus));
287 ebus->next = 0; 287 ebus->next = NULL;
288 288
289 while (ebusnd) { 289 while (ebusnd) {
290 290
@@ -325,8 +325,8 @@ void __init ebus_init(void)
325 ebus_alloc(sizeof(struct linux_ebus_device)); 325 ebus_alloc(sizeof(struct linux_ebus_device));
326 326
327 dev = ebus->devices; 327 dev = ebus->devices;
328 dev->next = 0; 328 dev->next = NULL;
329 dev->children = 0; 329 dev->children = NULL;
330 dev->bus = ebus; 330 dev->bus = ebus;
331 fill_ebus_device(nd, dev); 331 fill_ebus_device(nd, dev);
332 332
@@ -335,8 +335,8 @@ void __init ebus_init(void)
335 ebus_alloc(sizeof(struct linux_ebus_device)); 335 ebus_alloc(sizeof(struct linux_ebus_device));
336 336
337 dev = dev->next; 337 dev = dev->next;
338 dev->next = 0; 338 dev->next = NULL;
339 dev->children = 0; 339 dev->children = NULL;
340 dev->bus = ebus; 340 dev->bus = ebus;
341 fill_ebus_device(nd, dev); 341 fill_ebus_device(nd, dev);
342 } 342 }
@@ -353,7 +353,7 @@ void __init ebus_init(void)
353 ebus->next = (struct linux_ebus *) 353 ebus->next = (struct linux_ebus *)
354 ebus_alloc(sizeof(struct linux_ebus)); 354 ebus_alloc(sizeof(struct linux_ebus));
355 ebus = ebus->next; 355 ebus = ebus->next;
356 ebus->next = 0; 356 ebus->next = NULL;
357 ++num_ebus; 357 ++num_ebus;
358 } 358 }
359 if (pdev) 359 if (pdev)
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c
index 2a3afca453c9..313d1620ae8e 100644
--- a/arch/sparc/kernel/led.c
+++ b/arch/sparc/kernel/led.c
@@ -55,7 +55,7 @@ static int led_read_proc(char *buf, char **start, off_t offset, int count,
55 return len; 55 return len;
56} 56}
57 57
58static int led_write_proc(struct file *file, const char *buffer, 58static int led_write_proc(struct file *file, const char __user *buffer,
59 unsigned long count, void *data) 59 unsigned long count, void *data)
60{ 60{
61 char *buf = NULL; 61 char *buf = NULL;
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index cccfc12802ed..42002b742deb 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -161,7 +161,7 @@ static struct pcic_sn2list pcic_known_sysnames[] = {
161static int pcic0_up; 161static int pcic0_up;
162static struct linux_pcic pcic0; 162static struct linux_pcic pcic0;
163 163
164void * __iomem pcic_regs; 164void __iomem *pcic_regs;
165volatile int pcic_speculative; 165volatile int pcic_speculative;
166volatile int pcic_trapped; 166volatile int pcic_trapped;
167 167
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 24814d58f9e1..7dadcdb4ca42 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -49,7 +49,7 @@ DEFINE_SPINLOCK(rtc_lock);
49enum sparc_clock_type sp_clock_typ; 49enum sparc_clock_type sp_clock_typ;
50DEFINE_SPINLOCK(mostek_lock); 50DEFINE_SPINLOCK(mostek_lock);
51void __iomem *mstk48t02_regs = NULL; 51void __iomem *mstk48t02_regs = NULL;
52static struct mostek48t08 *mstk48t08_regs = NULL; 52static struct mostek48t08 __iomem *mstk48t08_regs = NULL;
53static int set_rtc_mmss(unsigned long); 53static int set_rtc_mmss(unsigned long);
54static int sbus_do_settimeofday(struct timespec *tv); 54static int sbus_do_settimeofday(struct timespec *tv);
55 55
@@ -342,7 +342,7 @@ static __inline__ void clock_probe(void)
342 /* XXX r/o attribute is somewhere in r.flags */ 342 /* XXX r/o attribute is somewhere in r.flags */
343 r.flags = clk_reg[0].which_io; 343 r.flags = clk_reg[0].which_io;
344 r.start = clk_reg[0].phys_addr; 344 r.start = clk_reg[0].phys_addr;
345 mstk48t08_regs = (struct mostek48t08 *) sbus_ioremap(&r, 0, 345 mstk48t08_regs = sbus_ioremap(&r, 0,
346 sizeof(struct mostek48t08), "mk48t08"); 346 sizeof(struct mostek48t08), "mk48t08");
347 347
348 mstk48t02_regs = &mstk48t08_regs->regs; 348 mstk48t02_regs = &mstk48t08_regs->regs;
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index 1d560390e282..731f19603cad 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -497,7 +497,7 @@ static void __init sun4c_probe_mmu(void)
497 patch_kernel_fault_handler(); 497 patch_kernel_fault_handler();
498} 498}
499 499
500volatile unsigned long *sun4c_memerr_reg = NULL; 500volatile unsigned long __iomem *sun4c_memerr_reg = NULL;
501 501
502void __init sun4c_probe_memerr_reg(void) 502void __init sun4c_probe_memerr_reg(void)
503{ 503{
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 563301fe5df8..1eb21de9d1b5 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -289,6 +289,8 @@ source "arch/um/Kconfig.net"
289 289
290source "drivers/net/Kconfig" 290source "drivers/net/Kconfig"
291 291
292source "drivers/connector/Kconfig"
293
292source "fs/Kconfig" 294source "fs/Kconfig"
293 295
294source "security/Kconfig" 296source "security/Kconfig"
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index 4f118d5cc2ee..38df311e75dc 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -12,3 +12,7 @@ CHECKFLAGS += -m64
12 12
13ELF_ARCH := i386:x86-64 13ELF_ARCH := i386:x86-64
14ELF_FORMAT := elf64-x86-64 14ELF_FORMAT := elf64-x86-64
15
16# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
17
18LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
diff --git a/arch/um/include/sysdep-i386/stub.h b/arch/um/include/sysdep-i386/stub.h
index 6ba8cbbe0d36..b492b12b4a10 100644
--- a/arch/um/include/sysdep-i386/stub.h
+++ b/arch/um/include/sysdep-i386/stub.h
@@ -6,8 +6,12 @@
6#ifndef __SYSDEP_STUB_H 6#ifndef __SYSDEP_STUB_H
7#define __SYSDEP_STUB_H 7#define __SYSDEP_STUB_H
8 8
9#include <sys/mman.h>
9#include <asm/ptrace.h> 10#include <asm/ptrace.h>
10#include <asm/unistd.h> 11#include <asm/unistd.h>
12#include "stub-data.h"
13#include "kern_constants.h"
14#include "uml-config.h"
11 15
12extern void stub_segv_handler(int sig); 16extern void stub_segv_handler(int sig);
13extern void stub_clone_handler(void); 17extern void stub_clone_handler(void);
@@ -76,23 +80,22 @@ static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3,
76 return ret; 80 return ret;
77} 81}
78 82
79static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 83static inline void trap_myself(void)
80 long arg4, long arg5, long arg6)
81{ 84{
82 long ret; 85 __asm("int3");
83
84 __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; "
85 "int $0x80 ; pop %%ebp"
86 : "=a" (ret)
87 : "g" (syscall), "b" (arg1), "c" (arg2), "d" (arg3),
88 "S" (arg4), "D" (arg5), "0" (arg6));
89
90 return ret;
91} 86}
92 87
93static inline void trap_myself(void) 88static inline void remap_stack(int fd, unsigned long offset)
94{ 89{
95 __asm("int3"); 90 __asm__ volatile ("movl %%eax,%%ebp ; movl %0,%%eax ; int $0x80 ;"
91 "movl %7, %%ebx ; movl %%eax, (%%ebx)"
92 : : "g" (STUB_MMAP_NR), "b" (UML_CONFIG_STUB_DATA),
93 "c" (UM_KERN_PAGE_SIZE),
94 "d" (PROT_READ | PROT_WRITE),
95 "S" (MAP_FIXED | MAP_SHARED), "D" (fd),
96 "a" (offset),
97 "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err)
98 : "memory");
96} 99}
97 100
98#endif 101#endif
diff --git a/arch/um/include/sysdep-x86_64/stub.h b/arch/um/include/sysdep-x86_64/stub.h
index c41689c13dc9..92e989f81761 100644
--- a/arch/um/include/sysdep-x86_64/stub.h
+++ b/arch/um/include/sysdep-x86_64/stub.h
@@ -6,8 +6,12 @@
6#ifndef __SYSDEP_STUB_H 6#ifndef __SYSDEP_STUB_H
7#define __SYSDEP_STUB_H 7#define __SYSDEP_STUB_H
8 8
9#include <sys/mman.h>
9#include <asm/unistd.h> 10#include <asm/unistd.h>
10#include <sysdep/ptrace_user.h> 11#include <sysdep/ptrace_user.h>
12#include "stub-data.h"
13#include "kern_constants.h"
14#include "uml-config.h"
11 15
12extern void stub_segv_handler(int sig); 16extern void stub_segv_handler(int sig);
13extern void stub_clone_handler(void); 17extern void stub_clone_handler(void);
@@ -81,23 +85,23 @@ static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3,
81 return ret; 85 return ret;
82} 86}
83 87
84static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 88static inline void trap_myself(void)
85 long arg4, long arg5, long arg6)
86{ 89{
87 long ret; 90 __asm("int3");
88
89 __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; "
90 "movq %7, %%r9; " __syscall : "=a" (ret)
91 : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3),
92 "g" (arg4), "g" (arg5), "g" (arg6)
93 : __syscall_clobber, "r10", "r8", "r9" );
94
95 return ret;
96} 91}
97 92
98static inline void trap_myself(void) 93static inline void remap_stack(long fd, unsigned long offset)
99{ 94{
100 __asm("int3"); 95 __asm__ volatile ("movq %4,%%r10 ; movq %5,%%r8 ; "
96 "movq %6, %%r9; " __syscall "; movq %7, %%rbx ; "
97 "movq %%rax, (%%rbx)":
98 : "a" (STUB_MMAP_NR), "D" (UML_CONFIG_STUB_DATA),
99 "S" (UM_KERN_PAGE_SIZE),
100 "d" (PROT_READ | PROT_WRITE),
101 "g" (MAP_FIXED | MAP_SHARED), "g" (fd),
102 "g" (offset),
103 "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err)
104 : __syscall_clobber, "r10", "r8", "r9" );
101} 105}
102 106
103#endif 107#endif
diff --git a/arch/um/kernel/skas/clone.c b/arch/um/kernel/skas/clone.c
index cb37ce9124a6..47b812b3bca8 100644
--- a/arch/um/kernel/skas/clone.c
+++ b/arch/um/kernel/skas/clone.c
@@ -18,11 +18,10 @@
18 * on some systems. 18 * on some systems.
19 */ 19 */
20 20
21#define STUB_DATA(field) (((struct stub_data *) UML_CONFIG_STUB_DATA)->field)
22
23void __attribute__ ((__section__ (".__syscall_stub"))) 21void __attribute__ ((__section__ (".__syscall_stub")))
24stub_clone_handler(void) 22stub_clone_handler(void)
25{ 23{
24 struct stub_data *data = (struct stub_data *) UML_CONFIG_STUB_DATA;
26 long err; 25 long err;
27 26
28 err = stub_syscall2(__NR_clone, CLONE_PARENT | CLONE_FILES | SIGCHLD, 27 err = stub_syscall2(__NR_clone, CLONE_PARENT | CLONE_FILES | SIGCHLD,
@@ -35,17 +34,21 @@ stub_clone_handler(void)
35 if(err) 34 if(err)
36 goto out; 35 goto out;
37 36
38 err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL, 37 err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL,
39 (long) &STUB_DATA(timer), 0); 38 (long) &data->timer, 0);
40 if(err) 39 if(err)
41 goto out; 40 goto out;
42 41
43 err = stub_syscall6(STUB_MMAP_NR, UML_CONFIG_STUB_DATA, 42 remap_stack(data->fd, data->offset);
44 UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, 43 goto done;
45 MAP_FIXED | MAP_SHARED, STUB_DATA(fd), 44
46 STUB_DATA(offset));
47 out: 45 out:
48 /* save current result. Parent: pid; child: retcode of mmap */ 46 /* save current result.
49 STUB_DATA(err) = err; 47 * Parent: pid;
48 * child: retcode of mmap already saved and it jumps around this
49 * assignment
50 */
51 data->err = err;
52 done:
50 trap_myself(); 53 trap_myself();
51} 54}
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index b3fbf125709b..2e41cabd3d93 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -21,11 +21,6 @@ define unprofile
21endef 21endef
22 22
23 23
24# The stubs and unmap.o can't try to call mcount or update basic block data
25define unprofile
26 $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
27endef
28
29# cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If 24# cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If
30# so, it's considered to be a path relative to $(srcdir) rather than 25# so, it's considered to be a path relative to $(srcdir) rather than
31# $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from 26# $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c
index 0d260e4492f7..ae207064201e 100644
--- a/arch/x86_64/mm/ioremap.c
+++ b/arch/x86_64/mm/ioremap.c
@@ -263,7 +263,7 @@ void iounmap(volatile void __iomem *addr)
263 addr < phys_to_virt(ISA_END_ADDRESS)) 263 addr < phys_to_virt(ISA_END_ADDRESS))
264 return; 264 return;
265 265
266 addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr); 266 addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);
267 /* Use the vm area unlocked, assuming the caller 267 /* Use the vm area unlocked, assuming the caller
268 ensures there isn't another iounmap for the same address 268 ensures there isn't another iounmap for the same address
269 in parallel. Reuse of the virtual address is prevented by 269 in parallel. Reuse of the virtual address is prevented by
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 9c4f907e301c..f16c0d57c552 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -18,11 +18,11 @@ static DECLARE_BITMAP(fallback_slots, 32);
18/* Static virtual mapping of the MMCONFIG aperture */ 18/* Static virtual mapping of the MMCONFIG aperture */
19struct mmcfg_virt { 19struct mmcfg_virt {
20 struct acpi_table_mcfg_config *cfg; 20 struct acpi_table_mcfg_config *cfg;
21 char *virt; 21 char __iomem *virt;
22}; 22};
23static struct mmcfg_virt *pci_mmcfg_virt; 23static struct mmcfg_virt *pci_mmcfg_virt;
24 24
25static char *get_virt(unsigned int seg, unsigned bus) 25static char __iomem *get_virt(unsigned int seg, unsigned bus)
26{ 26{
27 int cfg_num = -1; 27 int cfg_num = -1;
28 struct acpi_table_mcfg_config *cfg; 28 struct acpi_table_mcfg_config *cfg;
@@ -43,9 +43,9 @@ static char *get_virt(unsigned int seg, unsigned bus)
43 } 43 }
44} 44}
45 45
46static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) 46static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
47{ 47{
48 char *addr; 48 char __iomem *addr;
49 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots)) 49 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots))
50 return NULL; 50 return NULL;
51 addr = get_virt(seg, bus); 51 addr = get_virt(seg, bus);
@@ -57,7 +57,7 @@ static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn
57static int pci_mmcfg_read(unsigned int seg, unsigned int bus, 57static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
58 unsigned int devfn, int reg, int len, u32 *value) 58 unsigned int devfn, int reg, int len, u32 *value)
59{ 59{
60 char *addr; 60 char __iomem *addr;
61 61
62 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ 62 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
63 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095))) 63 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095)))
@@ -85,7 +85,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
85static int pci_mmcfg_write(unsigned int seg, unsigned int bus, 85static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
86 unsigned int devfn, int reg, int len, u32 value) 86 unsigned int devfn, int reg, int len, u32 value)
87{ 87{
88 char *addr; 88 char __iomem *addr;
89 89
90 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ 90 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
91 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) 91 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
@@ -127,7 +127,7 @@ static __init void unreachable_devices(void)
127 int i; 127 int i;
128 for (i = 0; i < 32; i++) { 128 for (i = 0; i < 32; i++) {
129 u32 val1; 129 u32 val1;
130 char *addr; 130 char __iomem *addr;
131 131
132 pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1); 132 pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1);
133 if (val1 == 0xffffffff) 133 if (val1 == 0xffffffff)
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 382dea7b224c..6e7db2e79f42 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -442,11 +442,37 @@ error:
442 return err; 442 return err;
443} 443}
444 444
445
446/* Send basic block requests */
447static int __blk_send_generic(request_queue_t *q, struct gendisk *bd_disk, int cmd, int data)
448{
449 struct request *rq;
450 int err;
451
452 rq = blk_get_request(q, WRITE, __GFP_WAIT);
453 rq->flags |= REQ_BLOCK_PC;
454 rq->data = NULL;
455 rq->data_len = 0;
456 rq->timeout = BLK_DEFAULT_TIMEOUT;
457 memset(rq->cmd, 0, sizeof(rq->cmd));
458 rq->cmd[0] = cmd;
459 rq->cmd[4] = data;
460 rq->cmd_len = 6;
461 err = blk_execute_rq(q, bd_disk, rq, 0);
462 blk_put_request(rq);
463
464 return err;
465}
466
467static inline int blk_send_start_stop(request_queue_t *q, struct gendisk *bd_disk, int data)
468{
469 return __blk_send_generic(q, bd_disk, GPCMD_START_STOP_UNIT, data);
470}
471
445int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg) 472int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
446{ 473{
447 request_queue_t *q; 474 request_queue_t *q;
448 struct request *rq; 475 int err;
449 int close = 0, err;
450 476
451 q = bd_disk->queue; 477 q = bd_disk->queue;
452 if (!q) 478 if (!q)
@@ -564,19 +590,10 @@ int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd,
564 err = sg_scsi_ioctl(file, q, bd_disk, arg); 590 err = sg_scsi_ioctl(file, q, bd_disk, arg);
565 break; 591 break;
566 case CDROMCLOSETRAY: 592 case CDROMCLOSETRAY:
567 close = 1; 593 err = blk_send_start_stop(q, bd_disk, 0x03);
594 break;
568 case CDROMEJECT: 595 case CDROMEJECT:
569 rq = blk_get_request(q, WRITE, __GFP_WAIT); 596 err = blk_send_start_stop(q, bd_disk, 0x02);
570 rq->flags |= REQ_BLOCK_PC;
571 rq->data = NULL;
572 rq->data_len = 0;
573 rq->timeout = BLK_DEFAULT_TIMEOUT;
574 memset(rq->cmd, 0, sizeof(rq->cmd));
575 rq->cmd[0] = GPCMD_START_STOP_UNIT;
576 rq->cmd[4] = 0x02 + (close != 0);
577 rq->cmd_len = 6;
578 err = blk_execute_rq(q, bd_disk, rq, 0);
579 blk_put_request(rq);
580 break; 597 break;
581 default: 598 default:
582 err = -ENOTTY; 599 err = -ENOTTY;
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
index d15c194be44a..d1387cfe2d30 100644
--- a/drivers/atm/adummy.c
+++ b/drivers/atm/adummy.c
@@ -123,7 +123,7 @@ static int __init adummy_init(void)
123 } 123 }
124 memset(adummy_dev, 0, sizeof(struct adummy_dev)); 124 memset(adummy_dev, 0, sizeof(struct adummy_dev));
125 125
126 atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, 0); 126 atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, NULL);
127 if (!atm_dev) { 127 if (!atm_dev) {
128 printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); 128 printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n");
129 err = -ENODEV; 129 err = -ENODEV;
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index b7ddd651d664..bc3ca6a656b2 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -28,7 +28,6 @@
28static struct sysdev_class memory_sysdev_class = { 28static struct sysdev_class memory_sysdev_class = {
29 set_kset_name(MEMORY_CLASS_NAME), 29 set_kset_name(MEMORY_CLASS_NAME),
30}; 30};
31EXPORT_SYMBOL(memory_sysdev_class);
32 31
33static char *memory_hotplug_name(struct kset *kset, struct kobject *kobj) 32static char *memory_hotplug_name(struct kset *kset, struct kobject *kobj)
34{ 33{
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index b46a72d782d6..696f72787fe8 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -687,7 +687,7 @@ config NVRAM
687 687
688config RTC 688config RTC
689 tristate "Enhanced Real Time Clock Support" 689 tristate "Enhanced Real Time Clock Support"
690 depends on !PPC32 && !PARISC && !IA64 && !M68K 690 depends on !PPC32 && !PARISC && !IA64 && !M68K && (!(SPARC32 || SPARC64) || PCI)
691 ---help--- 691 ---help---
692 If you say Y here and create a character special file /dev/rtc with 692 If you say Y here and create a character special file /dev/rtc with
693 major number 10 and minor number 135 using mknod ("man mknod"), you 693 major number 10 and minor number 135 using mknod ("man mknod"), you
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 9f2b4efd0c7a..501e557cbc86 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1311,7 +1311,9 @@ static void radeon_set_pcigart(drm_radeon_private_t * dev_priv, int on)
1311 1311
1312static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init) 1312static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
1313{ 1313{
1314 drm_radeon_private_t *dev_priv = dev->dev_private;; 1314 drm_radeon_private_t *dev_priv = dev->dev_private;
1315 unsigned int mem_size;
1316
1315 DRM_DEBUG("\n"); 1317 DRM_DEBUG("\n");
1316 1318
1317 dev_priv->is_pci = init->is_pci; 1319 dev_priv->is_pci = init->is_pci;
@@ -1521,8 +1523,11 @@ static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
1521 + dev_priv->fb_location) >> 10)); 1523 + dev_priv->fb_location) >> 10));
1522 1524
1523 dev_priv->gart_size = init->gart_size; 1525 dev_priv->gart_size = init->gart_size;
1524 dev_priv->gart_vm_start = dev_priv->fb_location 1526
1525 + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2; 1527 mem_size = RADEON_READ(RADEON_CONFIG_MEMSIZE);
1528 if (mem_size == 0)
1529 mem_size = 0x800000;
1530 dev_priv->gart_vm_start = dev_priv->fb_location + mem_size;
1526 1531
1527#if __OS_HAS_AGP 1532#if __OS_HAS_AGP
1528 if (!dev_priv->is_pci) 1533 if (!dev_priv->is_pci)
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
index 7bda7e33d2bd..d92ccee3e54c 100644
--- a/drivers/char/drm/radeon_drv.h
+++ b/drivers/char/drm/radeon_drv.h
@@ -379,6 +379,7 @@ extern int r300_do_cp_cmdbuf(drm_device_t * dev, DRMFILE filp,
379# define RADEON_PLL_WR_EN (1 << 7) 379# define RADEON_PLL_WR_EN (1 << 7)
380#define RADEON_CLOCK_CNTL_INDEX 0x0008 380#define RADEON_CLOCK_CNTL_INDEX 0x0008
381#define RADEON_CONFIG_APER_SIZE 0x0108 381#define RADEON_CONFIG_APER_SIZE 0x0108
382#define RADEON_CONFIG_MEMSIZE 0x00f8
382#define RADEON_CRTC_OFFSET 0x0224 383#define RADEON_CRTC_OFFSET 0x0224
383#define RADEON_CRTC_OFFSET_CNTL 0x0228 384#define RADEON_CRTC_OFFSET_CNTL 0x0228
384# define RADEON_CRTC_TILE_EN (1 << 15) 385# define RADEON_CRTC_TILE_EN (1 << 15)
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 01a1f6badb53..beea450ee4b2 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2399,7 +2399,8 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
2399 new_smi->handlers->cleanup(new_smi->si_sm); 2399 new_smi->handlers->cleanup(new_smi->si_sm);
2400 kfree(new_smi->si_sm); 2400 kfree(new_smi->si_sm);
2401 } 2401 }
2402 new_smi->io_cleanup(new_smi); 2402 if (new_smi->io_cleanup)
2403 new_smi->io_cleanup(new_smi);
2403 2404
2404 return rv; 2405 return rv;
2405} 2406}
@@ -2518,7 +2519,8 @@ static void __exit cleanup_one_si(struct smi_info *to_clean)
2518 2519
2519 kfree(to_clean->si_sm); 2520 kfree(to_clean->si_sm);
2520 2521
2521 to_clean->io_cleanup(to_clean); 2522 if (to_clean->io_cleanup)
2523 to_clean->io_cleanup(to_clean);
2522} 2524}
2523 2525
2524static __exit void cleanup_ipmi_si(void) 2526static __exit void cleanup_ipmi_si(void)
diff --git a/drivers/char/mwave/mwavepub.h b/drivers/char/mwave/mwavepub.h
index f1f9da7a65c1..60c961ae23b4 100644
--- a/drivers/char/mwave/mwavepub.h
+++ b/drivers/char/mwave/mwavepub.h
@@ -69,7 +69,7 @@ typedef struct _MW_ABILITIES {
69typedef struct _MW_READWRITE { 69typedef struct _MW_READWRITE {
70 unsigned short usDspAddress; /* The dsp address */ 70 unsigned short usDspAddress; /* The dsp address */
71 unsigned long ulDataLength; /* The size in bytes of the data or user buffer */ 71 unsigned long ulDataLength; /* The size in bytes of the data or user buffer */
72 void *pBuf; /* Input:variable sized buffer */ 72 void __user *pBuf; /* Input:variable sized buffer */
73} MW_READWRITE, *pMW_READWRITE; 73} MW_READWRITE, *pMW_READWRITE;
74 74
75#define IOCTL_MW_RESET _IO(MWAVE_MINOR,1) 75#define IOCTL_MW_RESET _IO(MWAVE_MINOR,1)
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index ef011ef5dc46..61681c9f3f72 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1444,6 +1444,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
1444 dev_link_t *link; 1444 dev_link_t *link;
1445 int size; 1445 int size;
1446 int rc; 1446 int rc;
1447 void __user *argp = (void __user *)arg;
1447#ifdef PCMCIA_DEBUG 1448#ifdef PCMCIA_DEBUG
1448 char *ioctl_names[CM_IOC_MAXNR + 1] = { 1449 char *ioctl_names[CM_IOC_MAXNR + 1] = {
1449 [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS", 1450 [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS",
@@ -1481,11 +1482,11 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
1481 _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd); 1482 _IOC_DIR(cmd), _IOC_READ, _IOC_WRITE, size, cmd);
1482 1483
1483 if (_IOC_DIR(cmd) & _IOC_READ) { 1484 if (_IOC_DIR(cmd) & _IOC_READ) {
1484 if (!access_ok(VERIFY_WRITE, (void *)arg, size)) 1485 if (!access_ok(VERIFY_WRITE, argp, size))
1485 return -EFAULT; 1486 return -EFAULT;
1486 } 1487 }
1487 if (_IOC_DIR(cmd) & _IOC_WRITE) { 1488 if (_IOC_DIR(cmd) & _IOC_WRITE) {
1488 if (!access_ok(VERIFY_READ, (void *)arg, size)) 1489 if (!access_ok(VERIFY_READ, argp, size))
1489 return -EFAULT; 1490 return -EFAULT;
1490 } 1491 }
1491 1492
@@ -1506,14 +1507,14 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
1506 status |= CM_NO_READER; 1507 status |= CM_NO_READER;
1507 if (test_bit(IS_BAD_CARD, &dev->flags)) 1508 if (test_bit(IS_BAD_CARD, &dev->flags))
1508 status |= CM_BAD_CARD; 1509 status |= CM_BAD_CARD;
1509 if (copy_to_user((int *)arg, &status, sizeof(int))) 1510 if (copy_to_user(argp, &status, sizeof(int)))
1510 return -EFAULT; 1511 return -EFAULT;
1511 } 1512 }
1512 return 0; 1513 return 0;
1513 case CM_IOCGATR: 1514 case CM_IOCGATR:
1514 DEBUGP(4, dev, "... in CM_IOCGATR\n"); 1515 DEBUGP(4, dev, "... in CM_IOCGATR\n");
1515 { 1516 {
1516 struct atreq *atreq = (struct atreq *) arg; 1517 struct atreq __user *atreq = argp;
1517 int tmp; 1518 int tmp;
1518 /* allow nonblocking io and being interrupted */ 1519 /* allow nonblocking io and being interrupted */
1519 if (wait_event_interruptible 1520 if (wait_event_interruptible
@@ -1597,7 +1598,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
1597 { 1598 {
1598 struct ptsreq krnptsreq; 1599 struct ptsreq krnptsreq;
1599 1600
1600 if (copy_from_user(&krnptsreq, (struct ptsreq *) arg, 1601 if (copy_from_user(&krnptsreq, argp,
1601 sizeof(struct ptsreq))) 1602 sizeof(struct ptsreq)))
1602 return -EFAULT; 1603 return -EFAULT;
1603 1604
@@ -1641,7 +1642,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
1641 int old_pc_debug = 0; 1642 int old_pc_debug = 0;
1642 1643
1643 old_pc_debug = pc_debug; 1644 old_pc_debug = pc_debug;
1644 if (copy_from_user(&pc_debug, (int *)arg, sizeof(int))) 1645 if (copy_from_user(&pc_debug, argp, sizeof(int)))
1645 return -EFAULT; 1646 return -EFAULT;
1646 1647
1647 if (old_pc_debug != pc_debug) 1648 if (old_pc_debug != pc_debug)
diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c
index 65830ec71042..b6640606b44d 100644
--- a/drivers/char/watchdog/booke_wdt.c
+++ b/drivers/char/watchdog/booke_wdt.c
@@ -72,7 +72,7 @@ static __inline__ void booke_wdt_ping(void)
72/* 72/*
73 * booke_wdt_write: 73 * booke_wdt_write:
74 */ 74 */
75static ssize_t booke_wdt_write (struct file *file, const char *buf, 75static ssize_t booke_wdt_write (struct file *file, const char __user *buf,
76 size_t count, loff_t *ppos) 76 size_t count, loff_t *ppos)
77{ 77{
78 booke_wdt_ping(); 78 booke_wdt_ping();
@@ -92,14 +92,15 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
92 unsigned int cmd, unsigned long arg) 92 unsigned int cmd, unsigned long arg)
93{ 93{
94 u32 tmp = 0; 94 u32 tmp = 0;
95 u32 __user *p = (u32 __user *)arg;
95 96
96 switch (cmd) { 97 switch (cmd) {
97 case WDIOC_GETSUPPORT: 98 case WDIOC_GETSUPPORT:
98 if (copy_to_user ((struct watchdog_info *) arg, &ident, 99 if (copy_to_user ((struct watchdog_info __user *) arg, &ident,
99 sizeof(struct watchdog_info))) 100 sizeof(struct watchdog_info)))
100 return -EFAULT; 101 return -EFAULT;
101 case WDIOC_GETSTATUS: 102 case WDIOC_GETSTATUS:
102 return put_user(ident.options, (u32 *) arg); 103 return put_user(ident.options, p);
103 case WDIOC_GETBOOTSTATUS: 104 case WDIOC_GETBOOTSTATUS:
104 /* XXX: something is clearing TSR */ 105 /* XXX: something is clearing TSR */
105 tmp = mfspr(SPRN_TSR) & TSR_WRS(3); 106 tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
@@ -109,14 +110,14 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
109 booke_wdt_ping(); 110 booke_wdt_ping();
110 return 0; 111 return 0;
111 case WDIOC_SETTIMEOUT: 112 case WDIOC_SETTIMEOUT:
112 if (get_user(booke_wdt_period, (u32 *) arg)) 113 if (get_user(booke_wdt_period, p))
113 return -EFAULT; 114 return -EFAULT;
114 mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period)); 115 mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period));
115 return 0; 116 return 0;
116 case WDIOC_GETTIMEOUT: 117 case WDIOC_GETTIMEOUT:
117 return put_user(booke_wdt_period, (u32 *) arg); 118 return put_user(booke_wdt_period, p);
118 case WDIOC_SETOPTIONS: 119 case WDIOC_SETOPTIONS:
119 if (get_user(tmp, (u32 *) arg)) 120 if (get_user(tmp, p))
120 return -EINVAL; 121 return -EINVAL;
121 if (tmp == WDIOS_ENABLECARD) { 122 if (tmp == WDIOS_ENABLECARD) {
122 booke_wdt_ping(); 123 booke_wdt_ping();
@@ -172,7 +173,7 @@ static int __init booke_wdt_init(void)
172 int ret = 0; 173 int ret = 0;
173 174
174 printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n"); 175 printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n");
175 ident.firmware_version = cpu_specs[0].pvr_value; 176 ident.firmware_version = cur_cpu_spec->pvr_value;
176 177
177 ret = misc_register(&booke_wdt_miscdev); 178 ret = misc_register(&booke_wdt_miscdev);
178 if (ret) { 179 if (ret) {
diff --git a/drivers/char/watchdog/wdrtas.c b/drivers/char/watchdog/wdrtas.c
index 619e2ffca33f..dacfe31caccf 100644
--- a/drivers/char/watchdog/wdrtas.c
+++ b/drivers/char/watchdog/wdrtas.c
@@ -320,7 +320,7 @@ static int
320wdrtas_ioctl(struct inode *inode, struct file *file, 320wdrtas_ioctl(struct inode *inode, struct file *file,
321 unsigned int cmd, unsigned long arg) 321 unsigned int cmd, unsigned long arg)
322{ 322{
323 int __user *argp = (void *)arg; 323 int __user *argp = (void __user *)arg;
324 int i; 324 int i;
325 static struct watchdog_info wdinfo = { 325 static struct watchdog_info wdinfo = {
326 .options = WDRTAS_SUPPORTED_MASK, 326 .options = WDRTAS_SUPPORTED_MASK,
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
index 6d83299e7c9b..dfedb777d8c9 100644
--- a/drivers/firmware/dell_rbu.c
+++ b/drivers/firmware/dell_rbu.c
@@ -105,8 +105,8 @@ static int create_packet(void *data, size_t length)
105 int ordernum = 0; 105 int ordernum = 0;
106 int retval = 0; 106 int retval = 0;
107 unsigned int packet_array_size = 0; 107 unsigned int packet_array_size = 0;
108 void **invalid_addr_packet_array = 0; 108 void **invalid_addr_packet_array = NULL;
109 void *packet_data_temp_buf = 0; 109 void *packet_data_temp_buf = NULL;
110 unsigned int idx = 0; 110 unsigned int idx = 0;
111 111
112 pr_debug("create_packet: entry \n"); 112 pr_debug("create_packet: entry \n");
@@ -178,7 +178,7 @@ static int create_packet(void *data, size_t length)
178 packet_data_temp_buf), 178 packet_data_temp_buf),
179 allocation_floor); 179 allocation_floor);
180 invalid_addr_packet_array[idx++] = packet_data_temp_buf; 180 invalid_addr_packet_array[idx++] = packet_data_temp_buf;
181 packet_data_temp_buf = 0; 181 packet_data_temp_buf = NULL;
182 } 182 }
183 } 183 }
184 spin_lock(&rbu_data.lock); 184 spin_lock(&rbu_data.lock);
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index afd7634e5cc9..81031eb51056 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -529,14 +529,15 @@ mv64xxx_i2c_probe(struct platform_device *pd)
529 i2c_set_adapdata(&drv_data->adapter, drv_data); 529 i2c_set_adapdata(&drv_data->adapter, drv_data);
530 530
531 if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, 531 if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0,
532 MV64XXX_I2C_CTLR_NAME, drv_data)) { 532 MV64XXX_I2C_CTLR_NAME, drv_data)) {
533 533 dev_err(&drv_data->adapter.dev,
534 dev_err(dev, "mv64xxx: Can't register intr handler " 534 "mv64xxx: Can't register intr handler irq: %d\n",
535 "irq: %d\n", drv_data->irq); 535 drv_data->irq);
536 rc = -EINVAL; 536 rc = -EINVAL;
537 goto exit_unmap_regs; 537 goto exit_unmap_regs;
538 } else if ((rc = i2c_add_adapter(&drv_data->adapter)) != 0) { 538 } else if ((rc = i2c_add_adapter(&drv_data->adapter)) != 0) {
539 dev_err(dev, "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc); 539 dev_err(&drv_data->adapter.dev,
540 "mv64xxx: Can't add i2c adapter, rc: %d\n", -rc);
540 goto exit_free_irq; 541 goto exit_free_irq;
541 } 542 }
542 543
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h
index 38f42112dff0..ae9b02cc013f 100644
--- a/drivers/ieee1394/hosts.h
+++ b/drivers/ieee1394/hosts.h
@@ -41,6 +41,7 @@ struct hpsb_host {
41 /* this nodes state */ 41 /* this nodes state */
42 unsigned in_bus_reset:1; 42 unsigned in_bus_reset:1;
43 unsigned is_shutdown:1; 43 unsigned is_shutdown:1;
44 unsigned resume_packet_sent:1;
44 45
45 /* this nodes' duties on the bus */ 46 /* this nodes' duties on the bus */
46 unsigned is_root:1; 47 unsigned is_root:1;
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 7fff5a1d2ea4..0ea37b1bccb2 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1349,6 +1349,33 @@ static void nodemgr_update_pdrv(struct node_entry *ne)
1349} 1349}
1350 1350
1351 1351
1352/* Write the BROADCAST_CHANNEL as per IEEE1394a 8.3.2.3.11 and 8.4.2.3. This
1353 * seems like an optional service but in the end it is practically mandatory
1354 * as a consequence of these clauses.
1355 *
1356 * Note that we cannot do a broadcast write to all nodes at once because some
1357 * pre-1394a devices would hang. */
1358static void nodemgr_irm_write_bc(struct node_entry *ne, int generation)
1359{
1360 const u64 bc_addr = (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL);
1361 quadlet_t bc_remote, bc_local;
1362 int ret;
1363
1364 if (!ne->host->is_irm || ne->generation != generation ||
1365 ne->nodeid == ne->host->node_id)
1366 return;
1367
1368 bc_local = cpu_to_be32(ne->host->csr.broadcast_channel);
1369
1370 /* Check if the register is implemented and 1394a compliant. */
1371 ret = hpsb_read(ne->host, ne->nodeid, generation, bc_addr, &bc_remote,
1372 sizeof(bc_remote));
1373 if (!ret && bc_remote & cpu_to_be32(0x80000000) &&
1374 bc_remote != bc_local)
1375 hpsb_node_write(ne, bc_addr, &bc_local, sizeof(bc_local));
1376}
1377
1378
1352static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation) 1379static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation)
1353{ 1380{
1354 struct device *dev; 1381 struct device *dev;
@@ -1360,6 +1387,8 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge
1360 if (!dev) 1387 if (!dev)
1361 return; 1388 return;
1362 1389
1390 nodemgr_irm_write_bc(ne, generation);
1391
1363 /* If "needs_probe", then this is either a new or changed node we 1392 /* If "needs_probe", then this is either a new or changed node we
1364 * rescan totally. If the generation matches for an existing node 1393 * rescan totally. If the generation matches for an existing node
1365 * (one that existed prior to the bus reset) we send update calls 1394 * (one that existed prior to the bus reset) we send update calls
@@ -1413,9 +1442,25 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
1413 return; 1442 return;
1414} 1443}
1415 1444
1416/* Because we are a 1394a-2000 compliant IRM, we need to inform all the other 1445static int nodemgr_send_resume_packet(struct hpsb_host *host)
1417 * nodes of the broadcast channel. (Really we're only setting the validity 1446{
1418 * bit). Other IRM responsibilities go in here as well. */ 1447 struct hpsb_packet *packet;
1448 int ret = 1;
1449
1450 packet = hpsb_make_phypacket(host,
1451 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24);
1452 if (packet) {
1453 packet->no_waiter = 1;
1454 packet->generation = get_hpsb_generation(host);
1455 ret = hpsb_send_packet(packet);
1456 }
1457 if (ret)
1458 HPSB_WARN("fw-host%d: Failed to broadcast resume packet",
1459 host->id);
1460 return ret;
1461}
1462
1463/* Perform a few high-level IRM responsibilities. */
1419static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles) 1464static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
1420{ 1465{
1421 quadlet_t bc; 1466 quadlet_t bc;
@@ -1424,13 +1469,8 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
1424 if (!host->is_irm || host->irm_id == (nodeid_t)-1) 1469 if (!host->is_irm || host->irm_id == (nodeid_t)-1)
1425 return 1; 1470 return 1;
1426 1471
1427 host->csr.broadcast_channel |= 0x40000000; /* set validity bit */ 1472 /* We are a 1394a-2000 compliant IRM. Set the validity bit. */
1428 1473 host->csr.broadcast_channel |= 0x40000000;
1429 bc = cpu_to_be32(host->csr.broadcast_channel);
1430
1431 hpsb_write(host, LOCAL_BUS | ALL_NODES, get_hpsb_generation(host),
1432 (CSR_REGISTER_BASE | CSR_BROADCAST_CHANNEL),
1433 &bc, sizeof(quadlet_t));
1434 1474
1435 /* If there is no bus manager then we should set the root node's 1475 /* If there is no bus manager then we should set the root node's
1436 * force_root bit to promote bus stability per the 1394 1476 * force_root bit to promote bus stability per the 1394
@@ -1463,6 +1503,13 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
1463 } 1503 }
1464 } 1504 }
1465 1505
1506 /* Some devices suspend their ports while being connected to an inactive
1507 * host adapter, i.e. if connected before the low-level driver is
1508 * loaded. They become visible either when physically unplugged and
1509 * replugged, or when receiving a resume packet. Send one once. */
1510 if (!host->resume_packet_sent && !nodemgr_send_resume_packet(host))
1511 host->resume_packet_sent = 1;
1512
1466 return 1; 1513 return 1;
1467} 1514}
1468 1515
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 49d0416a2a9a..bac3085185fe 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -320,7 +320,7 @@ static struct dmi_system_id dmi_ids[] = {
320 }, 320 },
321 .driver_data = keymap_acer_aspire_1500 321 .driver_data = keymap_acer_aspire_1500
322 }, 322 },
323 { 0, } 323 { NULL, }
324}; 324};
325 325
326static int __init select_keymap(void) 326static int __init select_keymap(void)
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 3fc8cdd94c3d..5bb36274a5c6 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -933,7 +933,7 @@ static void do_monitor_cpu_combined(void)
933 if (state0->overtemp > 0) { 933 if (state0->overtemp > 0) {
934 state0->rpm = state0->mpu.rmaxn_exhaust_fan; 934 state0->rpm = state0->mpu.rmaxn_exhaust_fan;
935 state0->intake_rpm = intake = state0->mpu.rmaxn_intake_fan; 935 state0->intake_rpm = intake = state0->mpu.rmaxn_intake_fan;
936 pump = state0->pump_min; 936 pump = state0->pump_max;
937 goto do_set_fans; 937 goto do_set_fans;
938 } 938 }
939 939
diff --git a/drivers/md/md.c b/drivers/md/md.c
index cd12fca73b0d..8175a2a222da 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1729,7 +1729,7 @@ level_show(mddev_t *mddev, char *page)
1729 if (p == NULL && mddev->raid_disks == 0) 1729 if (p == NULL && mddev->raid_disks == 0)
1730 return 0; 1730 return 0;
1731 if (mddev->level >= 0) 1731 if (mddev->level >= 0)
1732 return sprintf(page, "RAID-%d\n", mddev->level); 1732 return sprintf(page, "raid%d\n", mddev->level);
1733 else 1733 else
1734 return sprintf(page, "%s\n", p->name); 1734 return sprintf(page, "%s\n", p->name);
1735} 1735}
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index e6541aff3996..2239651969c8 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -406,7 +406,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message,
406 } 406 }
407 dprintk(verbose, DST_CA_DEBUG, 1, " "); 407 dprintk(verbose, DST_CA_DEBUG, 1, " ");
408 408
409 if (copy_from_user(p_ca_message, (void *)arg, sizeof (struct ca_msg))) { 409 if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) {
410 result = -EFAULT; 410 result = -EFAULT;
411 goto free_mem_and_exit; 411 goto free_mem_and_exit;
412 } 412 }
@@ -579,7 +579,7 @@ static int dst_ca_release(struct inode *inode, struct file *file)
579 return 0; 579 return 0;
580} 580}
581 581
582static int dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) 582static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset)
583{ 583{
584 int bytes_read = 0; 584 int bytes_read = 0;
585 585
@@ -588,7 +588,7 @@ static int dst_ca_read(struct file *file, char __user *buffer, size_t length, lo
588 return bytes_read; 588 return bytes_read;
589} 589}
590 590
591static int dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset) 591static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset)
592{ 592{
593 dprintk(verbose, DST_CA_DEBUG, 1, " Device write."); 593 dprintk(verbose, DST_CA_DEBUG, 1, " Device write.");
594 594
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 992be0be6b1e..7dae91e5863c 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -176,6 +176,9 @@ static void init_av7110_av(struct av7110 *av7110)
176 } 176 }
177 } 177 }
178 178
179 if (dev->pci->subsystem_vendor == 0x13c2 && dev->pci->subsystem_device == 0x000e)
180 av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, SpdifSwitch, 1, 0); // SPDIF on
181
179 ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right); 182 ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right);
180 if (ret < 0) 183 if (ret < 0)
181 printk("dvb-ttpci:cannot set volume :%d\n",ret); 184 printk("dvb-ttpci:cannot set volume :%d\n",ret);
diff --git a/drivers/media/dvb/ttpci/av7110_hw.h b/drivers/media/dvb/ttpci/av7110_hw.h
index fedd20f9815d..2a5e87ba1052 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.h
+++ b/drivers/media/dvb/ttpci/av7110_hw.h
@@ -143,7 +143,8 @@ enum av7110_audio_command {
143 MainSwitch, 143 MainSwitch,
144 ADSwitch, 144 ADSwitch,
145 SendDiSEqC, 145 SendDiSEqC,
146 SetRegister 146 SetRegister,
147 SpdifSwitch
147}; 148};
148 149
149enum av7110_request_command { 150enum av7110_request_command {
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index aea3f038cff6..5b93723a1768 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -333,24 +333,30 @@ static int set_input(struct i2c_client *client, enum cx25840_input input)
333 333
334static int set_v4lstd(struct i2c_client *client, v4l2_std_id std) 334static int set_v4lstd(struct i2c_client *client, v4l2_std_id std)
335{ 335{
336 u8 fmt; 336 u8 fmt=0; /* zero is autodetect */
337 337
338 switch (std) { 338 /* First tests should be against specific std */
339 /* zero is autodetect */ 339 if (std & V4L2_STD_NTSC_M_JP) {
340 case 0: fmt = 0x0; break; 340 fmt=0x2;
341 /* default ntsc to ntsc-m */ 341 } else if (std & V4L2_STD_NTSC_443) {
342 case V4L2_STD_NTSC: 342 fmt=0x3;
343 case V4L2_STD_NTSC_M: fmt = 0x1; break; 343 } else if (std & V4L2_STD_PAL_M) {
344 case V4L2_STD_NTSC_M_JP: fmt = 0x2; break; 344 fmt=0x5;
345 case V4L2_STD_NTSC_443: fmt = 0x3; break; 345 } else if (std & V4L2_STD_PAL_N) {
346 case V4L2_STD_PAL: fmt = 0x4; break; 346 fmt=0x6;
347 case V4L2_STD_PAL_M: fmt = 0x5; break; 347 } else if (std & V4L2_STD_PAL_Nc) {
348 case V4L2_STD_PAL_N: fmt = 0x6; break; 348 fmt=0x7;
349 case V4L2_STD_PAL_Nc: fmt = 0x7; break; 349 } else if (std & V4L2_STD_PAL_60) {
350 case V4L2_STD_PAL_60: fmt = 0x8; break; 350 fmt=0x8;
351 case V4L2_STD_SECAM: fmt = 0xc; break; 351 } else {
352 default: 352 /* Then, test against generic ones */
353 return -ERANGE; 353 if (std & V4L2_STD_NTSC) {
354 fmt=0x1;
355 } else if (std & V4L2_STD_PAL) {
356 fmt=0x4;
357 } else if (std & V4L2_STD_SECAM) {
358 fmt=0xc;
359 }
354 } 360 }
355 361
356 cx25840_and_or(client, 0x400, ~0xf, fmt); 362 cx25840_and_or(client, 0x400, ~0xf, fmt);
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index e8a1c2247567..0cfe75416ec6 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -39,7 +39,7 @@ MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
39#define em28xx_coredbg(fmt, arg...) do {\ 39#define em28xx_coredbg(fmt, arg...) do {\
40 if (core_debug) \ 40 if (core_debug) \
41 printk(KERN_INFO "%s %s :"fmt, \ 41 printk(KERN_INFO "%s %s :"fmt, \
42 dev->name, __FUNCTION__, ##arg); } while (0) 42 dev->name, __FUNCTION__ , ##arg); } while (0)
43 43
44static unsigned int reg_debug; 44static unsigned int reg_debug;
45module_param(reg_debug,int,0644); 45module_param(reg_debug,int,0644);
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]");
48#define em28xx_regdbg(fmt, arg...) do {\ 48#define em28xx_regdbg(fmt, arg...) do {\
49 if (reg_debug) \ 49 if (reg_debug) \
50 printk(KERN_INFO "%s %s :"fmt, \ 50 printk(KERN_INFO "%s %s :"fmt, \
51 dev->name, __FUNCTION__, ##arg); } while (0) 51 dev->name, __FUNCTION__ , ##arg); } while (0)
52 52
53static unsigned int isoc_debug; 53static unsigned int isoc_debug;
54module_param(isoc_debug,int,0644); 54module_param(isoc_debug,int,0644);
@@ -57,7 +57,7 @@ MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]");
57#define em28xx_isocdbg(fmt, arg...) do {\ 57#define em28xx_isocdbg(fmt, arg...) do {\
58 if (isoc_debug) \ 58 if (isoc_debug) \
59 printk(KERN_INFO "%s %s :"fmt, \ 59 printk(KERN_INFO "%s %s :"fmt, \
60 dev->name, __FUNCTION__, ##arg); } while (0) 60 dev->name, __FUNCTION__ , ##arg); } while (0)
61 61
62static int alt = EM28XX_PINOUT; 62static int alt = EM28XX_PINOUT;
63module_param(alt, int, 0644); 63module_param(alt, int, 0644);
@@ -126,7 +126,7 @@ u32 em28xx_request_buffers(struct em28xx *dev, u32 count)
126 const size_t imagesize = PAGE_ALIGN(dev->frame_size); /*needs to be page aligned cause the buffers can be mapped individually! */ 126 const size_t imagesize = PAGE_ALIGN(dev->frame_size); /*needs to be page aligned cause the buffers can be mapped individually! */
127 void *buff = NULL; 127 void *buff = NULL;
128 u32 i; 128 u32 i;
129 em28xx_coredbg("requested %i buffers with size %i", count, imagesize); 129 em28xx_coredbg("requested %i buffers with size %zd", count, imagesize);
130 if (count > EM28XX_NUM_FRAMES) 130 if (count > EM28XX_NUM_FRAMES)
131 count = EM28XX_NUM_FRAMES; 131 count = EM28XX_NUM_FRAMES;
132 132
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index 29e21ad187cc..7f5603054f02 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -44,7 +44,7 @@ MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
44 printk(fmt, ##args); } while (0) 44 printk(fmt, ##args); } while (0)
45#define dprintk2(lvl,fmt, args...) if (i2c_debug>=lvl) do{ \ 45#define dprintk2(lvl,fmt, args...) if (i2c_debug>=lvl) do{ \
46 printk(KERN_DEBUG "%s at %s: " fmt, \ 46 printk(KERN_DEBUG "%s at %s: " fmt, \
47 dev->name, __FUNCTION__, ##args); } while (0) 47 dev->name, __FUNCTION__ , ##args); } while (0)
48 48
49/* 49/*
50 * em2800_i2c_send_max4() 50 * em2800_i2c_send_max4()
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 8ecaa0803e08..06d76879bde2 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -45,7 +45,7 @@
45#define em28xx_videodbg(fmt, arg...) do {\ 45#define em28xx_videodbg(fmt, arg...) do {\
46 if (video_debug) \ 46 if (video_debug) \
47 printk(KERN_INFO "%s %s :"fmt, \ 47 printk(KERN_INFO "%s %s :"fmt, \
48 dev->name, __FUNCTION__, ##arg); } while (0) 48 dev->name, __FUNCTION__ , ##arg); } while (0)
49 49
50MODULE_AUTHOR(DRIVER_AUTHOR); 50MODULE_AUTHOR(DRIVER_AUTHOR);
51MODULE_DESCRIPTION(DRIVER_DESC); 51MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 1e2ee43db394..5c7a41ce69f3 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -392,18 +392,18 @@ extern const unsigned int em28xx_bcount;
392/* printk macros */ 392/* printk macros */
393 393
394#define em28xx_err(fmt, arg...) do {\ 394#define em28xx_err(fmt, arg...) do {\
395 printk(KERN_ERR fmt, ##arg); } while (0) 395 printk(KERN_ERR fmt , ##arg); } while (0)
396 396
397#define em28xx_errdev(fmt, arg...) do {\ 397#define em28xx_errdev(fmt, arg...) do {\
398 printk(KERN_ERR "%s: "fmt,\ 398 printk(KERN_ERR "%s: "fmt,\
399 dev->name, ##arg); } while (0) 399 dev->name , ##arg); } while (0)
400 400
401#define em28xx_info(fmt, arg...) do {\ 401#define em28xx_info(fmt, arg...) do {\
402 printk(KERN_INFO "%s: "fmt,\ 402 printk(KERN_INFO "%s: "fmt,\
403 dev->name, ##arg); } while (0) 403 dev->name , ##arg); } while (0)
404#define em28xx_warn(fmt, arg...) do {\ 404#define em28xx_warn(fmt, arg...) do {\
405 printk(KERN_WARNING "%s: "fmt,\ 405 printk(KERN_WARNING "%s: "fmt,\
406 dev->name, ##arg); } while (0) 406 dev->name , ##arg); } while (0)
407 407
408inline static int em28xx_audio_source(struct em28xx *dev, int input) 408inline static int em28xx_audio_source(struct em28xx *dev, int input)
409{ 409{
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index b24a26b065c2..953d5fec82d5 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -60,7 +60,7 @@ module_param_array(index, int, NULL, 0444);
60MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); 60MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
61 61
62#define dprintk(fmt, arg...) if (debug) \ 62#define dprintk(fmt, arg...) if (debug) \
63 printk(KERN_DEBUG "%s/alsa: " fmt, dev->name, ## arg) 63 printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg)
64 64
65 65
66 66
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index cd7cf1bd12b4..5ac235365dd8 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -206,7 +206,7 @@ hauppauge_tuner[] =
206 { TUNER_ABSENT, "TCL 2002MI_3H"}, 206 { TUNER_ABSENT, "TCL 2002MI_3H"},
207 { TUNER_TCL_2002N, "TCL 2002N 5H"}, 207 { TUNER_TCL_2002N, "TCL 2002N 5H"},
208 /* 100-109 */ 208 /* 100-109 */
209 { TUNER_ABSENT, "Philips FMD1216ME"}, 209 { TUNER_PHILIPS_FMD1216ME_MK3, "Philips FMD1216ME"},
210 { TUNER_TEA5767, "Philips TEA5768HL FM Radio"}, 210 { TUNER_TEA5767, "Philips TEA5768HL FM Radio"},
211 { TUNER_ABSENT, "Panasonic ENV57H12D5"}, 211 { TUNER_ABSENT, "Panasonic ENV57H12D5"},
212 { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05-4"}, 212 { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05-4"},
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c
index 81ef306cb124..ee7075fa1ec3 100644
--- a/drivers/message/i2o/pci.c
+++ b/drivers/message/i2o/pci.c
@@ -303,6 +303,7 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
303 struct i2o_controller *c; 303 struct i2o_controller *c;
304 int rc; 304 int rc;
305 struct pci_dev *i960 = NULL; 305 struct pci_dev *i960 = NULL;
306 int pci_dev_busy = 0;
306 307
307 printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n"); 308 printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");
308 309
@@ -395,6 +396,8 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
395 if ((rc = i2o_pci_alloc(c))) { 396 if ((rc = i2o_pci_alloc(c))) {
396 printk(KERN_ERR "%s: DMA / IO allocation for I2O controller " 397 printk(KERN_ERR "%s: DMA / IO allocation for I2O controller "
397 " failed\n", c->name); 398 " failed\n", c->name);
399 if (rc == -ENODEV)
400 pci_dev_busy = 1;
398 goto free_controller; 401 goto free_controller;
399 } 402 }
400 403
@@ -425,7 +428,8 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
425 i2o_iop_free(c); 428 i2o_iop_free(c);
426 429
427 disable: 430 disable:
428 pci_disable_device(pdev); 431 if (!pci_dev_busy)
432 pci_disable_device(pdev);
429 433
430 return rc; 434 return rc;
431} 435}
diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c
index 48cce431f89f..45c077d0f063 100644
--- a/drivers/mtd/onenand/generic.c
+++ b/drivers/mtd/onenand/generic.c
@@ -12,9 +12,9 @@
12 * This is a device driver for the OneNAND flash for generic boards. 12 * This is a device driver for the OneNAND flash for generic boards.
13 */ 13 */
14 14
15#include <linux/device.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/onenand.h> 19#include <linux/mtd/onenand.h>
20#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
@@ -39,7 +39,7 @@ static int __devinit generic_onenand_probe(struct device *dev)
39{ 39{
40 struct onenand_info *info; 40 struct onenand_info *info;
41 struct platform_device *pdev = to_platform_device(dev); 41 struct platform_device *pdev = to_platform_device(dev);
42 struct onenand_platform_data *pdata = pdev->dev.platform_data; 42 struct flash_platform_data *pdata = pdev->dev.platform_data;
43 struct resource *res = pdev->resource; 43 struct resource *res = pdev->resource;
44 unsigned long size = res->end - res->start + 1; 44 unsigned long size = res->end - res->start + 1;
45 int err; 45 int err;
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index f67d5d6eb9a6..a53a73fc2a5a 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -940,7 +940,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
940 u_char *eccbuf, struct nand_oobinfo *oobsel) 940 u_char *eccbuf, struct nand_oobinfo *oobsel)
941{ 941{
942 struct onenand_chip *this = mtd->priv; 942 struct onenand_chip *this = mtd->priv;
943 unsigned char buffer[MAX_ONENAND_PAGESIZE], *pbuf; 943 unsigned char *pbuf;
944 size_t total_len, len; 944 size_t total_len, len;
945 int i, written = 0; 945 int i, written = 0;
946 int ret = 0; 946 int ret = 0;
@@ -975,7 +975,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
975 /* Loop until all keve's data has been written */ 975 /* Loop until all keve's data has been written */
976 len = 0; 976 len = 0;
977 while (count) { 977 while (count) {
978 pbuf = buffer; 978 pbuf = this->page_buf;
979 /* 979 /*
980 * If the given tuple is >= pagesize then 980 * If the given tuple is >= pagesize then
981 * write it out from the iov 981 * write it out from the iov
@@ -995,7 +995,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
995 int cnt = 0, thislen; 995 int cnt = 0, thislen;
996 while (cnt < mtd->oobblock) { 996 while (cnt < mtd->oobblock) {
997 thislen = min_t(int, mtd->oobblock - cnt, vecs->iov_len - len); 997 thislen = min_t(int, mtd->oobblock - cnt, vecs->iov_len - len);
998 memcpy(buffer + cnt, vecs->iov_base + len, thislen); 998 memcpy(this->page_buf + cnt, vecs->iov_base + len, thislen);
999 cnt += thislen; 999 cnt += thislen;
1000 len += thislen; 1000 len += thislen;
1001 1001
@@ -1296,6 +1296,12 @@ static int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
1296 1296
1297 /* Block lock scheme */ 1297 /* Block lock scheme */
1298 for (block = start; block < end; block++) { 1298 for (block = start; block < end; block++) {
1299 /* Set block address */
1300 value = onenand_block_address(this, block);
1301 this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1);
1302 /* Select DataRAM for DDP */
1303 value = onenand_bufferram_address(this, block);
1304 this->write_word(value, this->base + ONENAND_REG_START_ADDRESS2);
1299 /* Set start block address */ 1305 /* Set start block address */
1300 this->write_word(block, this->base + ONENAND_REG_START_BLOCK_ADDRESS); 1306 this->write_word(block, this->base + ONENAND_REG_START_BLOCK_ADDRESS);
1301 /* Write unlock command */ 1307 /* Write unlock command */
@@ -1309,10 +1315,6 @@ static int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
1309 & ONENAND_CTRL_ONGO) 1315 & ONENAND_CTRL_ONGO)
1310 continue; 1316 continue;
1311 1317
1312 /* Set block address for read block status */
1313 value = onenand_block_address(this, block);
1314 this->write_word(value, this->base + ONENAND_REG_START_ADDRESS1);
1315
1316 /* Check lock status */ 1318 /* Check lock status */
1317 status = this->read_word(this->base + ONENAND_REG_WP_STATUS); 1319 status = this->read_word(this->base + ONENAND_REG_WP_STATUS);
1318 if (!(status & ONENAND_WP_US)) 1320 if (!(status & ONENAND_WP_US))
@@ -1346,7 +1348,6 @@ static void onenand_print_device_info(int device)
1346 1348
1347static const struct onenand_manufacturers onenand_manuf_ids[] = { 1349static const struct onenand_manufacturers onenand_manuf_ids[] = {
1348 {ONENAND_MFR_SAMSUNG, "Samsung"}, 1350 {ONENAND_MFR_SAMSUNG, "Samsung"},
1349 {ONENAND_MFR_UNKNOWN, "Unknown"}
1350}; 1351};
1351 1352
1352/** 1353/**
@@ -1357,17 +1358,22 @@ static const struct onenand_manufacturers onenand_manuf_ids[] = {
1357 */ 1358 */
1358static int onenand_check_maf(int manuf) 1359static int onenand_check_maf(int manuf)
1359{ 1360{
1361 int size = ARRAY_SIZE(onenand_manuf_ids);
1362 char *name;
1360 int i; 1363 int i;
1361 1364
1362 for (i = 0; onenand_manuf_ids[i].id; i++) { 1365 for (i = 0; i < size; i++)
1363 if (manuf == onenand_manuf_ids[i].id) 1366 if (manuf == onenand_manuf_ids[i].id)
1364 break; 1367 break;
1365 }
1366 1368
1367 printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", 1369 if (i < size)
1368 onenand_manuf_ids[i].name, manuf); 1370 name = onenand_manuf_ids[i].name;
1371 else
1372 name = "Unknown";
1373
1374 printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf);
1369 1375
1370 return (i != ONENAND_MFR_UNKNOWN); 1376 return (i == size);
1371} 1377}
1372 1378
1373/** 1379/**
@@ -1513,6 +1519,18 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
1513 this->read_bufferram = onenand_sync_read_bufferram; 1519 this->read_bufferram = onenand_sync_read_bufferram;
1514 } 1520 }
1515 1521
1522 /* Allocate buffers, if necessary */
1523 if (!this->page_buf) {
1524 size_t len;
1525 len = mtd->oobblock + mtd->oobsize;
1526 this->page_buf = kmalloc(len, GFP_KERNEL);
1527 if (!this->page_buf) {
1528 printk(KERN_ERR "onenand_scan(): Can't allocate page_buf\n");
1529 return -ENOMEM;
1530 }
1531 this->options |= ONENAND_PAGEBUF_ALLOC;
1532 }
1533
1516 this->state = FL_READY; 1534 this->state = FL_READY;
1517 init_waitqueue_head(&this->wq); 1535 init_waitqueue_head(&this->wq);
1518 spin_lock_init(&this->chip_lock); 1536 spin_lock_init(&this->chip_lock);
@@ -1574,12 +1592,21 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
1574 */ 1592 */
1575void onenand_release(struct mtd_info *mtd) 1593void onenand_release(struct mtd_info *mtd)
1576{ 1594{
1595 struct onenand_chip *this = mtd->priv;
1596
1577#ifdef CONFIG_MTD_PARTITIONS 1597#ifdef CONFIG_MTD_PARTITIONS
1578 /* Deregister partitions */ 1598 /* Deregister partitions */
1579 del_mtd_partitions (mtd); 1599 del_mtd_partitions (mtd);
1580#endif 1600#endif
1581 /* Deregister the device */ 1601 /* Deregister the device */
1582 del_mtd_device (mtd); 1602 del_mtd_device (mtd);
1603
1604 /* Free bad block table memory, if allocated */
1605 if (this->bbm)
1606 kfree(this->bbm);
1607 /* Buffer allocated by onenand_scan */
1608 if (this->options & ONENAND_PAGEBUF_ALLOC)
1609 kfree(this->page_buf);
1583} 1610}
1584 1611
1585EXPORT_SYMBOL_GPL(onenand_scan); 1612EXPORT_SYMBOL_GPL(onenand_scan);
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c
index f40190f499e1..4510d3361eaa 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -118,10 +118,10 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
118 */ 118 */
119static inline int onenand_memory_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd) 119static inline int onenand_memory_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
120{ 120{
121 unsigned char data_buf[MAX_ONENAND_PAGESIZE]; 121 struct onenand_chip *this = mtd->priv;
122 122
123 bd->options &= ~NAND_BBT_SCANEMPTY; 123 bd->options &= ~NAND_BBT_SCANEMPTY;
124 return create_bbt(mtd, data_buf, bd, -1); 124 return create_bbt(mtd, this->page_buf, bd, -1);
125} 125}
126 126
127/** 127/**
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index e57df8dfe6b4..669dd52c412a 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3078,7 +3078,7 @@ int s2io_set_swapper(nic_t * sp)
3078 3078
3079static int wait_for_msix_trans(nic_t *nic, int i) 3079static int wait_for_msix_trans(nic_t *nic, int i)
3080{ 3080{
3081 XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3081 XENA_dev_config_t __iomem *bar0 = nic->bar0;
3082 u64 val64; 3082 u64 val64;
3083 int ret = 0, cnt = 0; 3083 int ret = 0, cnt = 0;
3084 3084
@@ -3099,7 +3099,7 @@ static int wait_for_msix_trans(nic_t *nic, int i)
3099 3099
3100void restore_xmsi_data(nic_t *nic) 3100void restore_xmsi_data(nic_t *nic)
3101{ 3101{
3102 XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3102 XENA_dev_config_t __iomem *bar0 = nic->bar0;
3103 u64 val64; 3103 u64 val64;
3104 int i; 3104 int i;
3105 3105
@@ -3117,7 +3117,7 @@ void restore_xmsi_data(nic_t *nic)
3117 3117
3118static void store_xmsi_data(nic_t *nic) 3118static void store_xmsi_data(nic_t *nic)
3119{ 3119{
3120 XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3120 XENA_dev_config_t __iomem *bar0 = nic->bar0;
3121 u64 val64, addr, data; 3121 u64 val64, addr, data;
3122 int i; 3122 int i;
3123 3123
@@ -3140,7 +3140,7 @@ static void store_xmsi_data(nic_t *nic)
3140 3140
3141int s2io_enable_msi(nic_t *nic) 3141int s2io_enable_msi(nic_t *nic)
3142{ 3142{
3143 XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3143 XENA_dev_config_t __iomem *bar0 = nic->bar0;
3144 u16 msi_ctrl, msg_val; 3144 u16 msi_ctrl, msg_val;
3145 struct config_param *config = &nic->config; 3145 struct config_param *config = &nic->config;
3146 struct net_device *dev = nic->dev; 3146 struct net_device *dev = nic->dev;
@@ -3190,7 +3190,7 @@ int s2io_enable_msi(nic_t *nic)
3190 3190
3191int s2io_enable_msi_x(nic_t *nic) 3191int s2io_enable_msi_x(nic_t *nic)
3192{ 3192{
3193 XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; 3193 XENA_dev_config_t __iomem *bar0 = nic->bar0;
3194 u64 tx_mat, rx_mat; 3194 u64 tx_mat, rx_mat;
3195 u16 msi_control; /* Temp variable */ 3195 u16 msi_control; /* Temp variable */
3196 int ret, i, j, msix_indx = 1; 3196 int ret, i, j, msix_indx = 1;
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a23ed28a72b8..cefb0c08a68d 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
68 68
69#define DRV_MODULE_NAME "tg3" 69#define DRV_MODULE_NAME "tg3"
70#define PFX DRV_MODULE_NAME ": " 70#define PFX DRV_MODULE_NAME ": "
71#define DRV_MODULE_VERSION "3.45" 71#define DRV_MODULE_VERSION "3.46"
72#define DRV_MODULE_RELDATE "Dec 13, 2005" 72#define DRV_MODULE_RELDATE "Dec 19, 2005"
73 73
74#define TG3_DEF_MAC_MODE 0 74#define TG3_DEF_MAC_MODE 0
75#define TG3_DEF_RX_MODE 0 75#define TG3_DEF_RX_MODE 0
@@ -341,6 +341,16 @@ static struct {
341 { "interrupt test (offline)" }, 341 { "interrupt test (offline)" },
342}; 342};
343 343
344static void tg3_write32(struct tg3 *tp, u32 off, u32 val)
345{
346 writel(val, tp->regs + off);
347}
348
349static u32 tg3_read32(struct tg3 *tp, u32 off)
350{
351 return (readl(tp->regs + off));
352}
353
344static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) 354static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val)
345{ 355{
346 unsigned long flags; 356 unsigned long flags;
@@ -411,13 +421,29 @@ static u32 tg3_read_indirect_mbox(struct tg3 *tp, u32 off)
411 return val; 421 return val;
412} 422}
413 423
414static void _tw32_flush(struct tg3 *tp, u32 off, u32 val) 424/* usec_wait specifies the wait time in usec when writing to certain registers
425 * where it is unsafe to read back the register without some delay.
426 * GRC_LOCAL_CTRL is one example if the GPIOs are toggled to switch power.
427 * TG3PCI_CLOCK_CTRL is another example if the clock frequencies are changed.
428 */
429static void _tw32_flush(struct tg3 *tp, u32 off, u32 val, u32 usec_wait)
415{ 430{
416 tp->write32(tp, off, val); 431 if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) ||
417 if (!(tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) && 432 (tp->tg3_flags2 & TG3_FLG2_ICH_WORKAROUND))
418 !(tp->tg3_flags & TG3_FLAG_5701_REG_WRITE_BUG) && 433 /* Non-posted methods */
419 !(tp->tg3_flags2 & TG3_FLG2_ICH_WORKAROUND)) 434 tp->write32(tp, off, val);
420 tp->read32(tp, off); /* flush */ 435 else {
436 /* Posted method */
437 tg3_write32(tp, off, val);
438 if (usec_wait)
439 udelay(usec_wait);
440 tp->read32(tp, off);
441 }
442 /* Wait again after the read for the posted method to guarantee that
443 * the wait time is met.
444 */
445 if (usec_wait)
446 udelay(usec_wait);
421} 447}
422 448
423static inline void tw32_mailbox_flush(struct tg3 *tp, u32 off, u32 val) 449static inline void tw32_mailbox_flush(struct tg3 *tp, u32 off, u32 val)
@@ -438,16 +464,6 @@ static void tg3_write32_tx_mbox(struct tg3 *tp, u32 off, u32 val)
438 readl(mbox); 464 readl(mbox);
439} 465}
440 466
441static void tg3_write32(struct tg3 *tp, u32 off, u32 val)
442{
443 writel(val, tp->regs + off);
444}
445
446static u32 tg3_read32(struct tg3 *tp, u32 off)
447{
448 return (readl(tp->regs + off));
449}
450
451#define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val) 467#define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val)
452#define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val)) 468#define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val))
453#define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val) 469#define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val)
@@ -455,7 +471,8 @@ static u32 tg3_read32(struct tg3 *tp, u32 off)
455#define tr32_mailbox(reg) tp->read32_mbox(tp, reg) 471#define tr32_mailbox(reg) tp->read32_mbox(tp, reg)
456 472
457#define tw32(reg,val) tp->write32(tp, reg, val) 473#define tw32(reg,val) tp->write32(tp, reg, val)
458#define tw32_f(reg,val) _tw32_flush(tp,(reg),(val)) 474#define tw32_f(reg,val) _tw32_flush(tp,(reg),(val), 0)
475#define tw32_wait_f(reg,val,us) _tw32_flush(tp,(reg),(val), (us))
459#define tr32(reg) tp->read32(tp, reg) 476#define tr32(reg) tp->read32(tp, reg)
460 477
461static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val) 478static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
@@ -595,21 +612,19 @@ static void tg3_switch_clocks(struct tg3 *tp)
595 612
596 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { 613 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
597 if (orig_clock_ctrl & CLOCK_CTRL_625_CORE) { 614 if (orig_clock_ctrl & CLOCK_CTRL_625_CORE) {
598 tw32_f(TG3PCI_CLOCK_CTRL, 615 tw32_wait_f(TG3PCI_CLOCK_CTRL,
599 clock_ctrl | CLOCK_CTRL_625_CORE); 616 clock_ctrl | CLOCK_CTRL_625_CORE, 40);
600 udelay(40);
601 } 617 }
602 } else if ((orig_clock_ctrl & CLOCK_CTRL_44MHZ_CORE) != 0) { 618 } else if ((orig_clock_ctrl & CLOCK_CTRL_44MHZ_CORE) != 0) {
603 tw32_f(TG3PCI_CLOCK_CTRL, 619 tw32_wait_f(TG3PCI_CLOCK_CTRL,
604 clock_ctrl | 620 clock_ctrl |
605 (CLOCK_CTRL_44MHZ_CORE | CLOCK_CTRL_ALTCLK)); 621 (CLOCK_CTRL_44MHZ_CORE | CLOCK_CTRL_ALTCLK),
606 udelay(40); 622 40);
607 tw32_f(TG3PCI_CLOCK_CTRL, 623 tw32_wait_f(TG3PCI_CLOCK_CTRL,
608 clock_ctrl | (CLOCK_CTRL_ALTCLK)); 624 clock_ctrl | (CLOCK_CTRL_ALTCLK),
609 udelay(40); 625 40);
610 } 626 }
611 tw32_f(TG3PCI_CLOCK_CTRL, clock_ctrl); 627 tw32_wait_f(TG3PCI_CLOCK_CTRL, clock_ctrl, 40);
612 udelay(40);
613} 628}
614 629
615#define PHY_BUSY_LOOPS 5000 630#define PHY_BUSY_LOOPS 5000
@@ -1017,39 +1032,50 @@ static void tg3_frob_aux_power(struct tg3 *tp)
1017 if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0) 1032 if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0)
1018 return; 1033 return;
1019 1034
1020 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { 1035 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
1021 tp_peer = pci_get_drvdata(tp->pdev_peer); 1036 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) {
1022 if (!tp_peer) 1037 struct net_device *dev_peer;
1038
1039 dev_peer = pci_get_drvdata(tp->pdev_peer);
1040 if (!dev_peer)
1023 BUG(); 1041 BUG();
1042 tp_peer = netdev_priv(dev_peer);
1024 } 1043 }
1025 1044
1026
1027 if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || 1045 if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 ||
1028 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 || 1046 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 ||
1029 (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || 1047 (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 ||
1030 (tp_peer->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) { 1048 (tp_peer->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) {
1031 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || 1049 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
1032 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) { 1050 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701) {
1033 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1051 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1034 (GRC_LCLCTRL_GPIO_OE0 | 1052 (GRC_LCLCTRL_GPIO_OE0 |
1035 GRC_LCLCTRL_GPIO_OE1 | 1053 GRC_LCLCTRL_GPIO_OE1 |
1036 GRC_LCLCTRL_GPIO_OE2 | 1054 GRC_LCLCTRL_GPIO_OE2 |
1037 GRC_LCLCTRL_GPIO_OUTPUT0 | 1055 GRC_LCLCTRL_GPIO_OUTPUT0 |
1038 GRC_LCLCTRL_GPIO_OUTPUT1)); 1056 GRC_LCLCTRL_GPIO_OUTPUT1),
1039 udelay(100); 1057 100);
1040 } else { 1058 } else {
1041 u32 no_gpio2; 1059 u32 no_gpio2;
1042 u32 grc_local_ctrl; 1060 u32 grc_local_ctrl = 0;
1043 1061
1044 if (tp_peer != tp && 1062 if (tp_peer != tp &&
1045 (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0) 1063 (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0)
1046 return; 1064 return;
1047 1065
1066 /* Workaround to prevent overdrawing Amps. */
1067 if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
1068 ASIC_REV_5714) {
1069 grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE3;
1070 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1071 grc_local_ctrl, 100);
1072 }
1073
1048 /* On 5753 and variants, GPIO2 cannot be used. */ 1074 /* On 5753 and variants, GPIO2 cannot be used. */
1049 no_gpio2 = tp->nic_sram_data_cfg & 1075 no_gpio2 = tp->nic_sram_data_cfg &
1050 NIC_SRAM_DATA_CFG_NO_GPIO2; 1076 NIC_SRAM_DATA_CFG_NO_GPIO2;
1051 1077
1052 grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | 1078 grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE0 |
1053 GRC_LCLCTRL_GPIO_OE1 | 1079 GRC_LCLCTRL_GPIO_OE1 |
1054 GRC_LCLCTRL_GPIO_OE2 | 1080 GRC_LCLCTRL_GPIO_OE2 |
1055 GRC_LCLCTRL_GPIO_OUTPUT1 | 1081 GRC_LCLCTRL_GPIO_OUTPUT1 |
@@ -1058,21 +1084,18 @@ static void tg3_frob_aux_power(struct tg3 *tp)
1058 grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 | 1084 grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 |
1059 GRC_LCLCTRL_GPIO_OUTPUT2); 1085 GRC_LCLCTRL_GPIO_OUTPUT2);
1060 } 1086 }
1061 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1087 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1062 grc_local_ctrl); 1088 grc_local_ctrl, 100);
1063 udelay(100);
1064 1089
1065 grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0; 1090 grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0;
1066 1091
1067 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1092 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1068 grc_local_ctrl); 1093 grc_local_ctrl, 100);
1069 udelay(100);
1070 1094
1071 if (!no_gpio2) { 1095 if (!no_gpio2) {
1072 grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2; 1096 grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2;
1073 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1097 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1074 grc_local_ctrl); 1098 grc_local_ctrl, 100);
1075 udelay(100);
1076 } 1099 }
1077 } 1100 }
1078 } else { 1101 } else {
@@ -1082,19 +1105,16 @@ static void tg3_frob_aux_power(struct tg3 *tp)
1082 (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0) 1105 (tp_peer->tg3_flags & TG3_FLAG_INIT_COMPLETE) != 0)
1083 return; 1106 return;
1084 1107
1085 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1108 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1086 (GRC_LCLCTRL_GPIO_OE1 | 1109 (GRC_LCLCTRL_GPIO_OE1 |
1087 GRC_LCLCTRL_GPIO_OUTPUT1)); 1110 GRC_LCLCTRL_GPIO_OUTPUT1), 100);
1088 udelay(100);
1089 1111
1090 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1112 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1091 (GRC_LCLCTRL_GPIO_OE1)); 1113 GRC_LCLCTRL_GPIO_OE1, 100);
1092 udelay(100);
1093 1114
1094 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | 1115 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl |
1095 (GRC_LCLCTRL_GPIO_OE1 | 1116 (GRC_LCLCTRL_GPIO_OE1 |
1096 GRC_LCLCTRL_GPIO_OUTPUT1)); 1117 GRC_LCLCTRL_GPIO_OUTPUT1), 100);
1097 udelay(100);
1098 } 1118 }
1099 } 1119 }
1100} 1120}
@@ -1137,10 +1157,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
1137 udelay(100); /* Delay after power state change */ 1157 udelay(100); /* Delay after power state change */
1138 1158
1139 /* Switch out of Vaux if it is not a LOM */ 1159 /* Switch out of Vaux if it is not a LOM */
1140 if (!(tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT)) { 1160 if (!(tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT))
1141 tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); 1161 tw32_wait_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl, 100);
1142 udelay(100);
1143 }
1144 1162
1145 return 0; 1163 return 0;
1146 1164
@@ -1239,10 +1257,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
1239 base_val |= (CLOCK_CTRL_RXCLK_DISABLE | 1257 base_val |= (CLOCK_CTRL_RXCLK_DISABLE |
1240 CLOCK_CTRL_TXCLK_DISABLE); 1258 CLOCK_CTRL_TXCLK_DISABLE);
1241 1259
1242 tw32_f(TG3PCI_CLOCK_CTRL, base_val | 1260 tw32_wait_f(TG3PCI_CLOCK_CTRL, base_val | CLOCK_CTRL_ALTCLK |
1243 CLOCK_CTRL_ALTCLK | 1261 CLOCK_CTRL_PWRDOWN_PLL133, 40);
1244 CLOCK_CTRL_PWRDOWN_PLL133);
1245 udelay(40);
1246 } else if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { 1262 } else if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) {
1247 /* do nothing */ 1263 /* do nothing */
1248 } else if (!((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) && 1264 } else if (!((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) &&
@@ -1263,11 +1279,11 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
1263 newbits2 = newbits1 | CLOCK_CTRL_44MHZ_CORE; 1279 newbits2 = newbits1 | CLOCK_CTRL_44MHZ_CORE;
1264 } 1280 }
1265 1281
1266 tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits1); 1282 tw32_wait_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits1,
1267 udelay(40); 1283 40);
1268 1284
1269 tw32_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits2); 1285 tw32_wait_f(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl | newbits2,
1270 udelay(40); 1286 40);
1271 1287
1272 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { 1288 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
1273 u32 newbits3; 1289 u32 newbits3;
@@ -1281,9 +1297,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
1281 newbits3 = CLOCK_CTRL_44MHZ_CORE; 1297 newbits3 = CLOCK_CTRL_44MHZ_CORE;
1282 } 1298 }
1283 1299
1284 tw32_f(TG3PCI_CLOCK_CTRL, 1300 tw32_wait_f(TG3PCI_CLOCK_CTRL,
1285 tp->pci_clock_ctrl | newbits3); 1301 tp->pci_clock_ctrl | newbits3, 40);
1286 udelay(40);
1287 } 1302 }
1288 } 1303 }
1289 1304
@@ -1294,7 +1309,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
1294 tg3_writephy(tp, MII_TG3_EXT_CTRL, 1309 tg3_writephy(tp, MII_TG3_EXT_CTRL,
1295 MII_TG3_EXT_CTRL_FORCE_LED_OFF); 1310 MII_TG3_EXT_CTRL_FORCE_LED_OFF);
1296 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2); 1311 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2);
1297 tg3_writephy(tp, MII_BMCR, BMCR_PDOWN); 1312 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700)
1313 tg3_writephy(tp, MII_BMCR, BMCR_PDOWN);
1298 } 1314 }
1299 } 1315 }
1300 1316
@@ -7959,13 +7975,12 @@ static int tg3_test_memory(struct tg3 *tp)
7959 u32 offset; 7975 u32 offset;
7960 u32 len; 7976 u32 len;
7961 } mem_tbl_570x[] = { 7977 } mem_tbl_570x[] = {
7962 { 0x00000000, 0x01000}, 7978 { 0x00000000, 0x00b50},
7963 { 0x00002000, 0x1c000}, 7979 { 0x00002000, 0x1c000},
7964 { 0xffffffff, 0x00000} 7980 { 0xffffffff, 0x00000}
7965 }, mem_tbl_5705[] = { 7981 }, mem_tbl_5705[] = {
7966 { 0x00000100, 0x0000c}, 7982 { 0x00000100, 0x0000c},
7967 { 0x00000200, 0x00008}, 7983 { 0x00000200, 0x00008},
7968 { 0x00000b50, 0x00400},
7969 { 0x00004000, 0x00800}, 7984 { 0x00004000, 0x00800},
7970 { 0x00006000, 0x01000}, 7985 { 0x00006000, 0x01000},
7971 { 0x00008000, 0x02000}, 7986 { 0x00008000, 0x02000},
@@ -10466,7 +10481,7 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str)
10466 return str; 10481 return str;
10467} 10482}
10468 10483
10469static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp) 10484static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp)
10470{ 10485{
10471 struct pci_dev *peer; 10486 struct pci_dev *peer;
10472 unsigned int func, devnr = tp->pdev->devfn & ~7; 10487 unsigned int func, devnr = tp->pdev->devfn & ~7;
@@ -10719,8 +10734,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
10719 tp->rx_pending = 63; 10734 tp->rx_pending = 63;
10720 } 10735 }
10721 10736
10722 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) 10737 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
10723 tp->pdev_peer = tg3_find_5704_peer(tp); 10738 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714))
10739 tp->pdev_peer = tg3_find_peer(tp);
10724 10740
10725 err = tg3_get_device_address(tp); 10741 err = tg3_get_device_address(tp);
10726 if (err) { 10742 if (err) {
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 716df015f8d0..6707df968934 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -6,6 +6,9 @@ obj-y += access.o bus.o probe.o remove.o pci.o quirks.o \
6 pci-driver.o search.o pci-sysfs.o rom.o setup-res.o 6 pci-driver.o search.o pci-sysfs.o rom.o setup-res.o
7obj-$(CONFIG_PROC_FS) += proc.o 7obj-$(CONFIG_PROC_FS) += proc.o
8 8
9# Build PCI Express stuff if needed
10obj-$(CONFIG_PCIEPORTBUS) += pcie/
11
9obj-$(CONFIG_HOTPLUG) += hotplug.o 12obj-$(CONFIG_HOTPLUG) += hotplug.o
10 13
11# Build the PCI Hotplug drivers if we were asked to 14# Build the PCI Hotplug drivers if we were asked to
@@ -40,7 +43,3 @@ endif
40ifeq ($(CONFIG_PCI_DEBUG),y) 43ifeq ($(CONFIG_PCI_DEBUG),y)
41EXTRA_CFLAGS += -DDEBUG 44EXTRA_CFLAGS += -DDEBUG
42endif 45endif
43
44# Build PCI Express stuff if needed
45obj-$(CONFIG_PCIEPORTBUS) += pcie/
46
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c
index c12c5046e2fa..14631ac11bc7 100644
--- a/drivers/sbus/char/jsflash.c
+++ b/drivers/sbus/char/jsflash.c
@@ -249,11 +249,11 @@ static loff_t jsf_lseek(struct file * file, loff_t offset, int orig)
249/* 249/*
250 * OS SIMM Cannot be read in other size but a 32bits word. 250 * OS SIMM Cannot be read in other size but a 32bits word.
251 */ 251 */
252static ssize_t jsf_read(struct file * file, char * buf, 252static ssize_t jsf_read(struct file * file, char __user * buf,
253 size_t togo, loff_t *ppos) 253 size_t togo, loff_t *ppos)
254{ 254{
255 unsigned long p = *ppos; 255 unsigned long p = *ppos;
256 char *tmp = buf; 256 char __user *tmp = buf;
257 257
258 union byte4 { 258 union byte4 {
259 char s[4]; 259 char s[4];
@@ -305,7 +305,7 @@ static ssize_t jsf_read(struct file * file, char * buf,
305 return tmp-buf; 305 return tmp-buf;
306} 306}
307 307
308static ssize_t jsf_write(struct file * file, const char * buf, 308static ssize_t jsf_write(struct file * file, const char __user * buf,
309 size_t count, loff_t *ppos) 309 size_t count, loff_t *ppos)
310{ 310{
311 return -ENOSPC; 311 return -ENOSPC;
@@ -356,10 +356,10 @@ static int jsf_ioctl_erase(unsigned long arg)
356 * Program a block of flash. 356 * Program a block of flash.
357 * Very simple because we can do it byte by byte anyway. 357 * Very simple because we can do it byte by byte anyway.
358 */ 358 */
359static int jsf_ioctl_program(unsigned long arg) 359static int jsf_ioctl_program(void __user *arg)
360{ 360{
361 struct jsflash_program_arg abuf; 361 struct jsflash_program_arg abuf;
362 char *uptr; 362 char __user *uptr;
363 unsigned long p; 363 unsigned long p;
364 unsigned int togo; 364 unsigned int togo;
365 union { 365 union {
@@ -367,13 +367,13 @@ static int jsf_ioctl_program(unsigned long arg)
367 char s[4]; 367 char s[4];
368 } b; 368 } b;
369 369
370 if (copy_from_user(&abuf, (char *)arg, JSFPRGSZ)) 370 if (copy_from_user(&abuf, arg, JSFPRGSZ))
371 return -EFAULT; 371 return -EFAULT;
372 p = abuf.off; 372 p = abuf.off;
373 togo = abuf.size; 373 togo = abuf.size;
374 if ((togo & 3) || (p & 3)) return -EINVAL; 374 if ((togo & 3) || (p & 3)) return -EINVAL;
375 375
376 uptr = (char *) (unsigned long) abuf.data; 376 uptr = (char __user *) (unsigned long) abuf.data;
377 while (togo != 0) { 377 while (togo != 0) {
378 togo -= 4; 378 togo -= 4;
379 if (copy_from_user(&b.s[0], uptr, 4)) 379 if (copy_from_user(&b.s[0], uptr, 4))
@@ -390,19 +390,20 @@ static int jsf_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
390 unsigned long arg) 390 unsigned long arg)
391{ 391{
392 int error = -ENOTTY; 392 int error = -ENOTTY;
393 void __user *argp = (void __user *)arg;
393 394
394 if (!capable(CAP_SYS_ADMIN)) 395 if (!capable(CAP_SYS_ADMIN))
395 return -EPERM; 396 return -EPERM;
396 switch (cmd) { 397 switch (cmd) {
397 case JSFLASH_IDENT: 398 case JSFLASH_IDENT:
398 if (copy_to_user((void *)arg, &jsf0.id, JSFIDSZ)) 399 if (copy_to_user(argp, &jsf0.id, JSFIDSZ))
399 return -EFAULT; 400 return -EFAULT;
400 break; 401 break;
401 case JSFLASH_ERASE: 402 case JSFLASH_ERASE:
402 error = jsf_ioctl_erase(arg); 403 error = jsf_ioctl_erase(arg);
403 break; 404 break;
404 case JSFLASH_PROGRAM: 405 case JSFLASH_PROGRAM:
405 error = jsf_ioctl_program(arg); 406 error = jsf_ioctl_program(argp);
406 break; 407 break;
407 } 408 }
408 409
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index 858cc683f85c..e2d9a7c85427 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -309,7 +309,7 @@ static void uctrl_do_txn(struct uctrl_txn *txn)
309 } 309 }
310} 310}
311 311
312void uctrl_get_event_status() 312void uctrl_get_event_status(void)
313{ 313{
314 struct uctrl_driver *driver = &drv; 314 struct uctrl_driver *driver = &drv;
315 struct uctrl_txn txn; 315 struct uctrl_txn txn;
@@ -318,7 +318,7 @@ void uctrl_get_event_status()
318 txn.opcode = READ_EVENT_STATUS; 318 txn.opcode = READ_EVENT_STATUS;
319 txn.inbits = 0; 319 txn.inbits = 0;
320 txn.outbits = 2; 320 txn.outbits = 2;
321 txn.inbuf = 0; 321 txn.inbuf = NULL;
322 txn.outbuf = outbits; 322 txn.outbuf = outbits;
323 323
324 uctrl_do_txn(&txn); 324 uctrl_do_txn(&txn);
@@ -329,7 +329,7 @@ void uctrl_get_event_status()
329 dprintk(("ev is %x\n", driver->status.event_status)); 329 dprintk(("ev is %x\n", driver->status.event_status));
330} 330}
331 331
332void uctrl_get_external_status() 332void uctrl_get_external_status(void)
333{ 333{
334 struct uctrl_driver *driver = &drv; 334 struct uctrl_driver *driver = &drv;
335 struct uctrl_txn txn; 335 struct uctrl_txn txn;
@@ -339,7 +339,7 @@ void uctrl_get_external_status()
339 txn.opcode = READ_EXTERNAL_STATUS; 339 txn.opcode = READ_EXTERNAL_STATUS;
340 txn.inbits = 0; 340 txn.inbits = 0;
341 txn.outbits = 2; 341 txn.outbits = 2;
342 txn.inbuf = 0; 342 txn.inbuf = NULL;
343 txn.outbuf = outbits; 343 txn.outbuf = outbits;
344 344
345 uctrl_do_txn(&txn); 345 uctrl_do_txn(&txn);
@@ -414,7 +414,7 @@ static void __exit ts102_uctrl_cleanup(void)
414 if (driver->irq) 414 if (driver->irq)
415 free_irq(driver->irq, driver); 415 free_irq(driver->irq, driver);
416 if (driver->regs) 416 if (driver->regs)
417 driver->regs = 0; 417 driver->regs = NULL;
418} 418}
419 419
420module_init(ts102_uctrl_init); 420module_init(ts102_uctrl_init);
diff --git a/drivers/sbus/char/vfc.h b/drivers/sbus/char/vfc.h
index a7782e7da42e..8045cd5e7cb3 100644
--- a/drivers/sbus/char/vfc.h
+++ b/drivers/sbus/char/vfc.h
@@ -125,7 +125,7 @@ struct vfc_regs {
125 125
126 126
127struct vfc_dev { 127struct vfc_dev {
128 volatile struct vfc_regs *regs; 128 volatile struct vfc_regs __iomem *regs;
129 struct vfc_regs *phys_regs; 129 struct vfc_regs *phys_regs;
130 unsigned int control_reg; 130 unsigned int control_reg;
131 struct semaphore device_lock_sem; 131 struct semaphore device_lock_sem;
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
index 7a103698fa3c..dfdd6be551f3 100644
--- a/drivers/sbus/char/vfc_dev.c
+++ b/drivers/sbus/char/vfc_dev.c
@@ -149,7 +149,7 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance)
149 } 149 }
150 printk("Initializing vfc%d\n",instance); 150 printk("Initializing vfc%d\n",instance);
151 dev->regs = NULL; 151 dev->regs = NULL;
152 dev->regs = (volatile struct vfc_regs *) 152 dev->regs = (volatile struct vfc_regs __iomem *)
153 sbus_ioremap(&sdev->resource[0], 0, 153 sbus_ioremap(&sdev->resource[0], 0,
154 sizeof(struct vfc_regs), vfcstr); 154 sizeof(struct vfc_regs), vfcstr);
155 dev->which_io = sdev->reg_addrs[0].which_io; 155 dev->which_io = sdev->reg_addrs[0].which_io;
@@ -319,7 +319,7 @@ int vfc_capture_poll(struct vfc_dev *dev)
319 int timeout = 1000; 319 int timeout = 1000;
320 320
321 while (!timeout--) { 321 while (!timeout--) {
322 if (dev->regs->control & VFC_STATUS_CAPTURE) 322 if (sbus_readl(&dev->regs->control) & VFC_STATUS_CAPTURE)
323 break; 323 break;
324 vfc_i2c_delay_no_busy(dev, 100); 324 vfc_i2c_delay_no_busy(dev, 100);
325 } 325 }
@@ -718,7 +718,7 @@ static void deinit_vfc_device(struct vfc_dev *dev)
718 if(dev == NULL) 718 if(dev == NULL)
719 return; 719 return;
720 devfs_remove("vfc/%d", dev->instance); 720 devfs_remove("vfc/%d", dev->instance);
721 sbus_iounmap((unsigned long)dev->regs, sizeof(struct vfc_regs)); 721 sbus_iounmap(dev->regs, sizeof(struct vfc_regs));
722 kfree(dev); 722 kfree(dev);
723} 723}
724 724
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 418fc7b896ac..6252b9ddc01e 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -660,7 +660,12 @@ static int adpt_abort(struct scsi_cmnd * cmd)
660 msg[2] = 0; 660 msg[2] = 0;
661 msg[3]= 0; 661 msg[3]= 0;
662 msg[4] = (u32)cmd; 662 msg[4] = (u32)cmd;
663 if( (rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER)) != 0){ 663 if (pHba->host)
664 spin_lock_irq(pHba->host->host_lock);
665 rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER);
666 if (pHba->host)
667 spin_unlock_irq(pHba->host->host_lock);
668 if (rcode != 0) {
664 if(rcode == -EOPNOTSUPP ){ 669 if(rcode == -EOPNOTSUPP ){
665 printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name); 670 printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name);
666 return FAILED; 671 return FAILED;
@@ -697,10 +702,15 @@ static int adpt_device_reset(struct scsi_cmnd* cmd)
697 msg[2] = 0; 702 msg[2] = 0;
698 msg[3] = 0; 703 msg[3] = 0;
699 704
705 if (pHba->host)
706 spin_lock_irq(pHba->host->host_lock);
700 old_state = d->state; 707 old_state = d->state;
701 d->state |= DPTI_DEV_RESET; 708 d->state |= DPTI_DEV_RESET;
702 if( (rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER)) ){ 709 rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER);
703 d->state = old_state; 710 d->state = old_state;
711 if (pHba->host)
712 spin_unlock_irq(pHba->host->host_lock);
713 if (rcode != 0) {
704 if(rcode == -EOPNOTSUPP ){ 714 if(rcode == -EOPNOTSUPP ){
705 printk(KERN_INFO"%s: Device reset not supported\n",pHba->name); 715 printk(KERN_INFO"%s: Device reset not supported\n",pHba->name);
706 return FAILED; 716 return FAILED;
@@ -708,7 +718,6 @@ static int adpt_device_reset(struct scsi_cmnd* cmd)
708 printk(KERN_INFO"%s: Device reset failed\n",pHba->name); 718 printk(KERN_INFO"%s: Device reset failed\n",pHba->name);
709 return FAILED; 719 return FAILED;
710 } else { 720 } else {
711 d->state = old_state;
712 printk(KERN_INFO"%s: Device reset successful\n",pHba->name); 721 printk(KERN_INFO"%s: Device reset successful\n",pHba->name);
713 return SUCCESS; 722 return SUCCESS;
714 } 723 }
@@ -721,6 +730,7 @@ static int adpt_bus_reset(struct scsi_cmnd* cmd)
721{ 730{
722 adpt_hba* pHba; 731 adpt_hba* pHba;
723 u32 msg[4]; 732 u32 msg[4];
733 u32 rcode;
724 734
725 pHba = (adpt_hba*)cmd->device->host->hostdata[0]; 735 pHba = (adpt_hba*)cmd->device->host->hostdata[0];
726 memset(msg, 0, sizeof(msg)); 736 memset(msg, 0, sizeof(msg));
@@ -729,7 +739,12 @@ static int adpt_bus_reset(struct scsi_cmnd* cmd)
729 msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid); 739 msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid);
730 msg[2] = 0; 740 msg[2] = 0;
731 msg[3] = 0; 741 msg[3] = 0;
732 if(adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER) ){ 742 if (pHba->host)
743 spin_lock_irq(pHba->host->host_lock);
744 rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER);
745 if (pHba->host)
746 spin_unlock_irq(pHba->host->host_lock);
747 if (rcode != 0) {
733 printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name); 748 printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name);
734 return FAILED; 749 return FAILED;
735 } else { 750 } else {
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 4fea3e4edaa7..3d8009f55342 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -3368,7 +3368,7 @@ iscsi_conn_set_param(iscsi_connh_t connh, enum iscsi_param param,
3368 switch(param) { 3368 switch(param) {
3369 case ISCSI_PARAM_MAX_RECV_DLENGTH: { 3369 case ISCSI_PARAM_MAX_RECV_DLENGTH: {
3370 char *saveptr = conn->data; 3370 char *saveptr = conn->data;
3371 int flags = GFP_KERNEL; 3371 gfp_t flags = GFP_KERNEL;
3372 3372
3373 if (conn->data_size >= value) { 3373 if (conn->data_size >= value) {
3374 conn->max_recv_dlength = value; 3374 conn->max_recv_dlength = value;
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 49fd18c1a9c6..e08462d50c97 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -249,7 +249,7 @@ static inline struct list_head *skb_to_lh(struct sk_buff *skb)
249} 249}
250 250
251static void* 251static void*
252mempool_zone_alloc_skb(unsigned int gfp_mask, void *pool_data) 252mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data)
253{ 253{
254 struct mempool_zone *zone = pool_data; 254 struct mempool_zone *zone = pool_data;
255 255
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index ed550132db0b..79efaf7d86a3 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -717,6 +717,7 @@ static int uhci_suspend(struct usb_hcd *hcd, pm_message_t message)
717 * at the source, so we must turn off PIRQ. 717 * at the source, so we must turn off PIRQ.
718 */ 718 */
719 pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0); 719 pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0);
720 mb();
720 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 721 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
721 uhci->hc_inaccessible = 1; 722 uhci->hc_inaccessible = 1;
722 hcd->poll_rh = 0; 723 hcd->poll_rh = 0;
@@ -738,6 +739,7 @@ static int uhci_resume(struct usb_hcd *hcd)
738 * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0 739 * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0
739 */ 740 */
740 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 741 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
742 mb();
741 743
742 if (uhci->rh_state == UHCI_RH_RESET) /* Dead */ 744 if (uhci->rh_state == UHCI_RH_RESET) /* Dead */
743 return 0; 745 return 0;
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
index 9ff25eb520a6..1220a5004a5c 100644
--- a/drivers/usb/input/hid-input.c
+++ b/drivers/usb/input/hid-input.c
@@ -137,6 +137,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
137 switch (usage->hid & 0xffff) { 137 switch (usage->hid & 0xffff) {
138 case 0xba: map_abs(ABS_RUDDER); break; 138 case 0xba: map_abs(ABS_RUDDER); break;
139 case 0xbb: map_abs(ABS_THROTTLE); break; 139 case 0xbb: map_abs(ABS_THROTTLE); break;
140 default: goto ignore;
140 } 141 }
141 break; 142 break;
142 143
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index 2a28ceeaa66a..b293db3c28c3 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -1696,7 +1696,7 @@ static ssize_t auerchar_write (struct file *file, const char __user *buf, size_t
1696 int ret; 1696 int ret;
1697 wait_queue_t wait; 1697 wait_queue_t wait;
1698 1698
1699 dbg ("auerchar_write %d bytes", len); 1699 dbg ("auerchar_write %zd bytes", len);
1700 1700
1701 /* Error checking */ 1701 /* Error checking */
1702 if (!ccp) 1702 if (!ccp)
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 080db812ca48..2784f0a9d693 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -441,7 +441,7 @@ static int arcfb_ioctl(struct inode *inode, struct file *file,
441 * the fb. it's inefficient for them to do anything less than 64*8 441 * the fb. it's inefficient for them to do anything less than 64*8
442 * writes since we update the lcd in each write() anyway. 442 * writes since we update the lcd in each write() anyway.
443 */ 443 */
444static ssize_t arcfb_write(struct file *file, const char *buf, size_t count, 444static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t count,
445 loff_t *ppos) 445 loff_t *ppos)
446{ 446{
447 /* modded from epson 1355 */ 447 /* modded from epson 1355 */
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index c589d23e7f91..a9300f930ef2 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -1512,7 +1512,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
1512 * I/O cycles storing into a reserved memory space at 1512 * I/O cycles storing into a reserved memory space at
1513 * physical address 0x3000000 1513 * physical address 0x3000000
1514 */ 1514 */
1515 unsigned char *iop; 1515 unsigned char __iomem *iop;
1516 1516
1517 iop = ioremap(0x3000000, 0x5000); 1517 iop = ioremap(0x3000000, 0x5000);
1518 if (iop == NULL) { 1518 if (iop == NULL) {
@@ -1526,7 +1526,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
1526 writeb(EXT_BIU_MISC, iop + 0x3ce); 1526 writeb(EXT_BIU_MISC, iop + 0x3ce);
1527 writeb(EXT_BIU_MISC_LIN_ENABLE, iop + 0x3cf); 1527 writeb(EXT_BIU_MISC_LIN_ENABLE, iop + 0x3cf);
1528 1528
1529 iounmap((void *)iop); 1529 iounmap(iop);
1530#else 1530#else
1531 /* 1531 /*
1532 * Most other machine types are "normal", so 1532 * Most other machine types are "normal", so
diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
index f077ca34faba..da29d007f215 100644
--- a/drivers/video/intelfb/intelfb.h
+++ b/drivers/video/intelfb/intelfb.h
@@ -41,6 +41,10 @@
41 41
42/*** hw-related values ***/ 42/*** hw-related values ***/
43 43
44/* Resource Allocation */
45#define INTELFB_FB_ACQUIRED 1
46#define INTELFB_MMIO_ACQUIRED 2
47
44/* PCI ids for supported devices */ 48/* PCI ids for supported devices */
45#define PCI_DEVICE_ID_INTEL_830M 0x3577 49#define PCI_DEVICE_ID_INTEL_830M 0x3577
46#define PCI_DEVICE_ID_INTEL_845G 0x2562 50#define PCI_DEVICE_ID_INTEL_845G 0x2562
@@ -257,6 +261,7 @@ struct intelfb_info {
257 int hwcursor; 261 int hwcursor;
258 int fixed_mode; 262 int fixed_mode;
259 int ring_active; 263 int ring_active;
264 int flag;
260 265
261 /* hw cursor */ 266 /* hw cursor */
262 int cursor_on; 267 int cursor_on;
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 427689e584da..0090544842f5 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -135,9 +135,6 @@
135static void __devinit get_initial_mode(struct intelfb_info *dinfo); 135static void __devinit get_initial_mode(struct intelfb_info *dinfo);
136static void update_dinfo(struct intelfb_info *dinfo, 136static void update_dinfo(struct intelfb_info *dinfo,
137 struct fb_var_screeninfo *var); 137 struct fb_var_screeninfo *var);
138static int intelfb_get_fix(struct fb_fix_screeninfo *fix,
139 struct fb_info *info);
140
141static int intelfb_check_var(struct fb_var_screeninfo *var, 138static int intelfb_check_var(struct fb_var_screeninfo *var,
142 struct fb_info *info); 139 struct fb_info *info);
143static int intelfb_set_par(struct fb_info *info); 140static int intelfb_set_par(struct fb_info *info);
@@ -473,9 +470,9 @@ cleanup(struct intelfb_info *dinfo)
473 if (dinfo->aperture.virtual) 470 if (dinfo->aperture.virtual)
474 iounmap((void __iomem *)dinfo->aperture.virtual); 471 iounmap((void __iomem *)dinfo->aperture.virtual);
475 472
476 if (dinfo->mmio_base_phys) 473 if (dinfo->flag & INTELFB_MMIO_ACQUIRED)
477 release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE); 474 release_mem_region(dinfo->mmio_base_phys, INTEL_REG_SIZE);
478 if (dinfo->aperture.physical) 475 if (dinfo->flag & INTELFB_FB_ACQUIRED)
479 release_mem_region(dinfo->aperture.physical, 476 release_mem_region(dinfo->aperture.physical,
480 dinfo->aperture.size); 477 dinfo->aperture.size);
481 framebuffer_release(dinfo->info); 478 framebuffer_release(dinfo->info);
@@ -572,6 +569,9 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
572 cleanup(dinfo); 569 cleanup(dinfo);
573 return -ENODEV; 570 return -ENODEV;
574 } 571 }
572
573 dinfo->flag |= INTELFB_FB_ACQUIRED;
574
575 if (!request_mem_region(dinfo->mmio_base_phys, 575 if (!request_mem_region(dinfo->mmio_base_phys,
576 INTEL_REG_SIZE, 576 INTEL_REG_SIZE,
577 INTELFB_MODULE_NAME)) { 577 INTELFB_MODULE_NAME)) {
@@ -580,6 +580,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
580 return -ENODEV; 580 return -ENODEV;
581 } 581 }
582 582
583 dinfo->flag |= INTELFB_MMIO_ACQUIRED;
584
583 /* Get the chipset info. */ 585 /* Get the chipset info. */
584 dinfo->pci_chipset = pdev->device; 586 dinfo->pci_chipset = pdev->device;
585 587
@@ -1091,7 +1093,17 @@ intelfb_set_fbinfo(struct intelfb_info *dinfo)
1091 return 1; 1093 return 1;
1092 1094
1093 info->pixmap.scan_align = 1; 1095 info->pixmap.scan_align = 1;
1094 1096 strcpy(info->fix.id, dinfo->name);
1097 info->fix.smem_start = dinfo->fb.physical;
1098 info->fix.smem_len = dinfo->fb.size;
1099 info->fix.type = FB_TYPE_PACKED_PIXELS;
1100 info->fix.type_aux = 0;
1101 info->fix.xpanstep = 8;
1102 info->fix.ypanstep = 1;
1103 info->fix.ywrapstep = 0;
1104 info->fix.mmio_start = dinfo->mmio_base_phys;
1105 info->fix.mmio_len = INTEL_REG_SIZE;
1106 info->fix.accel = FB_ACCEL_I830;
1095 update_dinfo(dinfo, &info->var); 1107 update_dinfo(dinfo, &info->var);
1096 1108
1097 return 0; 1109 return 0;
@@ -1109,7 +1121,8 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var)
1109 dinfo->yres = var->xres; 1121 dinfo->yres = var->xres;
1110 dinfo->pixclock = var->pixclock; 1122 dinfo->pixclock = var->pixclock;
1111 1123
1112 intelfb_get_fix(&dinfo->info->fix, dinfo->info); 1124 dinfo->info->fix.visual = dinfo->visual;
1125 dinfo->info->fix.line_length = dinfo->pitch;
1113 1126
1114 switch (dinfo->bpp) { 1127 switch (dinfo->bpp) {
1115 case 8: 1128 case 8:
@@ -1139,30 +1152,6 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var)
1139 1152
1140/* fbops functions */ 1153/* fbops functions */
1141 1154
1142static int
1143intelfb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
1144{
1145 struct intelfb_info *dinfo = GET_DINFO(info);
1146
1147 DBG_MSG("intelfb_get_fix\n");
1148
1149 memset(fix, 0, sizeof(*fix));
1150 strcpy(fix->id, dinfo->name);
1151 fix->smem_start = dinfo->fb.physical;
1152 fix->smem_len = dinfo->fb.size;
1153 fix->type = FB_TYPE_PACKED_PIXELS;
1154 fix->type_aux = 0;
1155 fix->visual = dinfo->visual;
1156 fix->xpanstep = 8;
1157 fix->ypanstep = 1;
1158 fix->ywrapstep = 0;
1159 fix->line_length = dinfo->pitch;
1160 fix->mmio_start = dinfo->mmio_base_phys;
1161 fix->mmio_len = INTEL_REG_SIZE;
1162 fix->accel = FB_ACCEL_I830;
1163 return 0;
1164}
1165
1166/*************************************************************** 1155/***************************************************************
1167 * fbdev interface * 1156 * fbdev interface *
1168 ***************************************************************/ 1157 ***************************************************************/
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index 006bb9e14579..3eaf6e701087 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -157,6 +157,8 @@ void nlmclnt_mark_reclaim(struct nlm_host *host)
157 inode = fl->fl_file->f_dentry->d_inode; 157 inode = fl->fl_file->f_dentry->d_inode;
158 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) 158 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
159 continue; 159 continue;
160 if (fl->fl_u.nfs_fl.owner == NULL)
161 continue;
160 if (fl->fl_u.nfs_fl.owner->host != host) 162 if (fl->fl_u.nfs_fl.owner->host != host)
161 continue; 163 continue;
162 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED)) 164 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED))
@@ -226,6 +228,8 @@ restart:
226 inode = fl->fl_file->f_dentry->d_inode; 228 inode = fl->fl_file->f_dentry->d_inode;
227 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) 229 if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
228 continue; 230 continue;
231 if (fl->fl_u.nfs_fl.owner == NULL)
232 continue;
229 if (fl->fl_u.nfs_fl.owner->host != host) 233 if (fl->fl_u.nfs_fl.owner->host != host)
230 continue; 234 continue;
231 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM)) 235 if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM))
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index b497c71384e8..079228817603 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -678,15 +678,9 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t
678 if (!count) 678 if (!count)
679 goto out; 679 goto out;
680 680
681 if (mapping->nrpages) { 681 retval = nfs_sync_mapping(mapping);
682 retval = filemap_fdatawrite(mapping); 682 if (retval)
683 if (retval == 0) 683 goto out;
684 retval = nfs_wb_all(inode);
685 if (retval == 0)
686 retval = filemap_fdatawait(mapping);
687 if (retval)
688 goto out;
689 }
690 684
691 retval = nfs_direct_read(inode, ctx, &iov, pos, 1); 685 retval = nfs_direct_read(inode, ctx, &iov, pos, 1);
692 if (retval > 0) 686 if (retval > 0)
@@ -764,15 +758,9 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count,
764 if (!count) 758 if (!count)
765 goto out; 759 goto out;
766 760
767 if (mapping->nrpages) { 761 retval = nfs_sync_mapping(mapping);
768 retval = filemap_fdatawrite(mapping); 762 if (retval)
769 if (retval == 0) 763 goto out;
770 retval = nfs_wb_all(inode);
771 if (retval == 0)
772 retval = filemap_fdatawait(mapping);
773 if (retval)
774 goto out;
775 }
776 764
777 retval = nfs_direct_write(inode, ctx, &iov, pos, 1); 765 retval = nfs_direct_write(inode, ctx, &iov, pos, 1);
778 if (mapping->nrpages) 766 if (mapping->nrpages)
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 57d3e77d97ee..eb5cd4c3bbfd 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -433,11 +433,7 @@ static int do_unlk(struct file *filp, int cmd, struct file_lock *fl)
433 * Flush all pending writes before doing anything 433 * Flush all pending writes before doing anything
434 * with locks.. 434 * with locks..
435 */ 435 */
436 filemap_fdatawrite(filp->f_mapping); 436 nfs_sync_mapping(filp->f_mapping);
437 down(&inode->i_sem);
438 nfs_wb_all(inode);
439 up(&inode->i_sem);
440 filemap_fdatawait(filp->f_mapping);
441 437
442 /* NOTE: special case 438 /* NOTE: special case
443 * If we're signalled while cleaning up locks on process exit, we 439 * If we're signalled while cleaning up locks on process exit, we
@@ -465,15 +461,8 @@ static int do_setlk(struct file *filp, int cmd, struct file_lock *fl)
465 * Flush all pending writes before doing anything 461 * Flush all pending writes before doing anything
466 * with locks.. 462 * with locks..
467 */ 463 */
468 status = filemap_fdatawrite(filp->f_mapping); 464 status = nfs_sync_mapping(filp->f_mapping);
469 if (status == 0) { 465 if (status != 0)
470 down(&inode->i_sem);
471 status = nfs_wb_all(inode);
472 up(&inode->i_sem);
473 if (status == 0)
474 status = filemap_fdatawait(filp->f_mapping);
475 }
476 if (status < 0)
477 goto out; 466 goto out;
478 467
479 lock_kernel(); 468 lock_kernel();
@@ -497,11 +486,7 @@ static int do_setlk(struct file *filp, int cmd, struct file_lock *fl)
497 * Make sure we clear the cache whenever we try to get the lock. 486 * Make sure we clear the cache whenever we try to get the lock.
498 * This makes locking act as a cache coherency point. 487 * This makes locking act as a cache coherency point.
499 */ 488 */
500 filemap_fdatawrite(filp->f_mapping); 489 nfs_sync_mapping(filp->f_mapping);
501 down(&inode->i_sem);
502 nfs_wb_all(inode); /* we may have slept */
503 up(&inode->i_sem);
504 filemap_fdatawait(filp->f_mapping);
505 nfs_zap_caches(inode); 490 nfs_zap_caches(inode);
506out: 491out:
507 rpc_clnt_sigunmask(NFS_CLIENT(inode), &oldset); 492 rpc_clnt_sigunmask(NFS_CLIENT(inode), &oldset);
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index afd75d0463fd..432f41cd75e6 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -640,6 +640,27 @@ static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt)
640 return 0; 640 return 0;
641} 641}
642 642
643/**
644 * nfs_sync_mapping - helper to flush all mmapped dirty data to disk
645 */
646int nfs_sync_mapping(struct address_space *mapping)
647{
648 int ret;
649
650 if (mapping->nrpages == 0)
651 return 0;
652 unmap_mapping_range(mapping, 0, 0, 0);
653 ret = filemap_fdatawrite(mapping);
654 if (ret != 0)
655 goto out;
656 ret = filemap_fdatawait(mapping);
657 if (ret != 0)
658 goto out;
659 ret = nfs_wb_all(mapping->host);
660out:
661 return ret;
662}
663
643/* 664/*
644 * Invalidate the local caches 665 * Invalidate the local caches
645 */ 666 */
@@ -1179,11 +1200,8 @@ void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
1179 struct nfs_inode *nfsi = NFS_I(inode); 1200 struct nfs_inode *nfsi = NFS_I(inode);
1180 1201
1181 if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { 1202 if (nfsi->cache_validity & NFS_INO_INVALID_DATA) {
1182 if (S_ISREG(inode->i_mode)) { 1203 if (S_ISREG(inode->i_mode))
1183 if (filemap_fdatawrite(mapping) == 0) 1204 nfs_sync_mapping(mapping);
1184 filemap_fdatawait(mapping);
1185 nfs_wb_all(inode);
1186 }
1187 invalidate_inode_pages2(mapping); 1205 invalidate_inode_pages2(mapping);
1188 1206
1189 spin_lock(&inode->i_lock); 1207 spin_lock(&inode->i_lock);
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 1aea42d71a64..5328a2937127 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -78,7 +78,7 @@ STATIC int xfs_qm_dqhashlock_nowait(xfs_dquot_t *);
78 78
79STATIC int xfs_qm_init_quotainos(xfs_mount_t *); 79STATIC int xfs_qm_init_quotainos(xfs_mount_t *);
80STATIC int xfs_qm_init_quotainfo(xfs_mount_t *); 80STATIC int xfs_qm_init_quotainfo(xfs_mount_t *);
81STATIC int xfs_qm_shake(int, unsigned int); 81STATIC int xfs_qm_shake(int, gfp_t);
82 82
83#ifdef DEBUG 83#ifdef DEBUG
84extern mutex_t qcheck_lock; 84extern mutex_t qcheck_lock;
@@ -2197,7 +2197,7 @@ xfs_qm_shake_freelist(
2197 */ 2197 */
2198/* ARGSUSED */ 2198/* ARGSUSED */
2199STATIC int 2199STATIC int
2200xfs_qm_shake(int nr_to_scan, unsigned int gfp_mask) 2200xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask)
2201{ 2201{
2202 int ndqused, nfree, n; 2202 int ndqused, nfree, n;
2203 2203
diff --git a/include/asm-ia64/delay.h b/include/asm-ia64/delay.h
index 57182d6f2b9a..bba702076391 100644
--- a/include/asm-ia64/delay.h
+++ b/include/asm-ia64/delay.h
@@ -84,14 +84,6 @@ __delay (unsigned long loops)
84 ia64_delay_loop (loops - 1); 84 ia64_delay_loop (loops - 1);
85} 85}
86 86
87static __inline__ void 87extern void udelay (unsigned long usecs);
88udelay (unsigned long usecs)
89{
90 unsigned long start = ia64_get_itc();
91 unsigned long cycles = usecs*local_cpu_data->cyc_per_usec;
92
93 while (ia64_get_itc() - start < cycles)
94 cpu_relax();
95}
96 88
97#endif /* _ASM_IA64_DELAY_H */ 89#endif /* _ASM_IA64_DELAY_H */
diff --git a/include/asm-ppc/ppc4xx_dma.h b/include/asm-ppc/ppc4xx_dma.h
index a415001165fa..46a086fff816 100644
--- a/include/asm-ppc/ppc4xx_dma.h
+++ b/include/asm-ppc/ppc4xx_dma.h
@@ -33,9 +33,6 @@
33 33
34#define MAX_PPC4xx_DMA_CHANNELS 4 34#define MAX_PPC4xx_DMA_CHANNELS 4
35 35
36/* in arch/ppc/kernel/setup.c -- Cort */
37extern unsigned long DMA_MODE_WRITE, DMA_MODE_READ;
38
39/* 36/*
40 * Function return status codes 37 * Function return status codes
41 * These values are used to indicate whether or not the function 38 * These values are used to indicate whether or not the function
diff --git a/include/asm-sparc/memreg.h b/include/asm-sparc/memreg.h
index c0498d3baf93..5fb95c828da6 100644
--- a/include/asm-sparc/memreg.h
+++ b/include/asm-sparc/memreg.h
@@ -36,7 +36,7 @@
36 36
37/* Memory parity error register with associated bit constants. */ 37/* Memory parity error register with associated bit constants. */
38#ifndef __ASSEMBLY__ 38#ifndef __ASSEMBLY__
39extern __volatile__ unsigned long *sun4c_memerr_reg; 39extern __volatile__ unsigned long __iomem *sun4c_memerr_reg;
40#endif 40#endif
41 41
42#define SUN4C_MPE_ERROR 0x80 /* Parity error detected. (ro) */ 42#define SUN4C_MPE_ERROR 0x80 /* Parity error detected. (ro) */
diff --git a/include/asm-sparc/pcic.h b/include/asm-sparc/pcic.h
index 301ae8022ddd..dedea14d87c8 100644
--- a/include/asm-sparc/pcic.h
+++ b/include/asm-sparc/pcic.h
@@ -16,10 +16,10 @@
16#include <asm/pbm.h> 16#include <asm/pbm.h>
17 17
18struct linux_pcic { 18struct linux_pcic {
19 void * __iomem pcic_regs; 19 void __iomem *pcic_regs;
20 unsigned long pcic_io; 20 unsigned long pcic_io;
21 void * __iomem pcic_config_space_addr; 21 void __iomem *pcic_config_space_addr;
22 void * __iomem pcic_config_space_data; 22 void __iomem *pcic_config_space_data;
23 struct resource pcic_res_regs; 23 struct resource pcic_res_regs;
24 struct resource pcic_res_io; 24 struct resource pcic_res_io;
25 struct resource pcic_res_cfg_addr; 25 struct resource pcic_res_cfg_addr;
diff --git a/include/linux/cache.h b/include/linux/cache.h
index f6b5a46c5f82..0b7ecf3af78a 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,7 +13,7 @@
13#define SMP_CACHE_BYTES L1_CACHE_BYTES 13#define SMP_CACHE_BYTES L1_CACHE_BYTES
14#endif 14#endif
15 15
16#if defined(CONFIG_X86) || defined(CONFIG_SPARC64) 16#if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64)
17#define __read_mostly __attribute__((__section__(".data.read_mostly"))) 17#define __read_mostly __attribute__((__section__(".data.read_mostly")))
18#else 18#else
19#define __read_mostly 19#define __read_mostly
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e5677f456742..a06a84d347fb 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -163,6 +163,7 @@ extern unsigned int kobjsize(const void *objp);
163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ 165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
166#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
166 167
167#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 168#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
168#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 169#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index f1fd4215686a..7419b5fab133 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -17,7 +17,6 @@
17#include <linux/mtd/bbm.h> 17#include <linux/mtd/bbm.h>
18 18
19#define MAX_BUFFERRAM 2 19#define MAX_BUFFERRAM 2
20#define MAX_ONENAND_PAGESIZE (2048 + 64)
21 20
22/* Scan and identify a OneNAND device */ 21/* Scan and identify a OneNAND device */
23extern int onenand_scan(struct mtd_info *mtd, int max_chips); 22extern int onenand_scan(struct mtd_info *mtd, int max_chips);
@@ -110,6 +109,7 @@ struct onenand_chip {
110 spinlock_t chip_lock; 109 spinlock_t chip_lock;
111 wait_queue_head_t wq; 110 wait_queue_head_t wq;
112 onenand_state_t state; 111 onenand_state_t state;
112 unsigned char *page_buf;
113 113
114 struct nand_oobinfo *autooob; 114 struct nand_oobinfo *autooob;
115 115
@@ -134,13 +134,12 @@ struct onenand_chip {
134 * Options bits 134 * Options bits
135 */ 135 */
136#define ONENAND_CONT_LOCK (0x0001) 136#define ONENAND_CONT_LOCK (0x0001)
137 137#define ONENAND_PAGEBUF_ALLOC (0x1000)
138 138
139/* 139/*
140 * OneNAND Flash Manufacturer ID Codes 140 * OneNAND Flash Manufacturer ID Codes
141 */ 141 */
142#define ONENAND_MFR_SAMSUNG 0xec 142#define ONENAND_MFR_SAMSUNG 0xec
143#define ONENAND_MFR_UNKNOWN 0x00
144 143
145/** 144/**
146 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure 145 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 12787a9b0259..2516adeccecf 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -291,6 +291,7 @@ static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long
291/* 291/*
292 * linux/fs/nfs/inode.c 292 * linux/fs/nfs/inode.c
293 */ 293 */
294extern int nfs_sync_mapping(struct address_space *mapping);
294extern void nfs_zap_caches(struct inode *); 295extern void nfs_zap_caches(struct inode *);
295extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 296extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
296 struct nfs_fattr *); 297 struct nfs_fattr *);
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index c231e9a08f0b..d50482ba27fe 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -866,6 +866,7 @@ enum rtnetlink_groups {
866#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE 866#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
867 RTNLGRP_IPV4_ROUTE, 867 RTNLGRP_IPV4_ROUTE,
868#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE 868#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
869 RTNLGRP_NOP1,
869 RTNLGRP_IPV6_IFADDR, 870 RTNLGRP_IPV6_IFADDR,
870#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR 871#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
871 RTNLGRP_IPV6_MROUTE, 872 RTNLGRP_IPV6_MROUTE,
@@ -876,8 +877,11 @@ enum rtnetlink_groups {
876#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO 877#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
877 RTNLGRP_DECnet_IFADDR, 878 RTNLGRP_DECnet_IFADDR,
878#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR 879#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
880 RTNLGRP_NOP2,
879 RTNLGRP_DECnet_ROUTE, 881 RTNLGRP_DECnet_ROUTE,
880#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE 882#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
883 RTNLGRP_NOP3,
884 RTNLGRP_NOP4,
881 RTNLGRP_IPV6_PREFIX, 885 RTNLGRP_IPV6_PREFIX,
882#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX 886#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
883 __RTNLGRP_MAX 887 __RTNLGRP_MAX
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 5beae1ccd574..1cdb87912137 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -890,6 +890,7 @@ struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
890extern void xfrm_policy_flush(void); 890extern void xfrm_policy_flush(void);
891extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); 891extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
892extern int xfrm_flush_bundles(void); 892extern int xfrm_flush_bundles(void);
893extern void xfrm_flush_all_bundles(void);
893extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family); 894extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family);
894extern void xfrm_init_pmtu(struct dst_entry *dst); 895extern void xfrm_init_pmtu(struct dst_entry *dst);
895 896
diff --git a/mm/memory.c b/mm/memory.c
index d22f78c8a381..d8dde07a3656 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -574,7 +574,7 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
574 * readonly mappings. The tradeoff is that copy_page_range is more 574 * readonly mappings. The tradeoff is that copy_page_range is more
575 * efficient than faulting. 575 * efficient than faulting.
576 */ 576 */
577 if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP))) { 577 if (!(vma->vm_flags & (VM_HUGETLB|VM_NONLINEAR|VM_PFNMAP|VM_INSERTPAGE))) {
578 if (!vma->anon_vma) 578 if (!vma->anon_vma)
579 return 0; 579 return 0;
580 } 580 }
@@ -1228,6 +1228,7 @@ int vm_insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *
1228 return -EFAULT; 1228 return -EFAULT;
1229 if (!page_count(page)) 1229 if (!page_count(page))
1230 return -EINVAL; 1230 return -EINVAL;
1231 vma->vm_flags |= VM_INSERTPAGE;
1231 return insert_page(vma->vm_mm, addr, page, vma->vm_page_prot); 1232 return insert_page(vma->vm_mm, addr, page, vma->vm_page_prot);
1232} 1233}
1233EXPORT_SYMBOL(vm_insert_page); 1234EXPORT_SYMBOL(vm_insert_page);
diff --git a/mm/mmap.c b/mm/mmap.c
index 11ca5927d5ff..64ba4dbcb7de 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -611,7 +611,7 @@ again: remove_next = 1 + (end > next->vm_end);
611 * If the vma has a ->close operation then the driver probably needs to release 611 * If the vma has a ->close operation then the driver probably needs to release
612 * per-vma resources, so we don't attempt to merge those. 612 * per-vma resources, so we don't attempt to merge those.
613 */ 613 */
614#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED) 614#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED | VM_PFNMAP)
615 615
616static inline int is_mergeable_vma(struct vm_area_struct *vma, 616static inline int is_mergeable_vma(struct vm_area_struct *vma,
617 struct file *file, unsigned long vm_flags) 617 struct file *file, unsigned long vm_flags)
diff --git a/mm/mremap.c b/mm/mremap.c
index b535438c363c..ddaeee9a0b69 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -323,7 +323,7 @@ unsigned long do_mremap(unsigned long addr,
323 /* We can't remap across vm area boundaries */ 323 /* We can't remap across vm area boundaries */
324 if (old_len > vma->vm_end - addr) 324 if (old_len > vma->vm_end - addr)
325 goto out; 325 goto out;
326 if (vma->vm_flags & VM_DONTEXPAND) { 326 if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)) {
327 if (new_len > old_len) 327 if (new_len > old_len)
328 goto out; 328 goto out;
329 } 329 }
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3b21a13d841c..fe14a8c87fc2 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1896,7 +1896,7 @@ static int __devinit pageset_cpuup_callback(struct notifier_block *nfb,
1896static struct notifier_block pageset_notifier = 1896static struct notifier_block pageset_notifier =
1897 { &pageset_cpuup_callback, NULL, 0 }; 1897 { &pageset_cpuup_callback, NULL, 0 };
1898 1898
1899void __init setup_per_cpu_pageset() 1899void __init setup_per_cpu_pageset(void)
1900{ 1900{
1901 int err; 1901 int err;
1902 1902
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index d8e36b775125..43a0b35dfe6f 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -295,7 +295,7 @@ static int check_hbh_len(struct sk_buff *skb)
295 len -= 2; 295 len -= 2;
296 296
297 while (len > 0) { 297 while (len > 0) {
298 int optlen = raw[off+1]+2; 298 int optlen = skb->nh.raw[off+1]+2;
299 299
300 switch (skb->nh.raw[off]) { 300 switch (skb->nh.raw[off]) {
301 case IPV6_TLV_PAD0: 301 case IPV6_TLV_PAD0:
@@ -308,18 +308,15 @@ static int check_hbh_len(struct sk_buff *skb)
308 case IPV6_TLV_JUMBO: 308 case IPV6_TLV_JUMBO:
309 if (skb->nh.raw[off+1] != 4 || (off&3) != 2) 309 if (skb->nh.raw[off+1] != 4 || (off&3) != 2)
310 goto bad; 310 goto bad;
311
312 pkt_len = ntohl(*(u32*)(skb->nh.raw+off+2)); 311 pkt_len = ntohl(*(u32*)(skb->nh.raw+off+2));
313 312 if (pkt_len <= IPV6_MAXPLEN ||
313 skb->nh.ipv6h->payload_len)
314 goto bad;
314 if (pkt_len > skb->len - sizeof(struct ipv6hdr)) 315 if (pkt_len > skb->len - sizeof(struct ipv6hdr))
315 goto bad; 316 goto bad;
316 if (pkt_len + sizeof(struct ipv6hdr) < skb->len) { 317 if (pskb_trim_rcsum(skb,
317 if (__pskb_trim(skb, 318 pkt_len+sizeof(struct ipv6hdr)))
318 pkt_len + sizeof(struct ipv6hdr))) 319 goto bad;
319 goto bad;
320 if (skb->ip_summed == CHECKSUM_HW)
321 skb->ip_summed = CHECKSUM_NONE;
322 }
323 break; 320 break;
324 default: 321 default:
325 if (optlen > len) 322 if (optlen > len)
diff --git a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile
index 058c48e258fc..d0a447e520a2 100644
--- a/net/ipv4/netfilter/Makefile
+++ b/net/ipv4/netfilter/Makefile
@@ -12,6 +12,7 @@ ip_nat_pptp-objs := ip_nat_helper_pptp.o ip_nat_proto_gre.o
12 12
13# connection tracking 13# connection tracking
14obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o 14obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
15obj-$(CONFIG_IP_NF_NAT) += ip_nat.o
15 16
16# conntrack netlink interface 17# conntrack netlink interface
17obj-$(CONFIG_IP_NF_CONNTRACK_NETLINK) += ip_conntrack_netlink.o 18obj-$(CONFIG_IP_NF_CONNTRACK_NETLINK) += ip_conntrack_netlink.o
@@ -41,7 +42,7 @@ obj-$(CONFIG_IP_NF_IPTABLES) += ip_tables.o
41# the three instances of ip_tables 42# the three instances of ip_tables
42obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o 43obj-$(CONFIG_IP_NF_FILTER) += iptable_filter.o
43obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o 44obj-$(CONFIG_IP_NF_MANGLE) += iptable_mangle.o
44obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o ip_nat.o 45obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o
45obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o 46obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o
46 47
47# matches 48# matches
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index b2b60f3e9cdd..42196ba3b0b9 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -182,6 +182,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
182 case IPPROTO_UDP: 182 case IPPROTO_UDP:
183 case IPPROTO_TCP: 183 case IPPROTO_TCP:
184 case IPPROTO_SCTP: 184 case IPPROTO_SCTP:
185 case IPPROTO_DCCP:
185 if (pskb_may_pull(skb, xprth + 4 - skb->data)) { 186 if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
186 u16 *ports = (u16 *)xprth; 187 u16 *ports = (u16 *)xprth;
187 188
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 73a23b4130a5..4ea8cf7c0cc4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1596,9 +1596,17 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
1596 not good. 1596 not good.
1597 */ 1597 */
1598 if (valid_lft >= 0x7FFFFFFF/HZ) 1598 if (valid_lft >= 0x7FFFFFFF/HZ)
1599 rt_expires = 0; 1599 rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ);
1600 else 1600 else
1601 rt_expires = jiffies + valid_lft * HZ; 1601 rt_expires = valid_lft * HZ;
1602
1603 /*
1604 * We convert this (in jiffies) to clock_t later.
1605 * Avoid arithmetic overflow there as well.
1606 * Overflow can happen only if HZ < USER_HZ.
1607 */
1608 if (HZ < USER_HZ && rt_expires > 0x7FFFFFFF / USER_HZ)
1609 rt_expires = 0x7FFFFFFF / USER_HZ;
1602 1610
1603 if (pinfo->onlink) { 1611 if (pinfo->onlink) {
1604 struct rt6_info *rt; 1612 struct rt6_info *rt;
@@ -1610,12 +1618,12 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
1610 ip6_del_rt(rt, NULL, NULL, NULL); 1618 ip6_del_rt(rt, NULL, NULL, NULL);
1611 rt = NULL; 1619 rt = NULL;
1612 } else { 1620 } else {
1613 rt->rt6i_expires = rt_expires; 1621 rt->rt6i_expires = jiffies + rt_expires;
1614 } 1622 }
1615 } 1623 }
1616 } else if (valid_lft) { 1624 } else if (valid_lft) {
1617 addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len, 1625 addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len,
1618 dev, rt_expires, RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT); 1626 dev, jiffies_to_clock_t(rt_expires), RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);
1619 } 1627 }
1620 if (rt) 1628 if (rt)
1621 dst_release(&rt->u.dst); 1629 dst_release(&rt->u.dst);
diff --git a/net/ipv6/netfilter/Kconfig b/net/ipv6/netfilter/Kconfig
index 060d61202412..04912f9b35c3 100644
--- a/net/ipv6/netfilter/Kconfig
+++ b/net/ipv6/netfilter/Kconfig
@@ -211,7 +211,7 @@ config IP6_NF_TARGET_REJECT
211 211
212config IP6_NF_TARGET_NFQUEUE 212config IP6_NF_TARGET_NFQUEUE
213 tristate "NFQUEUE Target Support" 213 tristate "NFQUEUE Target Support"
214 depends on IP_NF_IPTABLES 214 depends on IP6_NF_IPTABLES
215 help 215 help
216 This Target replaced the old obsolete QUEUE target. 216 This Target replaced the old obsolete QUEUE target.
217 217
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index a7a537b50595..7c68bfbee361 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -829,7 +829,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh,
829 } 829 }
830 830
831 rt->u.dst.obsolete = -1; 831 rt->u.dst.obsolete = -1;
832 rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info); 832 rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info);
833 if (nlh && (r = NLMSG_DATA(nlh))) { 833 if (nlh && (r = NLMSG_DATA(nlh))) {
834 rt->rt6i_protocol = r->rtm_protocol; 834 rt->rt6i_protocol = r->rtm_protocol;
835 } else { 835 } else {
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index cf1d91e74c82..69bd957380e7 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -214,6 +214,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
214 case IPPROTO_UDP: 214 case IPPROTO_UDP:
215 case IPPROTO_TCP: 215 case IPPROTO_TCP:
216 case IPPROTO_SCTP: 216 case IPPROTO_SCTP:
217 case IPPROTO_DCCP:
217 if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) { 218 if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) {
218 u16 *ports = (u16 *)exthdr; 219 u16 *ports = (u16 *)exthdr;
219 220
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d890dfa8818f..9df888e932c5 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -156,10 +156,6 @@ static inline void sctp_set_owner_w(struct sctp_chunk *chunk)
156 sizeof(struct sk_buff) + 156 sizeof(struct sk_buff) +
157 sizeof(struct sctp_chunk); 157 sizeof(struct sctp_chunk);
158 158
159 sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk) +
160 sizeof(struct sk_buff) +
161 sizeof(struct sctp_chunk);
162
163 atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 159 atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);
164} 160}
165 161
@@ -3425,7 +3421,7 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add
3425} 3421}
3426 3422
3427static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port, 3423static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port,
3428 void * __user *to, size_t space_left) 3424 void __user **to, size_t space_left)
3429{ 3425{
3430 struct list_head *pos; 3426 struct list_head *pos;
3431 struct sctp_sockaddr_entry *addr; 3427 struct sctp_sockaddr_entry *addr;
@@ -4426,7 +4422,7 @@ cleanup:
4426 * tcp_poll(). Note that, based on these implementations, we don't 4422 * tcp_poll(). Note that, based on these implementations, we don't
4427 * lock the socket in this function, even though it seems that, 4423 * lock the socket in this function, even though it seems that,
4428 * ideally, locking or some other mechanisms can be used to ensure 4424 * ideally, locking or some other mechanisms can be used to ensure
4429 * the integrity of the counters (sndbuf and wmem_queued) used 4425 * the integrity of the counters (sndbuf and wmem_alloc) used
4430 * in this place. We assume that we don't need locks either until proven 4426 * in this place. We assume that we don't need locks either until proven
4431 * otherwise. 4427 * otherwise.
4432 * 4428 *
@@ -4833,10 +4829,6 @@ static void sctp_wfree(struct sk_buff *skb)
4833 sizeof(struct sk_buff) + 4829 sizeof(struct sk_buff) +
4834 sizeof(struct sctp_chunk); 4830 sizeof(struct sctp_chunk);
4835 4831
4836 sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk) +
4837 sizeof(struct sk_buff) +
4838 sizeof(struct sctp_chunk);
4839
4840 atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); 4832 atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc);
4841 4833
4842 sock_wfree(skb); 4834 sock_wfree(skb);
@@ -4920,7 +4912,7 @@ void sctp_write_space(struct sock *sk)
4920 4912
4921/* Is there any sndbuf space available on the socket? 4913/* Is there any sndbuf space available on the socket?
4922 * 4914 *
4923 * Note that wmem_queued is the sum of the send buffers on all of the 4915 * Note that sk_wmem_alloc is the sum of the send buffers on all of the
4924 * associations on the same socket. For a UDP-style socket with 4916 * associations on the same socket. For a UDP-style socket with
4925 * multiple associations, it is possible for it to be "unwriteable" 4917 * multiple associations, it is possible for it to be "unwriteable"
4926 * prematurely. I assume that this is acceptable because 4918 * prematurely. I assume that this is acceptable because
@@ -4933,7 +4925,7 @@ static int sctp_writeable(struct sock *sk)
4933{ 4925{
4934 int amt = 0; 4926 int amt = 0;
4935 4927
4936 amt = sk->sk_sndbuf - sk->sk_wmem_queued; 4928 amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
4937 if (amt < 0) 4929 if (amt < 0)
4938 amt = 0; 4930 amt = 0;
4939 return amt; 4931 return amt;
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index f44f46f1d8e0..8d782282ec19 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -638,7 +638,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
638 gss_msg); 638 gss_msg);
639 atomic_inc(&gss_msg->count); 639 atomic_inc(&gss_msg->count);
640 gss_unhash_msg(gss_msg); 640 gss_unhash_msg(gss_msg);
641 if (msg->errno == -ETIMEDOUT || msg->errno == -EPIPE) { 641 if (msg->errno == -ETIMEDOUT) {
642 unsigned long now = jiffies; 642 unsigned long now = jiffies;
643 if (time_after(now, ratelimit)) { 643 if (time_after(now, ratelimit)) {
644 printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n" 644 printk(KERN_WARNING "RPC: AUTH_GSS upcall timed out.\n"
@@ -786,7 +786,9 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int taskflags)
786 cred->gc_flags = 0; 786 cred->gc_flags = 0;
787 cred->gc_base.cr_ops = &gss_credops; 787 cred->gc_base.cr_ops = &gss_credops;
788 cred->gc_service = gss_auth->service; 788 cred->gc_service = gss_auth->service;
789 err = gss_create_upcall(gss_auth, cred); 789 do {
790 err = gss_create_upcall(gss_auth, cred);
791 } while (err == -EAGAIN);
790 if (err < 0) 792 if (err < 0)
791 goto out_err; 793 goto out_err;
792 794
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index c76ea221798c..16a2458f38f7 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -174,7 +174,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
174 goto out; 174 goto out;
175 msg = (struct rpc_pipe_msg *)filp->private_data; 175 msg = (struct rpc_pipe_msg *)filp->private_data;
176 if (msg != NULL) { 176 if (msg != NULL) {
177 msg->errno = -EPIPE; 177 msg->errno = -EAGAIN;
178 list_del_init(&msg->list); 178 list_del_init(&msg->list);
179 rpci->ops->destroy_msg(msg); 179 rpci->ops->destroy_msg(msg);
180 } 180 }
@@ -183,7 +183,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
183 if (filp->f_mode & FMODE_READ) 183 if (filp->f_mode & FMODE_READ)
184 rpci->nreaders --; 184 rpci->nreaders --;
185 if (!rpci->nreaders) 185 if (!rpci->nreaders)
186 __rpc_purge_upcall(inode, -EPIPE); 186 __rpc_purge_upcall(inode, -EAGAIN);
187 if (rpci->ops->release_pipe) 187 if (rpci->ops->release_pipe)
188 rpci->ops->release_pipe(inode); 188 rpci->ops->release_pipe(inode);
189out: 189out:
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 0a51fd46a848..77e8800d4127 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -990,6 +990,7 @@ static void xs_udp_connect_worker(void *args)
990 sk->sk_data_ready = xs_udp_data_ready; 990 sk->sk_data_ready = xs_udp_data_ready;
991 sk->sk_write_space = xs_udp_write_space; 991 sk->sk_write_space = xs_udp_write_space;
992 sk->sk_no_check = UDP_CSUM_NORCV; 992 sk->sk_no_check = UDP_CSUM_NORCV;
993 sk->sk_allocation = GFP_ATOMIC;
993 994
994 xprt_set_connected(xprt); 995 xprt_set_connected(xprt);
995 996
@@ -1074,6 +1075,7 @@ static void xs_tcp_connect_worker(void *args)
1074 sk->sk_data_ready = xs_tcp_data_ready; 1075 sk->sk_data_ready = xs_tcp_data_ready;
1075 sk->sk_state_change = xs_tcp_state_change; 1076 sk->sk_state_change = xs_tcp_state_change;
1076 sk->sk_write_space = xs_tcp_write_space; 1077 sk->sk_write_space = xs_tcp_write_space;
1078 sk->sk_allocation = GFP_ATOMIC;
1077 1079
1078 /* socket options */ 1080 /* socket options */
1079 sk->sk_userlocks |= SOCK_BINDPORT_LOCK; 1081 sk->sk_userlocks |= SOCK_BINDPORT_LOCK;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 0db9e57013fd..54a4be6a7d26 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1014,13 +1014,12 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
1014} 1014}
1015EXPORT_SYMBOL(__xfrm_route_forward); 1015EXPORT_SYMBOL(__xfrm_route_forward);
1016 1016
1017/* Optimize later using cookies and generation ids. */
1018
1019static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie) 1017static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie)
1020{ 1018{
1021 if (!stale_bundle(dst)) 1019 /* If it is marked obsolete, which is how we even get here,
1022 return dst; 1020 * then we have purged it from the policy bundle list and we
1023 1021 * did that for a good reason.
1022 */
1024 return NULL; 1023 return NULL;
1025} 1024}
1026 1025
@@ -1104,6 +1103,16 @@ int xfrm_flush_bundles(void)
1104 return 0; 1103 return 0;
1105} 1104}
1106 1105
1106static int always_true(struct dst_entry *dst)
1107{
1108 return 1;
1109}
1110
1111void xfrm_flush_all_bundles(void)
1112{
1113 xfrm_prune_bundles(always_true);
1114}
1115
1107void xfrm_init_pmtu(struct dst_entry *dst) 1116void xfrm_init_pmtu(struct dst_entry *dst)
1108{ 1117{
1109 do { 1118 do {
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 7cf48aa6c95b..479effc97666 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -431,6 +431,8 @@ void xfrm_state_insert(struct xfrm_state *x)
431 spin_lock_bh(&xfrm_state_lock); 431 spin_lock_bh(&xfrm_state_lock);
432 __xfrm_state_insert(x); 432 __xfrm_state_insert(x);
433 spin_unlock_bh(&xfrm_state_lock); 433 spin_unlock_bh(&xfrm_state_lock);
434
435 xfrm_flush_all_bundles();
434} 436}
435EXPORT_SYMBOL(xfrm_state_insert); 437EXPORT_SYMBOL(xfrm_state_insert);
436 438
@@ -478,6 +480,9 @@ out:
478 spin_unlock_bh(&xfrm_state_lock); 480 spin_unlock_bh(&xfrm_state_lock);
479 xfrm_state_put_afinfo(afinfo); 481 xfrm_state_put_afinfo(afinfo);
480 482
483 if (!err)
484 xfrm_flush_all_bundles();
485
481 if (x1) { 486 if (x1) {
482 xfrm_state_delete(x1); 487 xfrm_state_delete(x1);
483 xfrm_state_put(x1); 488 xfrm_state_put(x1);
diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c
index 6b46a8a4b1cc..b963c550dae6 100644
--- a/sound/oss/au1550_ac97.c
+++ b/sound/oss/au1550_ac97.c
@@ -578,17 +578,15 @@ set_recv_slots(int num_channels)
578 } while ((stat & PSC_AC97STAT_DR) == 0); 578 } while ((stat & PSC_AC97STAT_DR) == 0);
579} 579}
580 580
581/* Hold spinlock for both start_dac() and start_adc() calls */
581static void 582static void
582start_dac(struct au1550_state *s) 583start_dac(struct au1550_state *s)
583{ 584{
584 struct dmabuf *db = &s->dma_dac; 585 struct dmabuf *db = &s->dma_dac;
585 unsigned long flags;
586 586
587 if (!db->stopped) 587 if (!db->stopped)
588 return; 588 return;
589 589
590 spin_lock_irqsave(&s->lock, flags);
591
592 set_xmit_slots(db->num_channels); 590 set_xmit_slots(db->num_channels);
593 au_writel(PSC_AC97PCR_TC, PSC_AC97PCR); 591 au_writel(PSC_AC97PCR_TC, PSC_AC97PCR);
594 au_sync(); 592 au_sync();
@@ -598,8 +596,6 @@ start_dac(struct au1550_state *s)
598 au1xxx_dbdma_start(db->dmanr); 596 au1xxx_dbdma_start(db->dmanr);
599 597
600 db->stopped = 0; 598 db->stopped = 0;
601
602 spin_unlock_irqrestore(&s->lock, flags);
603} 599}
604 600
605static void 601static void
@@ -718,7 +714,6 @@ prog_dmabuf_dac(struct au1550_state *s)
718} 714}
719 715
720 716
721/* hold spinlock for the following */
722static void 717static void
723dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) 718dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
724{ 719{
@@ -726,6 +721,8 @@ dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
726 struct dmabuf *db = &s->dma_dac; 721 struct dmabuf *db = &s->dma_dac;
727 u32 ac97c_stat; 722 u32 ac97c_stat;
728 723
724 spin_lock(&s->lock);
725
729 ac97c_stat = au_readl(PSC_AC97STAT); 726 ac97c_stat = au_readl(PSC_AC97STAT);
730 if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE)) 727 if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE))
731 pr_debug("AC97C status = 0x%08x\n", ac97c_stat); 728 pr_debug("AC97C status = 0x%08x\n", ac97c_stat);
@@ -747,6 +744,8 @@ dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
747 /* wake up anybody listening */ 744 /* wake up anybody listening */
748 if (waitqueue_active(&db->wait)) 745 if (waitqueue_active(&db->wait))
749 wake_up(&db->wait); 746 wake_up(&db->wait);
747
748 spin_unlock(&s->lock);
750} 749}
751 750
752 751
@@ -758,6 +757,8 @@ adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
758 u32 obytes; 757 u32 obytes;
759 char *obuf; 758 char *obuf;
760 759
760 spin_lock(&s->lock);
761
761 /* Pull the buffer from the dma queue. 762 /* Pull the buffer from the dma queue.
762 */ 763 */
763 au1xxx_dbdma_get_dest(dp->dmanr, (void *)(&obuf), &obytes); 764 au1xxx_dbdma_get_dest(dp->dmanr, (void *)(&obuf), &obytes);
@@ -765,6 +766,7 @@ adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
765 if ((dp->count + obytes) > dp->dmasize) { 766 if ((dp->count + obytes) > dp->dmasize) {
766 /* Overrun. Stop ADC and log the error 767 /* Overrun. Stop ADC and log the error
767 */ 768 */
769 spin_unlock(&s->lock);
768 stop_adc(s); 770 stop_adc(s);
769 dp->error++; 771 dp->error++;
770 err("adc overrun"); 772 err("adc overrun");
@@ -787,6 +789,7 @@ adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
787 if (waitqueue_active(&dp->wait)) 789 if (waitqueue_active(&dp->wait))
788 wake_up(&dp->wait); 790 wake_up(&dp->wait);
789 791
792 spin_unlock(&s->lock);
790} 793}
791 794
792static loff_t 795static loff_t
@@ -1048,9 +1051,9 @@ au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
1048 /* wait for samples in ADC dma buffer 1051 /* wait for samples in ADC dma buffer
1049 */ 1052 */
1050 do { 1053 do {
1054 spin_lock_irqsave(&s->lock, flags);
1051 if (db->stopped) 1055 if (db->stopped)
1052 start_adc(s); 1056 start_adc(s);
1053 spin_lock_irqsave(&s->lock, flags);
1054 avail = db->count; 1057 avail = db->count;
1055 if (avail <= 0) 1058 if (avail <= 0)
1056 __set_current_state(TASK_INTERRUPTIBLE); 1059 __set_current_state(TASK_INTERRUPTIBLE);
@@ -1570,15 +1573,19 @@ au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
1570 if (get_user(val, (int *) arg)) 1573 if (get_user(val, (int *) arg))
1571 return -EFAULT; 1574 return -EFAULT;
1572 if (file->f_mode & FMODE_READ) { 1575 if (file->f_mode & FMODE_READ) {
1573 if (val & PCM_ENABLE_INPUT) 1576 if (val & PCM_ENABLE_INPUT) {
1577 spin_lock_irqsave(&s->lock, flags);
1574 start_adc(s); 1578 start_adc(s);
1575 else 1579 spin_unlock_irqrestore(&s->lock, flags);
1580 } else
1576 stop_adc(s); 1581 stop_adc(s);
1577 } 1582 }
1578 if (file->f_mode & FMODE_WRITE) { 1583 if (file->f_mode & FMODE_WRITE) {
1579 if (val & PCM_ENABLE_OUTPUT) 1584 if (val & PCM_ENABLE_OUTPUT) {
1585 spin_lock_irqsave(&s->lock, flags);
1580 start_dac(s); 1586 start_dac(s);
1581 else 1587 spin_unlock_irqrestore(&s->lock, flags);
1588 } else
1582 stop_dac(s); 1589 stop_dac(s);
1583 } 1590 }
1584 return 0; 1591 return 0;