aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/networking/ax25.txt18
-rw-r--r--Documentation/power/pci.txt17
-rw-r--r--MAINTAINERS9
-rw-r--r--arch/i386/kernel/hpet.c2
-rw-r--r--arch/i386/pci/common.c8
-rw-r--r--arch/s390/kernel/kprobes.c2
-rw-r--r--arch/um/include/sysdep-x86_64/ptrace.h4
-rw-r--r--arch/um/os-Linux/skas/mem.c10
-rw-r--r--arch/um/os-Linux/skas/process.c6
-rw-r--r--arch/um/os-Linux/sys-i386/registers.c5
-rw-r--r--arch/um/os-Linux/sys-x86_64/registers.c4
-rw-r--r--arch/x86_64/kernel/acpi/sleep.c4
-rw-r--r--block/elevator.c7
-rw-r--r--block/ll_rw_blk.c6
-rw-r--r--drivers/char/generic_serial.c7
-rw-r--r--drivers/clocksource/acpi_pm.c2
-rw-r--r--drivers/cpufreq/cpufreq.c4
-rw-r--r--drivers/eisa/pci_eisa.c4
-rw-r--r--drivers/ide/Kconfig6
-rw-r--r--drivers/ide/ide-io.c32
-rw-r--r--drivers/ide/ide-iops.c11
-rw-r--r--drivers/ide/ide.c37
-rw-r--r--drivers/ide/pci/pdc202xx_new.c3
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c6
-rw-r--r--drivers/isdn/hisax/isar.c2
-rw-r--r--drivers/kvm/vmx.c39
-rw-r--r--drivers/md/md.c42
-rw-r--r--drivers/md/raid5.c19
-rw-r--r--drivers/media/common/ir-functions.c6
-rw-r--r--drivers/media/dvb/dvb-core/dmxdev.c12
-rw-r--r--drivers/media/dvb/dvb-core/dvb_demux.c21
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c9
-rw-r--r--drivers/media/dvb/frontends/isl6421.c1
-rw-r--r--drivers/media/radio/Kconfig2
-rw-r--r--drivers/media/video/msp3400-driver.c14
-rw-r--r--drivers/media/video/saa7115.c2
-rw-r--r--drivers/media/video/tuner-core.c10
-rw-r--r--drivers/message/fusion/mptsas.c7
-rw-r--r--drivers/message/i2o/i2o_block.c12
-rw-r--r--drivers/net/atl1/atl1_hw.c1
-rw-r--r--drivers/net/forcedeth.c8
-rw-r--r--drivers/net/mv643xx_eth.c4
-rw-r--r--drivers/net/myri10ge/myri10ge.c7
-rw-r--r--drivers/net/ppp_generic.c3
-rwxr-xr-xdrivers/net/qla3xxx.c110
-rwxr-xr-xdrivers/net/qla3xxx.h3
-rw-r--r--drivers/net/sun3lance.c16
-rw-r--r--drivers/net/sungem.c30
-rw-r--r--drivers/net/tg3.c134
-rw-r--r--drivers/net/tg3.h5
-rw-r--r--drivers/net/wan/lmc/lmc_media.h65
-rw-r--r--drivers/pci/pcie/portdrv_pci.c2
-rw-r--r--drivers/pci/quirks.c18
-rw-r--r--drivers/pcmcia/au1000_generic.c2
-rw-r--r--drivers/s390/block/dasd_diag.c10
-rw-r--r--drivers/s390/cio/device_status.c6
-rw-r--r--drivers/s390/crypto/ap_bus.c30
-rw-r--r--drivers/scsi/gdth.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c5
-rw-r--r--drivers/spi/spi.c10
-rw-r--r--drivers/usb/core/quirks.c3
-rw-r--r--drivers/usb/gadget/omap_udc.c103
-rw-r--r--drivers/usb/host/uhci-debug.c26
-rw-r--r--drivers/usb/host/uhci-hcd.c3
-rw-r--r--drivers/usb/host/uhci-q.c94
-rw-r--r--drivers/usb/serial/airprime.c1
-rw-r--r--drivers/usb/serial/ftdi_sio.c6
-rw-r--r--drivers/usb/serial/generic.c7
-rw-r--r--fs/9p/v9fs_vfs.h1
-rw-r--r--fs/9p/vfs_file.c4
-rw-r--r--fs/aio.c1
-rw-r--r--fs/nfsd/nfs3xdr.c6
-rw-r--r--fs/nfsd/nfs4acl.c2
-rw-r--r--fs/nfsd/nfs4state.c6
-rw-r--r--fs/proc/Makefile3
-rw-r--r--fs/splice.c84
-rw-r--r--include/asm-i386/termbits.h2
-rw-r--r--include/asm-s390/checksum.h59
-rw-r--r--include/asm-um/common.lds.S1
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/linux/eventpoll.h7
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/ipc.h9
-rw-r--r--include/linux/pipe_fs_i.h4
-rw-r--r--include/linux/utsname.h2
-rw-r--r--include/media/saa7146_vv.h3
-rw-r--r--include/net/fib_rules.h1
-rw-r--r--include/net/ip6_fib.h1
-rw-r--r--include/net/neighbour.h2
-rw-r--r--ipc/util.c7
-rw-r--r--kernel/power/disk.c1
-rw-r--r--kernel/power/user.c3
-rw-r--r--kernel/time/clockevents.c69
-rw-r--r--kernel/time/ntp.c30
-rw-r--r--mm/bounce.c2
-rw-r--r--net/atm/clip.c9
-rw-r--r--net/ax25/Kconfig61
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/fib_rules.c30
-rw-r--r--net/core/neighbour.c14
-rw-r--r--net/dccp/dccp.h1
-rw-r--r--net/dccp/timer.c2
-rw-r--r--net/decnet/dn_fib.c5
-rw-r--r--net/decnet/dn_rules.c13
-rw-r--r--net/ipv4/fib_frontend.c5
-rw-r--r--net/ipv4/fib_rules.c14
-rw-r--r--net/ipv4/fib_semantics.c2
-rw-r--r--net/ipv4/fib_trie.c9
-rw-r--r--net/ipv6/fib6_rules.c14
-rw-r--r--net/ipv6/ip6_fib.c8
-rw-r--r--net/ipv6/route.c97
-rw-r--r--net/sched/cls_basic.c16
-rw-r--r--net/socket.c7
113 files changed, 887 insertions, 865 deletions
diff --git a/Documentation/networking/ax25.txt b/Documentation/networking/ax25.txt
index 37c25b0925f0..8257dbf9be57 100644
--- a/Documentation/networking/ax25.txt
+++ b/Documentation/networking/ax25.txt
@@ -1,16 +1,10 @@
1To use the amateur radio protocols within Linux you will need to get a 1To use the amateur radio protocols within Linux you will need to get a
2suitable copy of the AX.25 Utilities. More detailed information about these 2suitable copy of the AX.25 Utilities. More detailed information about
3and associated programs can be found on http://zone.pspt.fi/~jsn/. 3AX.25, NET/ROM and ROSE, associated programs and and utilities can be
4 4found on http://www.linux-ax25.org.
5For more information about the AX.25, NET/ROM and ROSE protocol stacks, see
6the AX25-HOWTO written by Terry Dawson <terry@perf.no.itg.telstra.com.au>
7who is also the AX.25 Utilities maintainer.
8 5
9There is an active mailing list for discussing Linux amateur radio matters 6There is an active mailing list for discussing Linux amateur radio matters
10called linux-hams. To subscribe to it, send a message to 7called linux-hams@vger.kernel.org. To subscribe to it, send a message to
11majordomo@vger.kernel.org with the words "subscribe linux-hams" in the body 8majordomo@vger.kernel.org with the words "subscribe linux-hams" in the body
12of the message, the subject field is ignored. 9of the message, the subject field is ignored. You don't need to be
13 10subscribed to post but of course that means you might miss an answer.
14Jonathan G4KLX
15
16g4klx@g4klx.demon.co.uk
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt
index c750f9f2e76e..b6a3cbf7e846 100644
--- a/Documentation/power/pci.txt
+++ b/Documentation/power/pci.txt
@@ -102,31 +102,28 @@ pci_save_state
102-------------- 102--------------
103 103
104Usage: 104Usage:
105 pci_save_state(dev, buffer); 105 pci_save_state(struct pci_dev *dev);
106 106
107Description: 107Description:
108 Save first 64 bytes of PCI config space. Buffer must be allocated by 108 Save first 64 bytes of PCI config space, along with any additional
109 caller. 109 PCI-Express or PCI-X information.
110 110
111 111
112pci_restore_state 112pci_restore_state
113----------------- 113-----------------
114 114
115Usage: 115Usage:
116 pci_restore_state(dev, buffer); 116 pci_restore_state(struct pci_dev *dev);
117 117
118Description: 118Description:
119 Restore previously saved config space. (First 64 bytes only); 119 Restore previously saved config space.
120
121 If buffer is NULL, then restore what information we know about the
122 device from bootup: BARs and interrupt line.
123 120
124 121
125pci_set_power_state 122pci_set_power_state
126------------------- 123-------------------
127 124
128Usage: 125Usage:
129 pci_set_power_state(dev, state); 126 pci_set_power_state(struct pci_dev *dev, pci_power_t state);
130 127
131Description: 128Description:
132 Transition device to low power state using PCI PM Capabilities 129 Transition device to low power state using PCI PM Capabilities
@@ -142,7 +139,7 @@ pci_enable_wake
142--------------- 139---------------
143 140
144Usage: 141Usage:
145 pci_enable_wake(dev, state, enable); 142 pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);
146 143
147Description: 144Description:
148 Enable device to generate PME# during low power state using PCI PM 145 Enable device to generate PME# during low power state using PCI PM
diff --git a/MAINTAINERS b/MAINTAINERS
index dd6978b1e8fb..8c8090e02d8e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1585,12 +1585,6 @@ L: i2c@lm-sensors.org
1585T: quilt http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/ 1585T: quilt http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/
1586S: Maintained 1586S: Maintained
1587 1587
1588I2O
1589P: Markus Lidel
1590M: markus.lidel@shadowconnect.com
1591W: http://i2o.shadowconnect.com/
1592S: Maintained
1593
1594i386 BOOT CODE 1588i386 BOOT CODE
1595P: Riley H. Williams 1589P: Riley H. Williams
1596M: Riley@Williams.Name 1590M: Riley@Williams.Name
@@ -2928,9 +2922,12 @@ L: linux-scsi@vger.kernel.org
2928S: Maintained 2922S: Maintained
2929 2923
2930SCTP PROTOCOL 2924SCTP PROTOCOL
2925P: Vlad Yasevich
2926M: vladislav.yasevich@hp.com
2931P: Sridhar Samudrala 2927P: Sridhar Samudrala
2932M: sri@us.ibm.com 2928M: sri@us.ibm.com
2933L: lksctp-developers@lists.sourceforge.net 2929L: lksctp-developers@lists.sourceforge.net
2930W: http://lksctp.sourceforge.net
2934S: Supported 2931S: Supported
2935 2932
2936SCx200 CPU SUPPORT 2933SCx200 CPU SUPPORT
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c
index f3ab61ee7498..76afea67f691 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/i386/kernel/hpet.c
@@ -197,7 +197,7 @@ static int hpet_next_event(unsigned long delta,
197 cnt += delta; 197 cnt += delta;
198 hpet_writel(cnt, HPET_T0_CMP); 198 hpet_writel(cnt, HPET_T0_CMP);
199 199
200 return ((long)(hpet_readl(HPET_COUNTER) - cnt ) > 0); 200 return ((long)(hpet_readl(HPET_COUNTER) - cnt ) > 0) ? -ETIME : 0;
201} 201}
202 202
203/* 203/*
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index 1bb069372143..948436665385 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -193,6 +193,14 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
193 }, 193 },
194 { 194 {
195 .callback = set_bf_sort, 195 .callback = set_bf_sort,
196 .ident = "Dell PowerEdge R900",
197 .matches = {
198 DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
199 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R900"),
200 },
201 },
202 {
203 .callback = set_bf_sort,
196 .ident = "HP ProLiant BL20p G3", 204 .ident = "HP ProLiant BL20p G3",
197 .matches = { 205 .matches = {
198 DMI_MATCH(DMI_SYS_VENDOR, "HP"), 206 DMI_MATCH(DMI_SYS_VENDOR, "HP"),
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 8af549e95730..993f35381496 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -167,7 +167,7 @@ static int __kprobes swap_instruction(void *aref)
167 * shall not cross any page boundaries (vmalloc area!) when writing 167 * shall not cross any page boundaries (vmalloc area!) when writing
168 * the new instruction. 168 * the new instruction.
169 */ 169 */
170 addr = (u32 *)ALIGN((unsigned long)args->ptr, 4); 170 addr = (u32 *)((unsigned long)args->ptr & -4UL);
171 if ((unsigned long)args->ptr & 2) 171 if ((unsigned long)args->ptr & 2)
172 instr = ((*addr) & 0xffff0000) | args->new; 172 instr = ((*addr) & 0xffff0000) | args->new;
173 else 173 else
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h
index 66cb400c2c92..62403bd99661 100644
--- a/arch/um/include/sysdep-x86_64/ptrace.h
+++ b/arch/um/include/sysdep-x86_64/ptrace.h
@@ -104,10 +104,6 @@ union uml_pt_regs {
104#endif 104#endif
105#ifdef UML_CONFIG_MODE_SKAS 105#ifdef UML_CONFIG_MODE_SKAS
106 struct skas_regs { 106 struct skas_regs {
107 /* x86_64 ptrace uses sizeof(user_regs_struct) as its register
108 * file size, while i386 uses FRAME_SIZE. Therefore, we need
109 * to use UM_FRAME_SIZE here instead of HOST_FRAME_SIZE.
110 */
111 unsigned long regs[MAX_REG_NR]; 107 unsigned long regs[MAX_REG_NR];
112 unsigned long fp[HOST_FP_SIZE]; 108 unsigned long fp[HOST_FP_SIZE];
113 struct faultinfo faultinfo; 109 struct faultinfo faultinfo;
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
index b3c11cfa995a..9383e8751ae7 100644
--- a/arch/um/os-Linux/skas/mem.c
+++ b/arch/um/os-Linux/skas/mem.c
@@ -48,7 +48,7 @@ int multi_op_count = 0;
48static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) 48static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr)
49{ 49{
50 unsigned long regs[MAX_REG_NR]; 50 unsigned long regs[MAX_REG_NR];
51 int n; 51 int n, i;
52 long ret, offset; 52 long ret, offset;
53 unsigned long * data; 53 unsigned long * data;
54 unsigned long * syscall; 54 unsigned long * syscall;
@@ -66,9 +66,13 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr)
66 (unsigned long) &__syscall_stub_start); 66 (unsigned long) &__syscall_stub_start);
67 67
68 n = ptrace_setregs(pid, regs); 68 n = ptrace_setregs(pid, regs);
69 if(n < 0) 69 if(n < 0){
70 printk("Registers - \n");
71 for(i = 0; i < MAX_REG_NR; i++)
72 printk("\t%d\t0x%lx\n", i, regs[i]);
70 panic("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n", 73 panic("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n",
71 n); 74 -n);
75 }
72 76
73 wait_stub_done(pid, 0, "do_syscall_stub"); 77 wait_stub_done(pid, 0, "do_syscall_stub");
74 78
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index dda06789bcb0..0564422c155f 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -67,7 +67,7 @@ void wait_stub_done(int pid, int sig, char * fname)
67 67
68 if((n < 0) || !WIFSTOPPED(status) || 68 if((n < 0) || !WIFSTOPPED(status) ||
69 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ 69 (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){
70 unsigned long regs[HOST_FRAME_SIZE]; 70 unsigned long regs[MAX_REG_NR];
71 71
72 if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) 72 if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
73 printk("Failed to get registers from stub, " 73 printk("Failed to get registers from stub, "
@@ -76,7 +76,7 @@ void wait_stub_done(int pid, int sig, char * fname)
76 int i; 76 int i;
77 77
78 printk("Stub registers -\n"); 78 printk("Stub registers -\n");
79 for(i = 0; i < HOST_FRAME_SIZE; i++) 79 for(i = 0; i < ARRAY_SIZE(regs); i++)
80 printk("\t%d - %lx\n", i, regs[i]); 80 printk("\t%d - %lx\n", i, regs[i]);
81 } 81 }
82 panic("%s : failed to wait for SIGUSR1/SIGTRAP, " 82 panic("%s : failed to wait for SIGUSR1/SIGTRAP, "
@@ -328,7 +328,7 @@ void userspace(union uml_pt_regs *regs)
328int copy_context_skas0(unsigned long new_stack, int pid) 328int copy_context_skas0(unsigned long new_stack, int pid)
329{ 329{
330 int err; 330 int err;
331 unsigned long regs[HOST_FRAME_SIZE]; 331 unsigned long regs[MAX_REG_NR];
332 unsigned long fp_regs[HOST_FP_SIZE]; 332 unsigned long fp_regs[HOST_FP_SIZE];
333 unsigned long current_stack = current_stub_stack(); 333 unsigned long current_stack = current_stub_stack();
334 struct stub_data *data = (struct stub_data *) current_stack; 334 struct stub_data *data = (struct stub_data *) current_stack;
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c
index 79cd93c8c5ed..84b44f9cd42a 100644
--- a/arch/um/os-Linux/sys-i386/registers.c
+++ b/arch/um/os-Linux/sys-i386/registers.c
@@ -15,7 +15,7 @@
15 15
16/* These are set once at boot time and not changed thereafter */ 16/* These are set once at boot time and not changed thereafter */
17 17
18static unsigned long exec_regs[HOST_FRAME_SIZE]; 18static unsigned long exec_regs[MAX_REG_NR];
19static unsigned long exec_fp_regs[HOST_FP_SIZE]; 19static unsigned long exec_fp_regs[HOST_FP_SIZE];
20static unsigned long exec_fpx_regs[HOST_XFP_SIZE]; 20static unsigned long exec_fpx_regs[HOST_XFP_SIZE];
21static int have_fpx_regs = 1; 21static int have_fpx_regs = 1;
@@ -101,6 +101,7 @@ void init_registers(int pid)
101{ 101{
102 int err; 102 int err;
103 103
104 memset(exec_regs, 0, sizeof(exec_regs));
104 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); 105 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs);
105 if(err) 106 if(err)
106 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", 107 panic("check_ptrace : PTRACE_GETREGS failed, errno = %d",
@@ -124,7 +125,7 @@ void init_registers(int pid)
124 125
125void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) 126void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)
126{ 127{
127 memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); 128 memcpy(regs, exec_regs, sizeof(exec_regs));
128 if(fp_regs != NULL) 129 if(fp_regs != NULL)
129 memcpy(fp_regs, exec_fp_regs, 130 memcpy(fp_regs, exec_fp_regs,
130 HOST_FP_SIZE * sizeof(unsigned long)); 131 HOST_FP_SIZE * sizeof(unsigned long));
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c
index a2d7e0c603f7..e6fc2179d1bc 100644
--- a/arch/um/os-Linux/sys-x86_64/registers.c
+++ b/arch/um/os-Linux/sys-x86_64/registers.c
@@ -14,7 +14,7 @@
14 14
15/* These are set once at boot time and not changed thereafter */ 15/* These are set once at boot time and not changed thereafter */
16 16
17static unsigned long exec_regs[HOST_FRAME_SIZE]; 17static unsigned long exec_regs[MAX_REG_NR];
18static unsigned long exec_fp_regs[HOST_FP_SIZE]; 18static unsigned long exec_fp_regs[HOST_FP_SIZE];
19 19
20void init_thread_registers(union uml_pt_regs *to) 20void init_thread_registers(union uml_pt_regs *to)
@@ -72,7 +72,7 @@ void init_registers(int pid)
72 72
73void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) 73void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)
74{ 74{
75 memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); 75 memcpy(regs, exec_regs, sizeof(exec_regs));
76 if(fp_regs != NULL) 76 if(fp_regs != NULL)
77 memcpy(fp_regs, exec_fp_regs, 77 memcpy(fp_regs, exec_fp_regs,
78 HOST_FP_SIZE * sizeof(unsigned long)); 78 HOST_FP_SIZE * sizeof(unsigned long));
diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c
index 23178ce6c783..e1548fbe95ae 100644
--- a/arch/x86_64/kernel/acpi/sleep.c
+++ b/arch/x86_64/kernel/acpi/sleep.c
@@ -66,8 +66,10 @@ static void init_low_mapping(void)
66{ 66{
67 pgd_t *slot0 = pgd_offset(current->mm, 0UL); 67 pgd_t *slot0 = pgd_offset(current->mm, 0UL);
68 low_ptr = *slot0; 68 low_ptr = *slot0;
69 /* FIXME: We're playing with the current task's page tables here, which
70 * is potentially dangerous on SMP systems.
71 */
69 set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET)); 72 set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET));
70 WARN_ON(num_online_cpus() != 1);
71 local_flush_tlb(); 73 local_flush_tlb();
72} 74}
73 75
diff --git a/block/elevator.c b/block/elevator.c
index 25f6ef28e3bb..96a00c822748 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -964,17 +964,18 @@ void elv_unregister_queue(struct request_queue *q)
964 964
965int elv_register(struct elevator_type *e) 965int elv_register(struct elevator_type *e)
966{ 966{
967 char *def = "";
967 spin_lock_irq(&elv_list_lock); 968 spin_lock_irq(&elv_list_lock);
968 BUG_ON(elevator_find(e->elevator_name)); 969 BUG_ON(elevator_find(e->elevator_name));
969 list_add_tail(&e->list, &elv_list); 970 list_add_tail(&e->list, &elv_list);
970 spin_unlock_irq(&elv_list_lock); 971 spin_unlock_irq(&elv_list_lock);
971 972
972 printk(KERN_INFO "io scheduler %s registered", e->elevator_name);
973 if (!strcmp(e->elevator_name, chosen_elevator) || 973 if (!strcmp(e->elevator_name, chosen_elevator) ||
974 (!*chosen_elevator && 974 (!*chosen_elevator &&
975 !strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED))) 975 !strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED)))
976 printk(" (default)"); 976 def = " (default)";
977 printk("\n"); 977
978 printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
978 return 0; 979 return 0;
979} 980}
980EXPORT_SYMBOL_GPL(elv_register); 981EXPORT_SYMBOL_GPL(elv_register);
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 38c293b987b7..3de06953ac33 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1221,7 +1221,7 @@ void blk_recount_segments(request_queue_t *q, struct bio *bio)
1221 * considered part of another segment, since that might 1221 * considered part of another segment, since that might
1222 * change with the bounce page. 1222 * change with the bounce page.
1223 */ 1223 */
1224 high = page_to_pfn(bv->bv_page) >= q->bounce_pfn; 1224 high = page_to_pfn(bv->bv_page) > q->bounce_pfn;
1225 if (high || highprv) 1225 if (high || highprv)
1226 goto new_hw_segment; 1226 goto new_hw_segment;
1227 if (cluster) { 1227 if (cluster) {
@@ -3658,8 +3658,8 @@ int __init blk_dev_init(void)
3658 open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL); 3658 open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL);
3659 register_hotcpu_notifier(&blk_cpu_notifier); 3659 register_hotcpu_notifier(&blk_cpu_notifier);
3660 3660
3661 blk_max_low_pfn = max_low_pfn; 3661 blk_max_low_pfn = max_low_pfn - 1;
3662 blk_max_pfn = max_pfn; 3662 blk_max_pfn = max_pfn - 1;
3663 3663
3664 return 0; 3664 return 0;
3665} 3665}
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
index 337bbcdcf13d..8ea02755b1c9 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/char/generic_serial.c
@@ -710,12 +710,6 @@ void gs_close(struct tty_struct * tty, struct file * filp)
710} 710}
711 711
712 712
713static unsigned int gs_baudrates[] = {
714 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
715 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600
716};
717
718
719void gs_set_termios (struct tty_struct * tty, 713void gs_set_termios (struct tty_struct * tty,
720 struct ktermios * old_termios) 714 struct ktermios * old_termios)
721{ 715{
@@ -771,7 +765,6 @@ void gs_set_termios (struct tty_struct * tty,
771 765
772 baudrate = tty_get_baud_rate(tty); 766 baudrate = tty_get_baud_rate(tty);
773 767
774 baudrate = gs_baudrates[baudrate];
775 if ((tiosp->c_cflag & CBAUD) == B38400) { 768 if ((tiosp->c_cflag & CBAUD) == B38400) {
776 if ( (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 769 if ( (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
777 baudrate = 57600; 770 baudrate = 57600;
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index d42060ede930..5ac309ee7f05 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -90,7 +90,7 @@ __setup("acpi_pm_good", acpi_pm_good_setup);
90static inline void acpi_pm_need_workaround(void) 90static inline void acpi_pm_need_workaround(void)
91{ 91{
92 clocksource_acpi_pm.read = acpi_pm_read_slow; 92 clocksource_acpi_pm.read = acpi_pm_read_slow;
93 clocksource_acpi_pm.rating = 110; 93 clocksource_acpi_pm.rating = 120;
94} 94}
95 95
96/* 96/*
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index f52facc570f5..3162010900c9 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1015,6 +1015,10 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
1015{ 1015{
1016 unsigned int cpu = sys_dev->id; 1016 unsigned int cpu = sys_dev->id;
1017 int retval; 1017 int retval;
1018
1019 if (cpu_is_offline(cpu))
1020 return 0;
1021
1018 if (unlikely(lock_policy_rwsem_write(cpu))) 1022 if (unlikely(lock_policy_rwsem_write(cpu)))
1019 BUG(); 1023 BUG();
1020 1024
diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c
index 9e913629ef39..74edb1d0110f 100644
--- a/drivers/eisa/pci_eisa.c
+++ b/drivers/eisa/pci_eisa.c
@@ -19,8 +19,8 @@
19/* There is only *one* pci_eisa device per machine, right ? */ 19/* There is only *one* pci_eisa device per machine, right ? */
20static struct eisa_root_device pci_eisa_root; 20static struct eisa_root_device pci_eisa_root;
21 21
22static int __devinit pci_eisa_init (struct pci_dev *pdev, 22static int __init pci_eisa_init(struct pci_dev *pdev,
23 const struct pci_device_id *ent) 23 const struct pci_device_id *ent)
24{ 24{
25 int rc; 25 int rc;
26 26
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 8f1fd017679b..ca2e4f830c39 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -103,8 +103,10 @@ config BLK_DEV_IDE_SATA
103 ---help--- 103 ---help---
104 There are two drivers for Serial ATA controllers. 104 There are two drivers for Serial ATA controllers.
105 105
106 The main driver, "libata", exists inside the SCSI subsystem 106 The main driver, "libata", uses the SCSI subsystem
107 and supports most modern SATA controllers. 107 and supports most modern SATA controllers. In order to use it
108 you may take a look at "Serial ATA (prod) and Parallel ATA
109 (experimental) drivers".
108 110
109 The IDE driver (which you are currently configuring) supports 111 The IDE driver (which you are currently configuring) supports
110 a few first-generation SATA controllers. 112 a few first-generation SATA controllers.
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c193553f6fe7..0e0280076fcd 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -519,21 +519,24 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
519 if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0) 519 if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0)
520 try_to_flush_leftover_data(drive); 520 try_to_flush_leftover_data(drive);
521 521
522 if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) {
523 ide_kill_rq(drive, rq);
524 return ide_stopped;
525 }
526
522 if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) 527 if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
523 /* force an abort */ 528 rq->errors |= ERROR_RESET;
524 hwif->OUTB(WIN_IDLEIMMEDIATE, IDE_COMMAND_REG);
525 529
526 if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) 530 if ((rq->errors & ERROR_RESET) == ERROR_RESET) {
527 ide_kill_rq(drive, rq);
528 else {
529 if ((rq->errors & ERROR_RESET) == ERROR_RESET) {
530 ++rq->errors;
531 return ide_do_reset(drive);
532 }
533 if ((rq->errors & ERROR_RECAL) == ERROR_RECAL)
534 drive->special.b.recalibrate = 1;
535 ++rq->errors; 531 ++rq->errors;
532 return ide_do_reset(drive);
536 } 533 }
534
535 if ((rq->errors & ERROR_RECAL) == ERROR_RECAL)
536 drive->special.b.recalibrate = 1;
537
538 ++rq->errors;
539
537 return ide_stopped; 540 return ide_stopped;
538} 541}
539 542
@@ -1025,6 +1028,13 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
1025 if (!drive->special.all) { 1028 if (!drive->special.all) {
1026 ide_driver_t *drv; 1029 ide_driver_t *drv;
1027 1030
1031 /*
1032 * We reset the drive so we need to issue a SETFEATURES.
1033 * Do it _after_ do_special() restored device parameters.
1034 */
1035 if (drive->current_speed == 0xff)
1036 ide_config_drive_speed(drive, drive->desired_speed);
1037
1028 if (rq->cmd_type == REQ_TYPE_ATA_CMD || 1038 if (rq->cmd_type == REQ_TYPE_ATA_CMD ||
1029 rq->cmd_type == REQ_TYPE_ATA_TASK || 1039 rq->cmd_type == REQ_TYPE_ATA_TASK ||
1030 rq->cmd_type == REQ_TYPE_ATA_TASKFILE) 1040 rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index bd513f5a2323..1ee53a551c3a 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -583,8 +583,12 @@ u8 eighty_ninty_three (ide_drive_t *drive)
583 if(!(drive->id->hw_config & 0x4000)) 583 if(!(drive->id->hw_config & 0x4000))
584 return 0; 584 return 0;
585#endif /* CONFIG_IDEDMA_IVB */ 585#endif /* CONFIG_IDEDMA_IVB */
586 if (!(drive->id->hw_config & 0x2000)) 586 /*
587 return 0; 587 * FIXME:
588 * - change master/slave IDENTIFY order
589 * - force bit13 (80c cable present) check
590 * (unless the slave device is pre-ATA3)
591 */
588 return 1; 592 return 1;
589} 593}
590 594
@@ -1090,6 +1094,9 @@ static void pre_reset(ide_drive_t *drive)
1090 if (HWIF(drive)->pre_reset != NULL) 1094 if (HWIF(drive)->pre_reset != NULL)
1091 HWIF(drive)->pre_reset(drive); 1095 HWIF(drive)->pre_reset(drive);
1092 1096
1097 if (drive->current_speed != 0xff)
1098 drive->desired_speed = drive->current_speed;
1099 drive->current_speed = 0xff;
1093} 1100}
1094 1101
1095/* 1102/*
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 695610f0e3e4..a6f098fda884 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1124,17 +1124,40 @@ static int set_io_32bit(ide_drive_t *drive, int arg)
1124static int set_using_dma (ide_drive_t *drive, int arg) 1124static int set_using_dma (ide_drive_t *drive, int arg)
1125{ 1125{
1126#ifdef CONFIG_BLK_DEV_IDEDMA 1126#ifdef CONFIG_BLK_DEV_IDEDMA
1127 ide_hwif_t *hwif = drive->hwif;
1128 int err = -EPERM;
1129
1127 if (!drive->id || !(drive->id->capability & 1)) 1130 if (!drive->id || !(drive->id->capability & 1))
1128 return -EPERM; 1131 goto out;
1129 if (HWIF(drive)->ide_dma_check == NULL) 1132
1130 return -EPERM; 1133 if (hwif->ide_dma_check == NULL)
1134 goto out;
1135
1136 err = -EBUSY;
1137 if (ide_spin_wait_hwgroup(drive))
1138 goto out;
1139 /*
1140 * set ->busy flag, unlock and let it ride
1141 */
1142 hwif->hwgroup->busy = 1;
1143 spin_unlock_irq(&ide_lock);
1144
1145 err = 0;
1146
1131 if (arg) { 1147 if (arg) {
1132 if (ide_set_dma(drive)) 1148 if (ide_set_dma(drive) || hwif->ide_dma_on(drive))
1133 return -EIO; 1149 err = -EIO;
1134 if (HWIF(drive)->ide_dma_on(drive)) return -EIO;
1135 } else 1150 } else
1136 ide_dma_off(drive); 1151 ide_dma_off(drive);
1137 return 0; 1152
1153 /*
1154 * lock, clear ->busy flag and unlock before leaving
1155 */
1156 spin_lock_irq(&ide_lock);
1157 hwif->hwgroup->busy = 0;
1158 spin_unlock_irq(&ide_lock);
1159out:
1160 return err;
1138#else 1161#else
1139 return -EPERM; 1162 return -EPERM;
1140#endif 1163#endif
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 6ceb25bc5a7b..ace98929cc3d 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -255,7 +255,7 @@ static int config_chipset_for_dma(ide_drive_t *drive)
255 printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name); 255 printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name);
256 } 256 }
257 257
258 if (drive->media != ide_disk) 258 if (drive->media != ide_disk && drive->media != ide_cdrom)
259 return 0; 259 return 0;
260 260
261 if (id->capability & 4) { 261 if (id->capability & 4) {
@@ -545,6 +545,7 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
545 545
546 hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 546 hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
547 547
548 hwif->atapi_dma = 1;
548 hwif->ultra_mask = 0x7f; 549 hwif->ultra_mask = 0x7f;
549 hwif->mwdma_mask = 0x07; 550 hwif->mwdma_mask = 0x07;
550 551
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 0741c6d1337c..f2a40ae8e7d0 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -814,7 +814,7 @@ static void ipoib_set_mcast_list(struct net_device *dev)
814 queue_work(ipoib_workqueue, &priv->restart_task); 814 queue_work(ipoib_workqueue, &priv->restart_task);
815} 815}
816 816
817static void ipoib_neigh_destructor(struct neighbour *n) 817static void ipoib_neigh_cleanup(struct neighbour *n)
818{ 818{
819 struct ipoib_neigh *neigh; 819 struct ipoib_neigh *neigh;
820 struct ipoib_dev_priv *priv = netdev_priv(n->dev); 820 struct ipoib_dev_priv *priv = netdev_priv(n->dev);
@@ -822,7 +822,7 @@ static void ipoib_neigh_destructor(struct neighbour *n)
822 struct ipoib_ah *ah = NULL; 822 struct ipoib_ah *ah = NULL;
823 823
824 ipoib_dbg(priv, 824 ipoib_dbg(priv,
825 "neigh_destructor for %06x " IPOIB_GID_FMT "\n", 825 "neigh_cleanup for %06x " IPOIB_GID_FMT "\n",
826 IPOIB_QPN(n->ha), 826 IPOIB_QPN(n->ha),
827 IPOIB_GID_RAW_ARG(n->ha + 4)); 827 IPOIB_GID_RAW_ARG(n->ha + 4));
828 828
@@ -874,7 +874,7 @@ void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh)
874 874
875static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms) 875static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms)
876{ 876{
877 parms->neigh_destructor = ipoib_neigh_destructor; 877 parms->neigh_cleanup = ipoib_neigh_cleanup;
878 878
879 return 0; 879 return 0;
880} 880}
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c
index 9df9e3548cf1..c547a6665052 100644
--- a/drivers/isdn/hisax/isar.c
+++ b/drivers/isdn/hisax/isar.c
@@ -440,7 +440,7 @@ isar_bh(struct work_struct *work)
440{ 440{
441 struct BCState *bcs = container_of(work, struct BCState, tqueue); 441 struct BCState *bcs = container_of(work, struct BCState, tqueue);
442 442
443 BChannel_bh(bcs); 443 BChannel_bh(work);
444 if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event)) 444 if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event))
445 ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR); 445 ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR);
446 if (test_and_clear_bit(B_LL_CONNECT, &bcs->event)) 446 if (test_and_clear_bit(B_LL_CONNECT, &bcs->event))
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index bfa0ce42ea92..fbbf9d6b299f 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -618,7 +618,7 @@ static void fix_pmode_dataseg(int seg, struct kvm_save_segment *save)
618{ 618{
619 struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; 619 struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg];
620 620
621 if (vmcs_readl(sf->base) == save->base) { 621 if (vmcs_readl(sf->base) == save->base && (save->base & AR_S_MASK)) {
622 vmcs_write16(sf->selector, save->selector); 622 vmcs_write16(sf->selector, save->selector);
623 vmcs_writel(sf->base, save->base); 623 vmcs_writel(sf->base, save->base);
624 vmcs_write32(sf->limit, save->limit); 624 vmcs_write32(sf->limit, save->limit);
@@ -1888,6 +1888,27 @@ again:
1888 [cr2]"i"(offsetof(struct kvm_vcpu, cr2)) 1888 [cr2]"i"(offsetof(struct kvm_vcpu, cr2))
1889 : "cc", "memory" ); 1889 : "cc", "memory" );
1890 1890
1891 /*
1892 * Reload segment selectors ASAP. (it's needed for a functional
1893 * kernel: x86 relies on having __KERNEL_PDA in %fs and x86_64
1894 * relies on having 0 in %gs for the CPU PDA to work.)
1895 */
1896 if (fs_gs_ldt_reload_needed) {
1897 load_ldt(ldt_sel);
1898 load_fs(fs_sel);
1899 /*
1900 * If we have to reload gs, we must take care to
1901 * preserve our gs base.
1902 */
1903 local_irq_disable();
1904 load_gs(gs_sel);
1905#ifdef CONFIG_X86_64
1906 wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE));
1907#endif
1908 local_irq_enable();
1909
1910 reload_tss();
1911 }
1891 ++kvm_stat.exits; 1912 ++kvm_stat.exits;
1892 1913
1893 save_msrs(vcpu->guest_msrs, NR_BAD_MSRS); 1914 save_msrs(vcpu->guest_msrs, NR_BAD_MSRS);
@@ -1905,22 +1926,6 @@ again:
1905 kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR); 1926 kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR);
1906 r = 0; 1927 r = 0;
1907 } else { 1928 } else {
1908 if (fs_gs_ldt_reload_needed) {
1909 load_ldt(ldt_sel);
1910 load_fs(fs_sel);
1911 /*
1912 * If we have to reload gs, we must take care to
1913 * preserve our gs base.
1914 */
1915 local_irq_disable();
1916 load_gs(gs_sel);
1917#ifdef CONFIG_X86_64
1918 wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE));
1919#endif
1920 local_irq_enable();
1921
1922 reload_tss();
1923 }
1924 /* 1929 /*
1925 * Profile KVM exit RIPs: 1930 * Profile KVM exit RIPs:
1926 */ 1931 */
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6c06e825cff5..2a9b6a07e3a2 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1318,6 +1318,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1318 char b[BDEVNAME_SIZE]; 1318 char b[BDEVNAME_SIZE];
1319 struct kobject *ko; 1319 struct kobject *ko;
1320 char *s; 1320 char *s;
1321 int err;
1321 1322
1322 if (rdev->mddev) { 1323 if (rdev->mddev) {
1323 MD_BUG(); 1324 MD_BUG();
@@ -1352,20 +1353,29 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1352 while ( (s=strchr(rdev->kobj.k_name, '/')) != NULL) 1353 while ( (s=strchr(rdev->kobj.k_name, '/')) != NULL)
1353 *s = '!'; 1354 *s = '!';
1354 1355
1355 list_add(&rdev->same_set, &mddev->disks);
1356 rdev->mddev = mddev; 1356 rdev->mddev = mddev;
1357 printk(KERN_INFO "md: bind<%s>\n", b); 1357 printk(KERN_INFO "md: bind<%s>\n", b);
1358 1358
1359 rdev->kobj.parent = &mddev->kobj; 1359 rdev->kobj.parent = &mddev->kobj;
1360 kobject_add(&rdev->kobj); 1360 if ((err = kobject_add(&rdev->kobj)))
1361 goto fail;
1361 1362
1362 if (rdev->bdev->bd_part) 1363 if (rdev->bdev->bd_part)
1363 ko = &rdev->bdev->bd_part->kobj; 1364 ko = &rdev->bdev->bd_part->kobj;
1364 else 1365 else
1365 ko = &rdev->bdev->bd_disk->kobj; 1366 ko = &rdev->bdev->bd_disk->kobj;
1366 sysfs_create_link(&rdev->kobj, ko, "block"); 1367 if ((err = sysfs_create_link(&rdev->kobj, ko, "block"))) {
1368 kobject_del(&rdev->kobj);
1369 goto fail;
1370 }
1371 list_add(&rdev->same_set, &mddev->disks);
1367 bd_claim_by_disk(rdev->bdev, rdev, mddev->gendisk); 1372 bd_claim_by_disk(rdev->bdev, rdev, mddev->gendisk);
1368 return 0; 1373 return 0;
1374
1375 fail:
1376 printk(KERN_WARNING "md: failed to register dev-%s for %s\n",
1377 b, mdname(mddev));
1378 return err;
1369} 1379}
1370 1380
1371static void unbind_rdev_from_array(mdk_rdev_t * rdev) 1381static void unbind_rdev_from_array(mdk_rdev_t * rdev)
@@ -2966,7 +2976,9 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
2966 mddev->kobj.k_name = NULL; 2976 mddev->kobj.k_name = NULL;
2967 snprintf(mddev->kobj.name, KOBJ_NAME_LEN, "%s", "md"); 2977 snprintf(mddev->kobj.name, KOBJ_NAME_LEN, "%s", "md");
2968 mddev->kobj.ktype = &md_ktype; 2978 mddev->kobj.ktype = &md_ktype;
2969 kobject_register(&mddev->kobj); 2979 if (kobject_register(&mddev->kobj))
2980 printk(KERN_WARNING "md: cannot register %s/md - name in use\n",
2981 disk->disk_name);
2970 return NULL; 2982 return NULL;
2971} 2983}
2972 2984
@@ -3144,9 +3156,12 @@ static int do_md_run(mddev_t * mddev)
3144 bitmap_destroy(mddev); 3156 bitmap_destroy(mddev);
3145 return err; 3157 return err;
3146 } 3158 }
3147 if (mddev->pers->sync_request) 3159 if (mddev->pers->sync_request) {
3148 sysfs_create_group(&mddev->kobj, &md_redundancy_group); 3160 if (sysfs_create_group(&mddev->kobj, &md_redundancy_group))
3149 else if (mddev->ro == 2) /* auto-readonly not meaningful */ 3161 printk(KERN_WARNING
3162 "md: cannot register extra attributes for %s\n",
3163 mdname(mddev));
3164 } else if (mddev->ro == 2) /* auto-readonly not meaningful */
3150 mddev->ro = 0; 3165 mddev->ro = 0;
3151 3166
3152 atomic_set(&mddev->writes_pending,0); 3167 atomic_set(&mddev->writes_pending,0);
@@ -3160,7 +3175,9 @@ static int do_md_run(mddev_t * mddev)
3160 if (rdev->raid_disk >= 0) { 3175 if (rdev->raid_disk >= 0) {
3161 char nm[20]; 3176 char nm[20];
3162 sprintf(nm, "rd%d", rdev->raid_disk); 3177 sprintf(nm, "rd%d", rdev->raid_disk);
3163 sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); 3178 if (sysfs_create_link(&mddev->kobj, &rdev->kobj, nm))
3179 printk("md: cannot register %s for %s\n",
3180 nm, mdname(mddev));
3164 } 3181 }
3165 3182
3166 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 3183 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
@@ -3325,6 +3342,7 @@ static int do_md_stop(mddev_t * mddev, int mode)
3325 mddev->queue->merge_bvec_fn = NULL; 3342 mddev->queue->merge_bvec_fn = NULL;
3326 mddev->queue->unplug_fn = NULL; 3343 mddev->queue->unplug_fn = NULL;
3327 mddev->queue->issue_flush_fn = NULL; 3344 mddev->queue->issue_flush_fn = NULL;
3345 mddev->queue->backing_dev_info.congested_fn = NULL;
3328 if (mddev->pers->sync_request) 3346 if (mddev->pers->sync_request)
3329 sysfs_remove_group(&mddev->kobj, &md_redundancy_group); 3347 sysfs_remove_group(&mddev->kobj, &md_redundancy_group);
3330 3348
@@ -5385,8 +5403,12 @@ static int remove_and_add_spares(mddev_t *mddev)
5385 if (mddev->pers->hot_add_disk(mddev,rdev)) { 5403 if (mddev->pers->hot_add_disk(mddev,rdev)) {
5386 char nm[20]; 5404 char nm[20];
5387 sprintf(nm, "rd%d", rdev->raid_disk); 5405 sprintf(nm, "rd%d", rdev->raid_disk);
5388 sysfs_create_link(&mddev->kobj, 5406 if (sysfs_create_link(&mddev->kobj,
5389 &rdev->kobj, nm); 5407 &rdev->kobj, nm))
5408 printk(KERN_WARNING
5409 "md: cannot register "
5410 "%s for %s\n",
5411 nm, mdname(mddev));
5390 spares++; 5412 spares++;
5391 md_new_event(mddev); 5413 md_new_event(mddev);
5392 } else 5414 } else
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 54a1ad5eef42..8d59914f2057 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3642,12 +3642,15 @@ static int run(mddev_t *mddev)
3642 } 3642 }
3643 3643
3644 /* Ok, everything is just fine now */ 3644 /* Ok, everything is just fine now */
3645 sysfs_create_group(&mddev->kobj, &raid5_attrs_group); 3645 if (sysfs_create_group(&mddev->kobj, &raid5_attrs_group))
3646 printk(KERN_WARNING
3647 "raid5: failed to create sysfs attributes for %s\n",
3648 mdname(mddev));
3646 3649
3647 mddev->queue->unplug_fn = raid5_unplug_device; 3650 mddev->queue->unplug_fn = raid5_unplug_device;
3648 mddev->queue->issue_flush_fn = raid5_issue_flush; 3651 mddev->queue->issue_flush_fn = raid5_issue_flush;
3649 mddev->queue->backing_dev_info.congested_fn = raid5_congested;
3650 mddev->queue->backing_dev_info.congested_data = mddev; 3652 mddev->queue->backing_dev_info.congested_data = mddev;
3653 mddev->queue->backing_dev_info.congested_fn = raid5_congested;
3651 3654
3652 mddev->array_size = mddev->size * (conf->previous_raid_disks - 3655 mddev->array_size = mddev->size * (conf->previous_raid_disks -
3653 conf->max_degraded); 3656 conf->max_degraded);
@@ -3678,6 +3681,7 @@ static int stop(mddev_t *mddev)
3678 mddev->thread = NULL; 3681 mddev->thread = NULL;
3679 shrink_stripes(conf); 3682 shrink_stripes(conf);
3680 kfree(conf->stripe_hashtbl); 3683 kfree(conf->stripe_hashtbl);
3684 mddev->queue->backing_dev_info.congested_fn = NULL;
3681 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 3685 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
3682 sysfs_remove_group(&mddev->kobj, &raid5_attrs_group); 3686 sysfs_remove_group(&mddev->kobj, &raid5_attrs_group);
3683 kfree(conf->disks); 3687 kfree(conf->disks);
@@ -3950,7 +3954,12 @@ static int raid5_start_reshape(mddev_t *mddev)
3950 added_devices++; 3954 added_devices++;
3951 rdev->recovery_offset = 0; 3955 rdev->recovery_offset = 0;
3952 sprintf(nm, "rd%d", rdev->raid_disk); 3956 sprintf(nm, "rd%d", rdev->raid_disk);
3953 sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); 3957 if (sysfs_create_link(&mddev->kobj,
3958 &rdev->kobj, nm))
3959 printk(KERN_WARNING
3960 "raid5: failed to create "
3961 " link %s for %s\n",
3962 nm, mdname(mddev));
3954 } else 3963 } else
3955 break; 3964 break;
3956 } 3965 }
@@ -4104,6 +4113,10 @@ static struct mdk_personality raid4_personality =
4104 .spare_active = raid5_spare_active, 4113 .spare_active = raid5_spare_active,
4105 .sync_request = sync_request, 4114 .sync_request = sync_request,
4106 .resize = raid5_resize, 4115 .resize = raid5_resize,
4116#ifdef CONFIG_MD_RAID5_RESHAPE
4117 .check_reshape = raid5_check_reshape,
4118 .start_reshape = raid5_start_reshape,
4119#endif
4107 .quiesce = raid5_quiesce, 4120 .quiesce = raid5_quiesce,
4108}; 4121};
4109 4122
diff --git a/drivers/media/common/ir-functions.c b/drivers/media/common/ir-functions.c
index cbf7c0564889..fcb194135627 100644
--- a/drivers/media/common/ir-functions.c
+++ b/drivers/media/common/ir-functions.c
@@ -310,13 +310,15 @@ void ir_rc5_timer_end(unsigned long data)
310 tv.tv_usec - ir->base_time.tv_usec; 310 tv.tv_usec - ir->base_time.tv_usec;
311 } 311 }
312 312
313 /* Allow some timmer jitter (RC5 is ~24ms anyway so this is ok) */ 313 /* signal we're ready to start a new code */
314 ir->active = 0;
315
316 /* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */
314 if (gap < 28000) { 317 if (gap < 28000) {
315 dprintk(1, "ir-common: spurious timer_end\n"); 318 dprintk(1, "ir-common: spurious timer_end\n");
316 return; 319 return;
317 } 320 }
318 321
319 ir->active = 0;
320 if (ir->last_bit < 20) { 322 if (ir->last_bit < 20) {
321 /* ignore spurious codes (caused by light/other remotes) */ 323 /* ignore spurious codes (caused by light/other remotes) */
322 dprintk(1, "ir-common: short code: %x\n", ir->code); 324 dprintk(1, "ir-common: short code: %x\n", ir->code);
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c
index fc77de45ca4d..a5c0e1a3e6d1 100644
--- a/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/drivers/media/dvb/dvb-core/dmxdev.c
@@ -180,8 +180,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
180 struct dvb_device *dvbdev = file->private_data; 180 struct dvb_device *dvbdev = file->private_data;
181 struct dmxdev *dmxdev = dvbdev->priv; 181 struct dmxdev *dmxdev = dvbdev->priv;
182 182
183 if (mutex_lock_interruptible(&dmxdev->mutex)) 183 mutex_lock(&dmxdev->mutex);
184 return -ERESTARTSYS;
185 184
186 if ((file->f_flags & O_ACCMODE) == O_WRONLY) { 185 if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
187 dmxdev->demux->disconnect_frontend(dmxdev->demux); 186 dmxdev->demux->disconnect_frontend(dmxdev->demux);
@@ -673,13 +672,8 @@ static int dvb_demux_open(struct inode *inode, struct file *file)
673static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev, 672static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev,
674 struct dmxdev_filter *dmxdevfilter) 673 struct dmxdev_filter *dmxdevfilter)
675{ 674{
676 if (mutex_lock_interruptible(&dmxdev->mutex)) 675 mutex_lock(&dmxdev->mutex);
677 return -ERESTARTSYS; 676 mutex_lock(&dmxdevfilter->mutex);
678
679 if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
680 mutex_unlock(&dmxdev->mutex);
681 return -ERESTARTSYS;
682 }
683 677
684 dvb_dmxdev_filter_stop(dmxdevfilter); 678 dvb_dmxdev_filter_stop(dmxdevfilter);
685 dvb_dmxdev_filter_reset(dmxdevfilter); 679 dvb_dmxdev_filter_reset(dmxdevfilter);
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c
index fcff5eab21a3..6d8d1c3df863 100644
--- a/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -673,8 +673,7 @@ static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed *ts_feed)
673 struct dvb_demux *demux = feed->demux; 673 struct dvb_demux *demux = feed->demux;
674 int ret; 674 int ret;
675 675
676 if (mutex_lock_interruptible(&demux->mutex)) 676 mutex_lock(&demux->mutex);
677 return -ERESTARTSYS;
678 677
679 if (feed->state < DMX_STATE_GO) { 678 if (feed->state < DMX_STATE_GO) {
680 mutex_unlock(&demux->mutex); 679 mutex_unlock(&demux->mutex);
@@ -748,8 +747,7 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx,
748 struct dvb_demux *demux = (struct dvb_demux *)dmx; 747 struct dvb_demux *demux = (struct dvb_demux *)dmx;
749 struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; 748 struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed;
750 749
751 if (mutex_lock_interruptible(&demux->mutex)) 750 mutex_lock(&demux->mutex);
752 return -ERESTARTSYS;
753 751
754 if (feed->state == DMX_STATE_FREE) { 752 if (feed->state == DMX_STATE_FREE) {
755 mutex_unlock(&demux->mutex); 753 mutex_unlock(&demux->mutex);
@@ -916,8 +914,7 @@ static int dmx_section_feed_stop_filtering(struct dmx_section_feed *feed)
916 struct dvb_demux *dvbdmx = dvbdmxfeed->demux; 914 struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
917 int ret; 915 int ret;
918 916
919 if (mutex_lock_interruptible(&dvbdmx->mutex)) 917 mutex_lock(&dvbdmx->mutex);
920 return -ERESTARTSYS;
921 918
922 if (!dvbdmx->stop_feed) { 919 if (!dvbdmx->stop_feed) {
923 mutex_unlock(&dvbdmx->mutex); 920 mutex_unlock(&dvbdmx->mutex);
@@ -942,8 +939,7 @@ static int dmx_section_feed_release_filter(struct dmx_section_feed *feed,
942 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; 939 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;
943 struct dvb_demux *dvbdmx = dvbdmxfeed->demux; 940 struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
944 941
945 if (mutex_lock_interruptible(&dvbdmx->mutex)) 942 mutex_lock(&dvbdmx->mutex);
946 return -ERESTARTSYS;
947 943
948 if (dvbdmxfilter->feed != dvbdmxfeed) { 944 if (dvbdmxfilter->feed != dvbdmxfeed) {
949 mutex_unlock(&dvbdmx->mutex); 945 mutex_unlock(&dvbdmx->mutex);
@@ -1016,8 +1012,7 @@ static int dvbdmx_release_section_feed(struct dmx_demux *demux,
1016 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; 1012 struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;
1017 struct dvb_demux *dvbdmx = (struct dvb_demux *)demux; 1013 struct dvb_demux *dvbdmx = (struct dvb_demux *)demux;
1018 1014
1019 if (mutex_lock_interruptible(&dvbdmx->mutex)) 1015 mutex_lock(&dvbdmx->mutex);
1020 return -ERESTARTSYS;
1021 1016
1022 if (dvbdmxfeed->state == DMX_STATE_FREE) { 1017 if (dvbdmxfeed->state == DMX_STATE_FREE) {
1023 mutex_unlock(&dvbdmx->mutex); 1018 mutex_unlock(&dvbdmx->mutex);
@@ -1126,8 +1121,7 @@ static int dvbdmx_connect_frontend(struct dmx_demux *demux,
1126 if (demux->frontend) 1121 if (demux->frontend)
1127 return -EINVAL; 1122 return -EINVAL;
1128 1123
1129 if (mutex_lock_interruptible(&dvbdemux->mutex)) 1124 mutex_lock(&dvbdemux->mutex);
1130 return -ERESTARTSYS;
1131 1125
1132 demux->frontend = frontend; 1126 demux->frontend = frontend;
1133 mutex_unlock(&dvbdemux->mutex); 1127 mutex_unlock(&dvbdemux->mutex);
@@ -1138,8 +1132,7 @@ static int dvbdmx_disconnect_frontend(struct dmx_demux *demux)
1138{ 1132{
1139 struct dvb_demux *dvbdemux = (struct dvb_demux *)demux; 1133 struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
1140 1134
1141 if (mutex_lock_interruptible(&dvbdemux->mutex)) 1135 mutex_lock(&dvbdemux->mutex);
1142 return -ERESTARTSYS;
1143 1136
1144 demux->frontend = NULL; 1137 demux->frontend = NULL;
1145 mutex_unlock(&dvbdemux->mutex); 1138 mutex_unlock(&dvbdemux->mutex);
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 490337b5ee3e..14a372a0fe8b 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -203,8 +203,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
203 203
204 int id; 204 int id;
205 205
206 if (mutex_lock_interruptible(&dvbdev_register_lock)) 206 mutex_lock(&dvbdev_register_lock);
207 return -ERESTARTSYS;
208 207
209 if ((id = dvbdev_get_free_id (adap, type)) < 0){ 208 if ((id = dvbdev_get_free_id (adap, type)) < 0){
210 mutex_unlock(&dvbdev_register_lock); 209 mutex_unlock(&dvbdev_register_lock);
@@ -294,8 +293,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu
294{ 293{
295 int num; 294 int num;
296 295
297 if (mutex_lock_interruptible(&dvbdev_register_lock)) 296 mutex_lock(&dvbdev_register_lock);
298 return -ERESTARTSYS;
299 297
300 if ((num = dvbdev_get_free_adapter_num ()) < 0) { 298 if ((num = dvbdev_get_free_adapter_num ()) < 0) {
301 mutex_unlock(&dvbdev_register_lock); 299 mutex_unlock(&dvbdev_register_lock);
@@ -323,8 +321,7 @@ EXPORT_SYMBOL(dvb_register_adapter);
323 321
324int dvb_unregister_adapter(struct dvb_adapter *adap) 322int dvb_unregister_adapter(struct dvb_adapter *adap)
325{ 323{
326 if (mutex_lock_interruptible(&dvbdev_register_lock)) 324 mutex_lock(&dvbdev_register_lock);
327 return -ERESTARTSYS;
328 list_del (&adap->list_head); 325 list_del (&adap->list_head);
329 mutex_unlock(&dvbdev_register_lock); 326 mutex_unlock(&dvbdev_register_lock);
330 return 0; 327 return 0;
diff --git a/drivers/media/dvb/frontends/isl6421.c b/drivers/media/dvb/frontends/isl6421.c
index ef319369ec26..c967148a5945 100644
--- a/drivers/media/dvb/frontends/isl6421.c
+++ b/drivers/media/dvb/frontends/isl6421.c
@@ -122,6 +122,7 @@ struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter
122 /* detect if it is present or not */ 122 /* detect if it is present or not */
123 if (isl6421_set_voltage(fe, SEC_VOLTAGE_OFF)) { 123 if (isl6421_set_voltage(fe, SEC_VOLTAGE_OFF)) {
124 kfree(isl6421); 124 kfree(isl6421);
125 fe->sec_priv = NULL;
125 return NULL; 126 return NULL;
126 } 127 }
127 128
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index 920b63f8cf05..af66a5d5ecd8 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -3,7 +3,7 @@
3# 3#
4 4
5menu "Radio Adapters" 5menu "Radio Adapters"
6 depends on VIDEO_DEV!=n 6 depends on VIDEO_DEV
7 7
8config RADIO_CADET 8config RADIO_CADET
9 tristate "ADS Cadet AM/FM Tuner" 9 tristate "ADS Cadet AM/FM Tuner"
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 2fb9fe6a1ae7..ba1af3c8525e 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -780,18 +780,16 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
780 return 0; 780 return 0;
781} 781}
782 782
783static int msp_suspend(struct device * dev, pm_message_t state) 783static int msp_suspend(struct i2c_client *client, pm_message_t state)
784{ 784{
785 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
786 785
787 v4l_dbg(1, msp_debug, client, "suspend\n"); 786 v4l_dbg(1, msp_debug, client, "suspend\n");
788 msp_reset(client); 787 msp_reset(client);
789 return 0; 788 return 0;
790} 789}
791 790
792static int msp_resume(struct device * dev) 791static int msp_resume(struct i2c_client *client)
793{ 792{
794 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
795 793
796 v4l_dbg(1, msp_debug, client, "resume\n"); 794 v4l_dbg(1, msp_debug, client, "resume\n");
797 msp_wake_thread(client); 795 msp_wake_thread(client);
@@ -825,7 +823,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
825 if (msp_reset(client) == -1) { 823 if (msp_reset(client) == -1) {
826 v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); 824 v4l_dbg(1, msp_debug, client, "msp3400 not found\n");
827 kfree(client); 825 kfree(client);
828 return -1; 826 return 0;
829 } 827 }
830 828
831 state = kmalloc(sizeof(*state), GFP_KERNEL); 829 state = kmalloc(sizeof(*state), GFP_KERNEL);
@@ -859,7 +857,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
859 v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n"); 857 v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n");
860 kfree(state); 858 kfree(state);
861 kfree(client); 859 kfree(client);
862 return -1; 860 return 0;
863 } 861 }
864 862
865 msp_set_audio(client); 863 msp_set_audio(client);
@@ -996,11 +994,11 @@ static struct i2c_driver i2c_driver = {
996 .id = I2C_DRIVERID_MSP3400, 994 .id = I2C_DRIVERID_MSP3400,
997 .attach_adapter = msp_probe, 995 .attach_adapter = msp_probe,
998 .detach_client = msp_detach, 996 .detach_client = msp_detach,
997 .suspend = msp_suspend,
998 .resume = msp_resume,
999 .command = msp_command, 999 .command = msp_command,
1000 .driver = { 1000 .driver = {
1001 .name = "msp3400", 1001 .name = "msp3400",
1002 .suspend = msp_suspend,
1003 .resume = msp_resume,
1004 }, 1002 },
1005}; 1003};
1006 1004
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 7735b6758921..4d5bbd859de1 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -961,7 +961,7 @@ static void saa711x_set_v4lstd(struct i2c_client *client, v4l2_std_id std)
961 reg |= 0x10; 961 reg |= 0x10;
962 } else if (std == V4L2_STD_NTSC_M_JP) { 962 } else if (std == V4L2_STD_NTSC_M_JP) {
963 reg |= 0x40; 963 reg |= 0x40;
964 } else if (std == V4L2_STD_SECAM) { 964 } else if (std & V4L2_STD_SECAM) {
965 reg |= 0x50; 965 reg |= 0x50;
966 } 966 }
967 saa711x_write(client, R_0E_CHROMA_CNTL_1, reg); 967 saa711x_write(client, R_0E_CHROMA_CNTL_1, reg);
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 7be73e3763de..15dbc6bf42a7 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -804,9 +804,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
804 return 0; 804 return 0;
805} 805}
806 806
807static int tuner_suspend(struct device *dev, pm_message_t state) 807static int tuner_suspend(struct i2c_client *c, pm_message_t state)
808{ 808{
809 struct i2c_client *c = container_of (dev, struct i2c_client, dev);
810 struct tuner *t = i2c_get_clientdata (c); 809 struct tuner *t = i2c_get_clientdata (c);
811 810
812 tuner_dbg ("suspend\n"); 811 tuner_dbg ("suspend\n");
@@ -814,9 +813,8 @@ static int tuner_suspend(struct device *dev, pm_message_t state)
814 return 0; 813 return 0;
815} 814}
816 815
817static int tuner_resume(struct device *dev) 816static int tuner_resume(struct i2c_client *c)
818{ 817{
819 struct i2c_client *c = container_of (dev, struct i2c_client, dev);
820 struct tuner *t = i2c_get_clientdata (c); 818 struct tuner *t = i2c_get_clientdata (c);
821 819
822 tuner_dbg ("resume\n"); 820 tuner_dbg ("resume\n");
@@ -837,10 +835,10 @@ static struct i2c_driver driver = {
837 .attach_adapter = tuner_probe, 835 .attach_adapter = tuner_probe,
838 .detach_client = tuner_detach, 836 .detach_client = tuner_detach,
839 .command = tuner_command, 837 .command = tuner_command,
838 .suspend = tuner_suspend,
839 .resume = tuner_resume,
840 .driver = { 840 .driver = {
841 .name = "tuner", 841 .name = "tuner",
842 .suspend = tuner_suspend,
843 .resume = tuner_resume,
844 }, 842 },
845}; 843};
846static struct i2c_client client_template = { 844static struct i2c_client client_template = {
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 404c014db1bd..1d2d03f77894 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -815,7 +815,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
815static int 815static int
816mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) 816mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
817{ 817{
818 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)ioc->sh->hostdata; 818 MPT_SCSI_HOST *hd;
819 struct mptsas_target_reset_event *target_reset_list, *n; 819 struct mptsas_target_reset_event *target_reset_list, *n;
820 int rc; 820 int rc;
821 821
@@ -827,7 +827,10 @@ mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
827 if (reset_phase != MPT_IOC_POST_RESET) 827 if (reset_phase != MPT_IOC_POST_RESET)
828 goto out; 828 goto out;
829 829
830 if (!hd || !hd->ioc) 830 if (!ioc->sh || !ioc->sh->hostdata)
831 goto out;
832 hd = (MPT_SCSI_HOST *)ioc->sh->hostdata;
833 if (!hd->ioc)
831 goto out; 834 goto out;
832 835
833 if (list_empty(&hd->target_reset_list)) 836 if (list_empty(&hd->target_reset_list))
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index da9859f2caf2..b17c4b2bc9ef 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -390,13 +390,6 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req)
390 return BLKPREP_KILL; 390 return BLKPREP_KILL;
391 } 391 }
392 392
393 /* request is already processed by us, so return */
394 if (blk_special_request(req)) {
395 osm_debug("REQ_SPECIAL already set!\n");
396 req->cmd_flags |= REQ_DONTPREP;
397 return BLKPREP_OK;
398 }
399
400 /* connect the i2o_block_request to the request */ 393 /* connect the i2o_block_request to the request */
401 if (!req->special) { 394 if (!req->special) {
402 ireq = i2o_block_request_alloc(); 395 ireq = i2o_block_request_alloc();
@@ -408,11 +401,8 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req)
408 ireq->i2o_blk_dev = i2o_blk_dev; 401 ireq->i2o_blk_dev = i2o_blk_dev;
409 req->special = ireq; 402 req->special = ireq;
410 ireq->req = req; 403 ireq->req = req;
411 } else 404 }
412 ireq = req->special;
413
414 /* do not come back here */ 405 /* do not come back here */
415 req->cmd_type = REQ_TYPE_SPECIAL;
416 req->cmd_flags |= REQ_DONTPREP; 406 req->cmd_flags |= REQ_DONTPREP;
417 407
418 return BLKPREP_OK; 408 return BLKPREP_OK;
diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c
index 314dbaabb642..69482e0d849b 100644
--- a/drivers/net/atl1/atl1_hw.c
+++ b/drivers/net/atl1/atl1_hw.c
@@ -334,7 +334,6 @@ u32 atl1_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr)
334 int i; 334 int i;
335 335
336 crc32 = ether_crc_le(6, mc_addr); 336 crc32 = ether_crc_le(6, mc_addr);
337 crc32 = ~crc32;
338 for (i = 0; i < 32; i++) 337 for (i = 0; i < 32; i++)
339 value |= (((crc32 >> i) & 1) << (31 - i)); 338 value |= (((crc32 >> i) & 1) << (31 - i));
340 339
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 46e1697d9cfd..d04214e4e581 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -2050,9 +2050,10 @@ static void nv_tx_timeout(struct net_device *dev)
2050 nv_drain_tx(dev); 2050 nv_drain_tx(dev);
2051 nv_init_tx(dev); 2051 nv_init_tx(dev);
2052 setup_hw_rings(dev, NV_SETUP_TX_RING); 2052 setup_hw_rings(dev, NV_SETUP_TX_RING);
2053 netif_wake_queue(dev);
2054 } 2053 }
2055 2054
2055 netif_wake_queue(dev);
2056
2056 /* 4) restart tx engine */ 2057 /* 4) restart tx engine */
2057 nv_start_tx(dev); 2058 nv_start_tx(dev);
2058 spin_unlock_irq(&np->lock); 2059 spin_unlock_irq(&np->lock);
@@ -3536,7 +3537,10 @@ static void nv_do_nic_poll(unsigned long data)
3536 pci_push(base); 3537 pci_push(base);
3537 3538
3538 if (!using_multi_irqs(dev)) { 3539 if (!using_multi_irqs(dev)) {
3539 nv_nic_irq(0, dev); 3540 if (np->desc_ver == DESC_VER_3)
3541 nv_nic_irq_optimized(0, dev);
3542 else
3543 nv_nic_irq(0, dev);
3540 if (np->msi_flags & NV_MSI_X_ENABLED) 3544 if (np->msi_flags & NV_MSI_X_ENABLED)
3541 enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); 3545 enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector);
3542 else 3546 else
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index c9f55bc57edb..8015a7c5b0c9 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1379,7 +1379,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
1379 1379
1380 spin_lock_init(&mp->lock); 1380 spin_lock_init(&mp->lock);
1381 1381
1382 port_num = pd->port_number; 1382 port_num = mp->port_num = pd->port_number;
1383 1383
1384 /* set default config values */ 1384 /* set default config values */
1385 eth_port_uc_addr_get(dev, dev->dev_addr); 1385 eth_port_uc_addr_get(dev, dev->dev_addr);
@@ -1411,8 +1411,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
1411 duplex = pd->duplex; 1411 duplex = pd->duplex;
1412 speed = pd->speed; 1412 speed = pd->speed;
1413 1413
1414 mp->port_num = port_num;
1415
1416 /* Hook up MII support for ethtool */ 1414 /* Hook up MII support for ethtool */
1417 mp->mii.dev = dev; 1415 mp->mii.dev = dev;
1418 mp->mii.mdio_read = mv643xx_mdio_read; 1416 mp->mii.mdio_read = mv643xx_mdio_read;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index b05b20ef8c0a..c216e6a5d235 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -71,7 +71,7 @@
71#include "myri10ge_mcp.h" 71#include "myri10ge_mcp.h"
72#include "myri10ge_mcp_gen_header.h" 72#include "myri10ge_mcp_gen_header.h"
73 73
74#define MYRI10GE_VERSION_STR "1.3.0-1.226" 74#define MYRI10GE_VERSION_STR "1.3.0-1.227"
75 75
76MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 76MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
77MODULE_AUTHOR("Maintainer: help@myri.com"); 77MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -2015,10 +2015,9 @@ again:
2015 mss = 0; 2015 mss = 0;
2016 max_segments = MXGEFW_MAX_SEND_DESC; 2016 max_segments = MXGEFW_MAX_SEND_DESC;
2017 2017
2018 if (skb->len > (dev->mtu + ETH_HLEN)) { 2018 if (skb_is_gso(skb)) {
2019 mss = skb_shinfo(skb)->gso_size; 2019 mss = skb_shinfo(skb)->gso_size;
2020 if (mss != 0) 2020 max_segments = MYRI10GE_MAX_SEND_DESC_TSO;
2021 max_segments = MYRI10GE_MAX_SEND_DESC_TSO;
2022 } 2021 }
2023 2022
2024 if ((unlikely(avail < max_segments))) { 2023 if ((unlikely(avail < max_segments))) {
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 11b575f89856..ef58e4128782 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -2544,6 +2544,9 @@ static void ppp_destroy_interface(struct ppp *ppp)
2544 ppp->active_filter = NULL; 2544 ppp->active_filter = NULL;
2545#endif /* CONFIG_PPP_FILTER */ 2545#endif /* CONFIG_PPP_FILTER */
2546 2546
2547 if (ppp->xmit_pending)
2548 kfree_skb(ppp->xmit_pending);
2549
2547 kfree(ppp); 2550 kfree(ppp);
2548} 2551}
2549 2552
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index d3f65dab306c..a8246eb2f8d9 100755
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -1691,6 +1691,27 @@ static int ql_populate_free_queue(struct ql3_adapter *qdev)
1691/* 1691/*
1692 * Caller holds hw_lock. 1692 * Caller holds hw_lock.
1693 */ 1693 */
1694static void ql_update_small_bufq_prod_index(struct ql3_adapter *qdev)
1695{
1696 struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers;
1697 if (qdev->small_buf_release_cnt >= 16) {
1698 while (qdev->small_buf_release_cnt >= 16) {
1699 qdev->small_buf_q_producer_index++;
1700
1701 if (qdev->small_buf_q_producer_index ==
1702 NUM_SBUFQ_ENTRIES)
1703 qdev->small_buf_q_producer_index = 0;
1704 qdev->small_buf_release_cnt -= 8;
1705 }
1706 wmb();
1707 writel(qdev->small_buf_q_producer_index,
1708 &port_regs->CommonRegs.rxSmallQProducerIndex);
1709 }
1710}
1711
1712/*
1713 * Caller holds hw_lock.
1714 */
1694static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) 1715static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev)
1695{ 1716{
1696 struct bufq_addr_element *lrg_buf_q_ele; 1717 struct bufq_addr_element *lrg_buf_q_ele;
@@ -1732,13 +1753,10 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev)
1732 lrg_buf_q_ele = qdev->lrg_buf_q_virt_addr; 1753 lrg_buf_q_ele = qdev->lrg_buf_q_virt_addr;
1733 } 1754 }
1734 } 1755 }
1735 1756 wmb();
1736 qdev->lrg_buf_next_free = lrg_buf_q_ele; 1757 qdev->lrg_buf_next_free = lrg_buf_q_ele;
1737 1758 writel(qdev->lrg_buf_q_producer_index,
1738 ql_write_common_reg(qdev, 1759 &port_regs->CommonRegs.rxLargeQProducerIndex);
1739 &port_regs->CommonRegs.
1740 rxLargeQProducerIndex,
1741 qdev->lrg_buf_q_producer_index);
1742 } 1760 }
1743} 1761}
1744 1762
@@ -1915,17 +1933,18 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev,
1915 u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); 1933 u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum);
1916 if (checksum & 1934 if (checksum &
1917 (IB_IP_IOCB_RSP_3032_ICE | 1935 (IB_IP_IOCB_RSP_3032_ICE |
1918 IB_IP_IOCB_RSP_3032_CE | 1936 IB_IP_IOCB_RSP_3032_CE)) {
1919 IB_IP_IOCB_RSP_3032_NUC)) {
1920 printk(KERN_ERR 1937 printk(KERN_ERR
1921 "%s: Bad checksum for this %s packet, checksum = %x.\n", 1938 "%s: Bad checksum for this %s packet, checksum = %x.\n",
1922 __func__, 1939 __func__,
1923 ((checksum & 1940 ((checksum &
1924 IB_IP_IOCB_RSP_3032_TCP) ? "TCP" : 1941 IB_IP_IOCB_RSP_3032_TCP) ? "TCP" :
1925 "UDP"),checksum); 1942 "UDP"),checksum);
1926 } else if (checksum & IB_IP_IOCB_RSP_3032_TCP) { 1943 } else if ((checksum & IB_IP_IOCB_RSP_3032_TCP) ||
1944 (checksum & IB_IP_IOCB_RSP_3032_UDP &&
1945 !(checksum & IB_IP_IOCB_RSP_3032_NUC))) {
1927 skb2->ip_summed = CHECKSUM_UNNECESSARY; 1946 skb2->ip_summed = CHECKSUM_UNNECESSARY;
1928 } 1947 }
1929 } 1948 }
1930 skb2->dev = qdev->ndev; 1949 skb2->dev = qdev->ndev;
1931 skb2->protocol = eth_type_trans(skb2, qdev->ndev); 1950 skb2->protocol = eth_type_trans(skb2, qdev->ndev);
@@ -1944,16 +1963,12 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev,
1944static int ql_tx_rx_clean(struct ql3_adapter *qdev, 1963static int ql_tx_rx_clean(struct ql3_adapter *qdev,
1945 int *tx_cleaned, int *rx_cleaned, int work_to_do) 1964 int *tx_cleaned, int *rx_cleaned, int work_to_do)
1946{ 1965{
1947 struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers;
1948 struct net_rsp_iocb *net_rsp; 1966 struct net_rsp_iocb *net_rsp;
1949 struct net_device *ndev = qdev->ndev; 1967 struct net_device *ndev = qdev->ndev;
1950 unsigned long hw_flags;
1951 int work_done = 0; 1968 int work_done = 0;
1952 1969
1953 u32 rsp_producer_index = le32_to_cpu(*(qdev->prsp_producer_index));
1954
1955 /* While there are entries in the completion queue. */ 1970 /* While there are entries in the completion queue. */
1956 while ((rsp_producer_index != 1971 while ((le32_to_cpu(*(qdev->prsp_producer_index)) !=
1957 qdev->rsp_consumer_index) && (work_done < work_to_do)) { 1972 qdev->rsp_consumer_index) && (work_done < work_to_do)) {
1958 1973
1959 net_rsp = qdev->rsp_current; 1974 net_rsp = qdev->rsp_current;
@@ -2009,33 +2024,7 @@ static int ql_tx_rx_clean(struct ql3_adapter *qdev,
2009 work_done = *tx_cleaned + *rx_cleaned; 2024 work_done = *tx_cleaned + *rx_cleaned;
2010 } 2025 }
2011 2026
2012 if(work_done) { 2027 return work_done;
2013 spin_lock_irqsave(&qdev->hw_lock, hw_flags);
2014
2015 ql_update_lrg_bufq_prod_index(qdev);
2016
2017 if (qdev->small_buf_release_cnt >= 16) {
2018 while (qdev->small_buf_release_cnt >= 16) {
2019 qdev->small_buf_q_producer_index++;
2020
2021 if (qdev->small_buf_q_producer_index ==
2022 NUM_SBUFQ_ENTRIES)
2023 qdev->small_buf_q_producer_index = 0;
2024 qdev->small_buf_release_cnt -= 8;
2025 }
2026
2027 wmb();
2028 ql_write_common_reg(qdev,
2029 &port_regs->CommonRegs.
2030 rxSmallQProducerIndex,
2031 qdev->small_buf_q_producer_index);
2032
2033 }
2034
2035 spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
2036 }
2037
2038 return *tx_cleaned + *rx_cleaned;
2039} 2028}
2040 2029
2041static int ql_poll(struct net_device *ndev, int *budget) 2030static int ql_poll(struct net_device *ndev, int *budget)
@@ -2059,9 +2048,10 @@ quit_polling:
2059 netif_rx_complete(ndev); 2048 netif_rx_complete(ndev);
2060 2049
2061 spin_lock_irqsave(&qdev->hw_lock, hw_flags); 2050 spin_lock_irqsave(&qdev->hw_lock, hw_flags);
2062 ql_write_common_reg(qdev, 2051 ql_update_small_bufq_prod_index(qdev);
2063 &port_regs->CommonRegs.rspQConsumerIndex, 2052 ql_update_lrg_bufq_prod_index(qdev);
2064 qdev->rsp_consumer_index); 2053 writel(qdev->rsp_consumer_index,
2054 &port_regs->CommonRegs.rspQConsumerIndex);
2065 spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); 2055 spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);
2066 2056
2067 ql_enable_interrupts(qdev); 2057 ql_enable_interrupts(qdev);
@@ -2217,12 +2207,7 @@ static int ql_send_map(struct ql3_adapter *qdev,
2217 int seg_cnt, seg = 0; 2207 int seg_cnt, seg = 0;
2218 int frag_cnt = (int)skb_shinfo(skb)->nr_frags; 2208 int frag_cnt = (int)skb_shinfo(skb)->nr_frags;
2219 2209
2220 seg_cnt = tx_cb->seg_count = ql_get_seg_count(qdev, 2210 seg_cnt = tx_cb->seg_count;
2221 (skb_shinfo(skb)->nr_frags));
2222 if(seg_cnt == -1) {
2223 printk(KERN_ERR PFX"%s: invalid segment count!\n",__func__);
2224 return NETDEV_TX_BUSY;
2225 }
2226 /* 2211 /*
2227 * Map the skb buffer first. 2212 * Map the skb buffer first.
2228 */ 2213 */
@@ -2278,7 +2263,7 @@ static int ql_send_map(struct ql3_adapter *qdev,
2278 pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, 2263 pci_unmap_addr_set(&tx_cb->map[seg], mapaddr,
2279 map); 2264 map);
2280 pci_unmap_len_set(&tx_cb->map[seg], maplen, 2265 pci_unmap_len_set(&tx_cb->map[seg], maplen,
2281 len); 2266 sizeof(struct oal));
2282 oal_entry = (struct oal_entry *)oal; 2267 oal_entry = (struct oal_entry *)oal;
2283 oal++; 2268 oal++;
2284 seg++; 2269 seg++;
@@ -2380,6 +2365,7 @@ static int ql3xxx_send(struct sk_buff *skb, struct net_device *ndev)
2380 } 2365 }
2381 2366
2382 mac_iocb_ptr = tx_cb->queue_entry; 2367 mac_iocb_ptr = tx_cb->queue_entry;
2368 memset((void *)mac_iocb_ptr, 0, sizeof(struct ob_mac_iocb_req));
2383 mac_iocb_ptr->opcode = qdev->mac_ob_opcode; 2369 mac_iocb_ptr->opcode = qdev->mac_ob_opcode;
2384 mac_iocb_ptr->flags = OB_MAC_IOCB_REQ_X; 2370 mac_iocb_ptr->flags = OB_MAC_IOCB_REQ_X;
2385 mac_iocb_ptr->flags |= qdev->mb_bit_mask; 2371 mac_iocb_ptr->flags |= qdev->mb_bit_mask;
@@ -3054,15 +3040,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
3054 goto out; 3040 goto out;
3055 } 3041 }
3056 3042
3057 if (qdev->mac_index)
3058 ql_write_page0_reg(qdev,
3059 &port_regs->mac1MaxFrameLengthReg,
3060 qdev->max_frame_size);
3061 else
3062 ql_write_page0_reg(qdev,
3063 &port_regs->mac0MaxFrameLengthReg,
3064 qdev->max_frame_size);
3065
3066 value = qdev->nvram_data.tcpMaxWindowSize; 3043 value = qdev->nvram_data.tcpMaxWindowSize;
3067 ql_write_page0_reg(qdev, &port_regs->tcpMaxWindow, value); 3044 ql_write_page0_reg(qdev, &port_regs->tcpMaxWindow, value);
3068 3045
@@ -3082,6 +3059,14 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
3082 ql_sem_unlock(qdev, QL_FLASH_SEM_MASK); 3059 ql_sem_unlock(qdev, QL_FLASH_SEM_MASK);
3083 } 3060 }
3084 3061
3062 if (qdev->mac_index)
3063 ql_write_page0_reg(qdev,
3064 &port_regs->mac1MaxFrameLengthReg,
3065 qdev->max_frame_size);
3066 else
3067 ql_write_page0_reg(qdev,
3068 &port_regs->mac0MaxFrameLengthReg,
3069 qdev->max_frame_size);
3085 3070
3086 if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK, 3071 if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK,
3087 (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) * 3072 (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) *
@@ -3152,7 +3137,8 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev)
3152 if (qdev->device_id == QL3032_DEVICE_ID) { 3137 if (qdev->device_id == QL3032_DEVICE_ID) {
3153 value = 3138 value =
3154 (QL3032_PORT_CONTROL_EF | QL3032_PORT_CONTROL_KIE | 3139 (QL3032_PORT_CONTROL_EF | QL3032_PORT_CONTROL_KIE |
3155 QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4); 3140 QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4 |
3141 QL3032_PORT_CONTROL_ET);
3156 ql_write_page0_reg(qdev, &port_regs->functionControl, 3142 ql_write_page0_reg(qdev, &port_regs->functionControl,
3157 ((value << 16) | value)); 3143 ((value << 16) | value));
3158 } else { 3144 } else {
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h
index 34cd6580fd07..0203f88f0544 100755
--- a/drivers/net/qla3xxx.h
+++ b/drivers/net/qla3xxx.h
@@ -1014,8 +1014,7 @@ struct eeprom_data {
1014 1014
1015/* Transmit and Receive Buffers */ 1015/* Transmit and Receive Buffers */
1016#define NUM_LBUFQ_ENTRIES 128 1016#define NUM_LBUFQ_ENTRIES 128
1017#define JUMBO_NUM_LBUFQ_ENTRIES \ 1017#define JUMBO_NUM_LBUFQ_ENTRIES 32
1018(NUM_LBUFQ_ENTRIES/(JUMBO_MTU_SIZE/NORMAL_MTU_SIZE))
1019#define NUM_SBUFQ_ENTRIES 64 1018#define NUM_SBUFQ_ENTRIES 64
1020#define QL_SMALL_BUFFER_SIZE 32 1019#define QL_SMALL_BUFFER_SIZE 32
1021#define QL_ADDR_ELE_PER_BUFQ_ENTRY \ 1020#define QL_ADDR_ELE_PER_BUFQ_ENTRY \
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
index c62e85d89f41..7bee45b42a2c 100644
--- a/drivers/net/sun3lance.c
+++ b/drivers/net/sun3lance.c
@@ -336,13 +336,27 @@ static int __init lance_probe( struct net_device *dev)
336 336
337 /* XXX - leak? */ 337 /* XXX - leak? */
338 MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000); 338 MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000);
339 if (MEM == NULL) {
340#ifdef CONFIG_SUN3
341 iounmap((void __iomem *)ioaddr);
342#endif
343 printk(KERN_WARNING "SUN3 Lance couldn't allocate DVMA memory\n");
344 return 0;
345 }
339 346
340 lp->iobase = (volatile unsigned short *)ioaddr; 347 lp->iobase = (volatile unsigned short *)ioaddr;
341 dev->base_addr = (unsigned long)ioaddr; /* informational only */ 348 dev->base_addr = (unsigned long)ioaddr; /* informational only */
342 349
343 REGA(CSR0) = CSR0_STOP; 350 REGA(CSR0) = CSR0_STOP;
344 351
345 request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev); 352 if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) {
353#ifdef CONFIG_SUN3
354 iounmap((void __iomem *)ioaddr);
355#endif
356 dvma_free((void *)MEM);
357 printk(KERN_WARNING "SUN3 Lance unable to allocate IRQ\n");
358 return 0;
359 }
346 dev->irq = (unsigned short)LANCE_IRQ; 360 dev->irq = (unsigned short)LANCE_IRQ;
347 361
348 362
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 616be8d0fa85..08ea61db46fe 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2530,6 +2530,35 @@ static struct net_device_stats *gem_get_stats(struct net_device *dev)
2530 return &gp->net_stats; 2530 return &gp->net_stats;
2531} 2531}
2532 2532
2533static int gem_set_mac_address(struct net_device *dev, void *addr)
2534{
2535 struct sockaddr *macaddr = (struct sockaddr *) addr;
2536 struct gem *gp = dev->priv;
2537 unsigned char *e = &dev->dev_addr[0];
2538
2539 if (!is_valid_ether_addr(macaddr->sa_data))
2540 return -EADDRNOTAVAIL;
2541
2542 if (!netif_running(dev) || !netif_device_present(dev)) {
2543 /* We'll just catch it later when the
2544 * device is up'd or resumed.
2545 */
2546 memcpy(dev->dev_addr, macaddr->sa_data, dev->addr_len);
2547 return 0;
2548 }
2549
2550 mutex_lock(&gp->pm_mutex);
2551 memcpy(dev->dev_addr, macaddr->sa_data, dev->addr_len);
2552 if (gp->running) {
2553 writel((e[4] << 8) | e[5], gp->regs + MAC_ADDR0);
2554 writel((e[2] << 8) | e[3], gp->regs + MAC_ADDR1);
2555 writel((e[0] << 8) | e[1], gp->regs + MAC_ADDR2);
2556 }
2557 mutex_unlock(&gp->pm_mutex);
2558
2559 return 0;
2560}
2561
2533static void gem_set_multicast(struct net_device *dev) 2562static void gem_set_multicast(struct net_device *dev)
2534{ 2563{
2535 struct gem *gp = dev->priv; 2564 struct gem *gp = dev->priv;
@@ -3122,6 +3151,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
3122 dev->change_mtu = gem_change_mtu; 3151 dev->change_mtu = gem_change_mtu;
3123 dev->irq = pdev->irq; 3152 dev->irq = pdev->irq;
3124 dev->dma = 0; 3153 dev->dma = 0;
3154 dev->set_mac_address = gem_set_mac_address;
3125#ifdef CONFIG_NET_POLL_CONTROLLER 3155#ifdef CONFIG_NET_POLL_CONTROLLER
3126 dev->poll_controller = gem_poll_controller; 3156 dev->poll_controller = gem_poll_controller;
3127#endif 3157#endif
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 8c8f9f4d47a5..0acee9f324e9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.74" 67#define DRV_MODULE_VERSION "3.75"
68#define DRV_MODULE_RELDATE "February 20, 2007" 68#define DRV_MODULE_RELDATE "March 23, 2007"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -3568,32 +3568,34 @@ static irqreturn_t tg3_interrupt(int irq, void *dev_id)
3568 * Reading the PCI State register will confirm whether the 3568 * Reading the PCI State register will confirm whether the
3569 * interrupt is ours and will flush the status block. 3569 * interrupt is ours and will flush the status block.
3570 */ 3570 */
3571 if ((sblk->status & SD_STATUS_UPDATED) || 3571 if (unlikely(!(sblk->status & SD_STATUS_UPDATED))) {
3572 !(tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) { 3572 if ((tp->tg3_flags & TG3_FLAG_CHIP_RESETTING) ||
3573 /* 3573 (tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) {
3574 * Writing any value to intr-mbox-0 clears PCI INTA# and 3574 handled = 0;
3575 * chip-internal interrupt pending events.
3576 * Writing non-zero to intr-mbox-0 additional tells the
3577 * NIC to stop sending us irqs, engaging "in-intr-handler"
3578 * event coalescing.
3579 */
3580 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3581 0x00000001);
3582 if (tg3_irq_sync(tp))
3583 goto out; 3575 goto out;
3584 sblk->status &= ~SD_STATUS_UPDATED;
3585 if (likely(tg3_has_work(tp))) {
3586 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3587 netif_rx_schedule(dev); /* schedule NAPI poll */
3588 } else {
3589 /* No work, shared interrupt perhaps? re-enable
3590 * interrupts, and flush that PCI write
3591 */
3592 tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3593 0x00000000);
3594 } 3576 }
3595 } else { /* shared interrupt */ 3577 }
3596 handled = 0; 3578
3579 /*
3580 * Writing any value to intr-mbox-0 clears PCI INTA# and
3581 * chip-internal interrupt pending events.
3582 * Writing non-zero to intr-mbox-0 additional tells the
3583 * NIC to stop sending us irqs, engaging "in-intr-handler"
3584 * event coalescing.
3585 */
3586 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
3587 if (tg3_irq_sync(tp))
3588 goto out;
3589 sblk->status &= ~SD_STATUS_UPDATED;
3590 if (likely(tg3_has_work(tp))) {
3591 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3592 netif_rx_schedule(dev); /* schedule NAPI poll */
3593 } else {
3594 /* No work, shared interrupt perhaps? re-enable
3595 * interrupts, and flush that PCI write
3596 */
3597 tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3598 0x00000000);
3597 } 3599 }
3598out: 3600out:
3599 return IRQ_RETVAL(handled); 3601 return IRQ_RETVAL(handled);
@@ -3611,31 +3613,33 @@ static irqreturn_t tg3_interrupt_tagged(int irq, void *dev_id)
3611 * Reading the PCI State register will confirm whether the 3613 * Reading the PCI State register will confirm whether the
3612 * interrupt is ours and will flush the status block. 3614 * interrupt is ours and will flush the status block.
3613 */ 3615 */
3614 if ((sblk->status_tag != tp->last_tag) || 3616 if (unlikely(sblk->status_tag == tp->last_tag)) {
3615 !(tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) { 3617 if ((tp->tg3_flags & TG3_FLAG_CHIP_RESETTING) ||
3616 /* 3618 (tr32(TG3PCI_PCISTATE) & PCISTATE_INT_NOT_ACTIVE)) {
3617 * writing any value to intr-mbox-0 clears PCI INTA# and 3619 handled = 0;
3618 * chip-internal interrupt pending events.
3619 * writing non-zero to intr-mbox-0 additional tells the
3620 * NIC to stop sending us irqs, engaging "in-intr-handler"
3621 * event coalescing.
3622 */
3623 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
3624 0x00000001);
3625 if (tg3_irq_sync(tp))
3626 goto out; 3620 goto out;
3627 if (netif_rx_schedule_prep(dev)) {
3628 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3629 /* Update last_tag to mark that this status has been
3630 * seen. Because interrupt may be shared, we may be
3631 * racing with tg3_poll(), so only update last_tag
3632 * if tg3_poll() is not scheduled.
3633 */
3634 tp->last_tag = sblk->status_tag;
3635 __netif_rx_schedule(dev);
3636 } 3621 }
3637 } else { /* shared interrupt */ 3622 }
3638 handled = 0; 3623
3624 /*
3625 * writing any value to intr-mbox-0 clears PCI INTA# and
3626 * chip-internal interrupt pending events.
3627 * writing non-zero to intr-mbox-0 additional tells the
3628 * NIC to stop sending us irqs, engaging "in-intr-handler"
3629 * event coalescing.
3630 */
3631 tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
3632 if (tg3_irq_sync(tp))
3633 goto out;
3634 if (netif_rx_schedule_prep(dev)) {
3635 prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
3636 /* Update last_tag to mark that this status has been
3637 * seen. Because interrupt may be shared, we may be
3638 * racing with tg3_poll(), so only update last_tag
3639 * if tg3_poll() is not scheduled.
3640 */
3641 tp->last_tag = sblk->status_tag;
3642 __netif_rx_schedule(dev);
3639 } 3643 }
3640out: 3644out:
3641 return IRQ_RETVAL(handled); 3645 return IRQ_RETVAL(handled);
@@ -4823,6 +4827,19 @@ static int tg3_chip_reset(struct tg3 *tp)
4823 if (write_op == tg3_write_flush_reg32) 4827 if (write_op == tg3_write_flush_reg32)
4824 tp->write32 = tg3_write32; 4828 tp->write32 = tg3_write32;
4825 4829
4830 /* Prevent the irq handler from reading or writing PCI registers
4831 * during chip reset when the memory enable bit in the PCI command
4832 * register may be cleared. The chip does not generate interrupt
4833 * at this time, but the irq handler may still be called due to irq
4834 * sharing or irqpoll.
4835 */
4836 tp->tg3_flags |= TG3_FLAG_CHIP_RESETTING;
4837 tp->hw_status->status = 0;
4838 tp->hw_status->status_tag = 0;
4839 tp->last_tag = 0;
4840 smp_mb();
4841 synchronize_irq(tp->pdev->irq);
4842
4826 /* do the reset */ 4843 /* do the reset */
4827 val = GRC_MISC_CFG_CORECLK_RESET; 4844 val = GRC_MISC_CFG_CORECLK_RESET;
4828 4845
@@ -4904,6 +4921,8 @@ static int tg3_chip_reset(struct tg3 *tp)
4904 4921
4905 pci_restore_state(tp->pdev); 4922 pci_restore_state(tp->pdev);
4906 4923
4924 tp->tg3_flags &= ~TG3_FLAG_CHIP_RESETTING;
4925
4907 /* Make sure PCI-X relaxed ordering bit is clear. */ 4926 /* Make sure PCI-X relaxed ordering bit is clear. */
4908 pci_read_config_dword(tp->pdev, TG3PCI_X_CAPS, &val); 4927 pci_read_config_dword(tp->pdev, TG3PCI_X_CAPS, &val);
4909 val &= ~PCIX_CAPS_RELAXED_ORDERING; 4928 val &= ~PCIX_CAPS_RELAXED_ORDERING;
@@ -6321,8 +6340,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
6321 RDMAC_MODE_ADDROFLOW_ENAB | RDMAC_MODE_FIFOOFLOW_ENAB | 6340 RDMAC_MODE_ADDROFLOW_ENAB | RDMAC_MODE_FIFOOFLOW_ENAB |
6322 RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB | 6341 RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB |
6323 RDMAC_MODE_LNGREAD_ENAB); 6342 RDMAC_MODE_LNGREAD_ENAB);
6324 if (tp->tg3_flags & TG3_FLAG_SPLIT_MODE)
6325 rdmac_mode |= RDMAC_MODE_SPLIT_ENABLE;
6326 6343
6327 /* If statement applies to 5705 and 5750 PCI devices only */ 6344 /* If statement applies to 5705 and 5750 PCI devices only */
6328 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 && 6345 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
@@ -6495,9 +6512,6 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
6495 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { 6512 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) {
6496 val &= ~(PCIX_CAPS_SPLIT_MASK | PCIX_CAPS_BURST_MASK); 6513 val &= ~(PCIX_CAPS_SPLIT_MASK | PCIX_CAPS_BURST_MASK);
6497 val |= (PCIX_CAPS_MAX_BURST_CPIOB << PCIX_CAPS_BURST_SHIFT); 6514 val |= (PCIX_CAPS_MAX_BURST_CPIOB << PCIX_CAPS_BURST_SHIFT);
6498 if (tp->tg3_flags & TG3_FLAG_SPLIT_MODE)
6499 val |= (tp->split_mode_max_reqs <<
6500 PCIX_CAPS_SPLIT_SHIFT);
6501 } 6515 }
6502 tw32(TG3PCI_X_CAPS, val); 6516 tw32(TG3PCI_X_CAPS, val);
6503 } 6517 }
@@ -10863,14 +10877,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10863 grc_misc_cfg = tr32(GRC_MISC_CFG); 10877 grc_misc_cfg = tr32(GRC_MISC_CFG);
10864 grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK; 10878 grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK;
10865 10879
10866 /* Broadcom's driver says that CIOBE multisplit has a bug */
10867#if 0
10868 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
10869 grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5704CIOBE) {
10870 tp->tg3_flags |= TG3_FLAG_SPLIT_MODE;
10871 tp->split_mode_max_reqs = SPLIT_MODE_5704_MAX_REQ;
10872 }
10873#endif
10874 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 && 10880 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
10875 (grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788 || 10881 (grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788 ||
10876 grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788M)) 10882 grc_misc_cfg == GRC_MISC_CFG_BOARD_ID_5788M))
@@ -11968,14 +11974,12 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
11968 i == 5 ? '\n' : ':'); 11974 i == 5 ? '\n' : ':');
11969 11975
11970 printk(KERN_INFO "%s: RXcsums[%d] LinkChgREG[%d] " 11976 printk(KERN_INFO "%s: RXcsums[%d] LinkChgREG[%d] "
11971 "MIirq[%d] ASF[%d] Split[%d] WireSpeed[%d] " 11977 "MIirq[%d] ASF[%d] WireSpeed[%d] TSOcap[%d]\n",
11972 "TSOcap[%d] \n",
11973 dev->name, 11978 dev->name,
11974 (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0, 11979 (tp->tg3_flags & TG3_FLAG_RX_CHECKSUMS) != 0,
11975 (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) != 0, 11980 (tp->tg3_flags & TG3_FLAG_USE_LINKCHG_REG) != 0,
11976 (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) != 0, 11981 (tp->tg3_flags & TG3_FLAG_USE_MI_INTERRUPT) != 0,
11977 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0, 11982 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0,
11978 (tp->tg3_flags & TG3_FLAG_SPLIT_MODE) != 0,
11979 (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0, 11983 (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0,
11980 (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0); 11984 (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0);
11981 printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n", 11985 printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n",
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 086892d8c1f1..d515ed23841b 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2223,7 +2223,7 @@ struct tg3 {
2223#define TG3_FLAG_40BIT_DMA_BUG 0x08000000 2223#define TG3_FLAG_40BIT_DMA_BUG 0x08000000
2224#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 2224#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000
2225#define TG3_FLAG_GOT_SERDES_FLOWCTL 0x20000000 2225#define TG3_FLAG_GOT_SERDES_FLOWCTL 0x20000000
2226#define TG3_FLAG_SPLIT_MODE 0x40000000 2226#define TG3_FLAG_CHIP_RESETTING 0x40000000
2227#define TG3_FLAG_INIT_COMPLETE 0x80000000 2227#define TG3_FLAG_INIT_COMPLETE 0x80000000
2228 u32 tg3_flags2; 2228 u32 tg3_flags2;
2229#define TG3_FLG2_RESTART_TIMER 0x00000001 2229#define TG3_FLG2_RESTART_TIMER 0x00000001
@@ -2262,9 +2262,6 @@ struct tg3 {
2262#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000 2262#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
2263#define TG3_FLG2_PHY_ADJUST_TRIM 0x80000000 2263#define TG3_FLG2_PHY_ADJUST_TRIM 0x80000000
2264 2264
2265 u32 split_mode_max_reqs;
2266#define SPLIT_MODE_5704_MAX_REQ 3
2267
2268 struct timer_list timer; 2265 struct timer_list timer;
2269 u16 timer_counter; 2266 u16 timer_counter;
2270 u16 timer_multiplier; 2267 u16 timer_multiplier;
diff --git a/drivers/net/wan/lmc/lmc_media.h b/drivers/net/wan/lmc/lmc_media.h
deleted file mode 100644
index ddcc00403563..000000000000
--- a/drivers/net/wan/lmc/lmc_media.h
+++ /dev/null
@@ -1,65 +0,0 @@
1#ifndef _LMC_MEDIA_H_
2#define _LMC_MEDIA_H_
3
4lmc_media_t lmc_ds3_media = {
5 lmc_ds3_init, /* special media init stuff */
6 lmc_ds3_default, /* reset to default state */
7 lmc_ds3_set_status, /* reset status to state provided */
8 lmc_dummy_set_1, /* set clock source */
9 lmc_dummy_set2_1, /* set line speed */
10 lmc_ds3_set_100ft, /* set cable length */
11 lmc_ds3_set_scram, /* set scrambler */
12 lmc_ds3_get_link_status, /* get link status */
13 lmc_dummy_set_1, /* set link status */
14 lmc_ds3_set_crc_length, /* set CRC length */
15 lmc_dummy_set_1, /* set T1 or E1 circuit type */
16 lmc_ds3_watchdog
17};
18
19lmc_media_t lmc_hssi_media = {
20 lmc_hssi_init, /* special media init stuff */
21 lmc_hssi_default, /* reset to default state */
22 lmc_hssi_set_status, /* reset status to state provided */
23 lmc_hssi_set_clock, /* set clock source */
24 lmc_dummy_set2_1, /* set line speed */
25 lmc_dummy_set_1, /* set cable length */
26 lmc_dummy_set_1, /* set scrambler */
27 lmc_hssi_get_link_status, /* get link status */
28 lmc_hssi_set_link_status, /* set link status */
29 lmc_hssi_set_crc_length, /* set CRC length */
30 lmc_dummy_set_1, /* set T1 or E1 circuit type */
31 lmc_hssi_watchdog
32};
33
34lmc_media_t lmc_ssi_media = { lmc_ssi_init, /* special media init stuff */
35 lmc_ssi_default, /* reset to default state */
36 lmc_ssi_set_status, /* reset status to state provided */
37 lmc_ssi_set_clock, /* set clock source */
38 lmc_ssi_set_speed, /* set line speed */
39 lmc_dummy_set_1, /* set cable length */
40 lmc_dummy_set_1, /* set scrambler */
41 lmc_ssi_get_link_status, /* get link status */
42 lmc_ssi_set_link_status, /* set link status */
43 lmc_ssi_set_crc_length, /* set CRC length */
44 lmc_dummy_set_1, /* set T1 or E1 circuit type */
45 lmc_ssi_watchdog
46};
47
48lmc_media_t lmc_t1_media = {
49 lmc_t1_init, /* special media init stuff */
50 lmc_t1_default, /* reset to default state */
51 lmc_t1_set_status, /* reset status to state provided */
52 lmc_t1_set_clock, /* set clock source */
53 lmc_dummy_set2_1, /* set line speed */
54 lmc_dummy_set_1, /* set cable length */
55 lmc_dummy_set_1, /* set scrambler */
56 lmc_t1_get_link_status, /* get link status */
57 lmc_dummy_set_1, /* set link status */
58 lmc_t1_set_crc_length, /* set CRC length */
59 lmc_t1_set_circuit_type, /* set T1 or E1 circuit type */
60 lmc_t1_watchdog
61};
62
63
64#endif
65
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 0be5a0b30725..df383645e366 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -93,7 +93,7 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
93 if (!dev->irq && dev->pin) { 93 if (!dev->irq && dev->pin) {
94 printk(KERN_WARNING 94 printk(KERN_WARNING
95 "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", 95 "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n",
96 __FUNCTION__, dev->device, dev->vendor); 96 __FUNCTION__, dev->vendor, dev->device);
97 } 97 }
98 if (pcie_port_device_register(dev)) { 98 if (pcie_port_device_register(dev)) {
99 pci_disable_device(dev); 99 pci_disable_device(dev);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f94fc098cd3..65d6f23ead41 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -963,6 +963,13 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_ho
963 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it 963 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it
964 * becomes necessary to do this tweak in two steps -- I've chosen the Host 964 * becomes necessary to do this tweak in two steps -- I've chosen the Host
965 * bridge as trigger. 965 * bridge as trigger.
966 *
967 * Note that we used to unhide the SMBus that way on Toshiba laptops
968 * (Satellite A40 and Tecra M2) but then found that the thermal management
969 * was done by SMM code, which could cause unsynchronized concurrent
970 * accesses to the SMBus registers, with potentially bad effects. Thus you
971 * should be very careful when adding new entries: if SMM is accessing the
972 * Intel SMBus, this is a very good reason to leave it hidden.
966 */ 973 */
967static int asus_hides_smbus; 974static int asus_hides_smbus;
968 975
@@ -1040,17 +1047,6 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
1040 case 0x099c: /* HP Compaq nx6110 */ 1047 case 0x099c: /* HP Compaq nx6110 */
1041 asus_hides_smbus = 1; 1048 asus_hides_smbus = 1;
1042 } 1049 }
1043 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA)) {
1044 if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB)
1045 switch(dev->subsystem_device) {
1046 case 0x0001: /* Toshiba Satellite A40 */
1047 asus_hides_smbus = 1;
1048 }
1049 else if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB)
1050 switch(dev->subsystem_device) {
1051 case 0x0001: /* Toshiba Tecra M2 */
1052 asus_hides_smbus = 1;
1053 }
1054 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) { 1050 } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) {
1055 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) 1051 if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB)
1056 switch(dev->subsystem_device) { 1052 switch(dev->subsystem_device) {
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 551bde5d9430..b693367d38cd 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -372,7 +372,7 @@ int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops,
372 skt->socket.resource_ops = &pccard_static_ops; 372 skt->socket.resource_ops = &pccard_static_ops;
373 skt->socket.ops = &au1x00_pcmcia_operations; 373 skt->socket.ops = &au1x00_pcmcia_operations;
374 skt->socket.owner = ops->owner; 374 skt->socket.owner = ops->owner;
375 skt->socket.dev.dev = dev; 375 skt->socket.dev.parent = dev;
376 376
377 init_timer(&skt->poll_timer); 377 init_timer(&skt->poll_timer);
378 skt->poll_timer.function = au1x00_pcmcia_poll_event; 378 skt->poll_timer.function = au1x00_pcmcia_poll_event;
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index ab782bb46ac1..e810e4a44ed4 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -65,7 +65,7 @@ static const u8 DASD_DIAG_CMS1[] = { 0xc3, 0xd4, 0xe2, 0xf1 };/* EBCDIC CMS1 */
65 * resulting condition code and DIAG return code. */ 65 * resulting condition code and DIAG return code. */
66static inline int dia250(void *iob, int cmd) 66static inline int dia250(void *iob, int cmd)
67{ 67{
68 register unsigned long reg0 asm ("0") = (unsigned long) iob; 68 register unsigned long reg2 asm ("2") = (unsigned long) iob;
69 typedef union { 69 typedef union {
70 struct dasd_diag_init_io init_io; 70 struct dasd_diag_init_io init_io;
71 struct dasd_diag_rw_io rw_io; 71 struct dasd_diag_rw_io rw_io;
@@ -74,15 +74,15 @@ static inline int dia250(void *iob, int cmd)
74 74
75 rc = 3; 75 rc = 3;
76 asm volatile( 76 asm volatile(
77 " diag 0,%2,0x250\n" 77 " diag 2,%2,0x250\n"
78 "0: ipm %0\n" 78 "0: ipm %0\n"
79 " srl %0,28\n" 79 " srl %0,28\n"
80 " or %0,1\n" 80 " or %0,3\n"
81 "1:\n" 81 "1:\n"
82 EX_TABLE(0b,1b) 82 EX_TABLE(0b,1b)
83 : "+d" (rc), "=m" (*(addr_type *) iob) 83 : "+d" (rc), "=m" (*(addr_type *) iob)
84 : "d" (cmd), "d" (reg0), "m" (*(addr_type *) iob) 84 : "d" (cmd), "d" (reg2), "m" (*(addr_type *) iob)
85 : "1", "cc"); 85 : "3", "cc");
86 return rc; 86 return rc;
87} 87}
88 88
diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c
index 6b1caea622ea..25d99bd28089 100644
--- a/drivers/s390/cio/device_status.c
+++ b/drivers/s390/cio/device_status.c
@@ -263,7 +263,11 @@ ccw_device_accumulate_irb(struct ccw_device *cdev, struct irb *irb)
263 cdev_irb->scsw.cpa = irb->scsw.cpa; 263 cdev_irb->scsw.cpa = irb->scsw.cpa;
264 /* Accumulate device status, but not the device busy flag. */ 264 /* Accumulate device status, but not the device busy flag. */
265 cdev_irb->scsw.dstat &= ~DEV_STAT_BUSY; 265 cdev_irb->scsw.dstat &= ~DEV_STAT_BUSY;
266 cdev_irb->scsw.dstat |= irb->scsw.dstat; 266 /* dstat is not always valid. */
267 if (irb->scsw.stctl &
268 (SCSW_STCTL_PRIM_STATUS | SCSW_STCTL_SEC_STATUS
269 | SCSW_STCTL_INTER_STATUS | SCSW_STCTL_ALERT_STATUS))
270 cdev_irb->scsw.dstat |= irb->scsw.dstat;
267 /* Accumulate subchannel status. */ 271 /* Accumulate subchannel status. */
268 cdev_irb->scsw.cstat |= irb->scsw.cstat; 272 cdev_irb->scsw.cstat |= irb->scsw.cstat;
269 /* Copy residual count if it is valid. */ 273 /* Copy residual count if it is valid. */
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 181b51772b1b..bf37cdf43fae 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -505,6 +505,9 @@ static int ap_device_remove(struct device *dev)
505 spin_lock_bh(&ap_device_lock); 505 spin_lock_bh(&ap_device_lock);
506 list_del_init(&ap_dev->list); 506 list_del_init(&ap_dev->list);
507 spin_unlock_bh(&ap_device_lock); 507 spin_unlock_bh(&ap_device_lock);
508 spin_lock_bh(&ap_dev->lock);
509 atomic_sub(ap_dev->queue_count, &ap_poll_requests);
510 spin_unlock_bh(&ap_dev->lock);
508 return 0; 511 return 0;
509} 512}
510 513
@@ -757,10 +760,16 @@ static void ap_scan_bus(struct work_struct *unused)
757 (void *)(unsigned long)qid, 760 (void *)(unsigned long)qid,
758 __ap_scan_bus); 761 __ap_scan_bus);
759 rc = ap_query_queue(qid, &queue_depth, &device_type); 762 rc = ap_query_queue(qid, &queue_depth, &device_type);
760 if (dev && rc) { 763 if (dev) {
761 put_device(dev); 764 ap_dev = to_ap_dev(dev);
762 device_unregister(dev); 765 spin_lock_bh(&ap_dev->lock);
763 continue; 766 if (rc || ap_dev->unregistered) {
767 spin_unlock_bh(&ap_dev->lock);
768 put_device(dev);
769 device_unregister(dev);
770 continue;
771 } else
772 spin_unlock_bh(&ap_dev->lock);
764 } 773 }
765 if (dev) { 774 if (dev) {
766 put_device(dev); 775 put_device(dev);
@@ -861,6 +870,7 @@ static int ap_poll_read(struct ap_device *ap_dev, unsigned long *flags)
861 case AP_RESPONSE_NO_PENDING_REPLY: 870 case AP_RESPONSE_NO_PENDING_REPLY:
862 if (status.queue_empty) { 871 if (status.queue_empty) {
863 /* The card shouldn't forget requests but who knows. */ 872 /* The card shouldn't forget requests but who knows. */
873 atomic_sub(ap_dev->queue_count, &ap_poll_requests);
864 ap_dev->queue_count = 0; 874 ap_dev->queue_count = 0;
865 list_splice_init(&ap_dev->pendingq, &ap_dev->requestq); 875 list_splice_init(&ap_dev->pendingq, &ap_dev->requestq);
866 ap_dev->requestq_count += ap_dev->pendingq_count; 876 ap_dev->requestq_count += ap_dev->pendingq_count;
@@ -994,7 +1004,7 @@ void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg)
994 ap_dev->unregistered = 1; 1004 ap_dev->unregistered = 1;
995 } else { 1005 } else {
996 ap_dev->drv->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV)); 1006 ap_dev->drv->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV));
997 rc = 0; 1007 rc = -ENODEV;
998 } 1008 }
999 spin_unlock_bh(&ap_dev->lock); 1009 spin_unlock_bh(&ap_dev->lock);
1000 if (rc == -ENODEV) 1010 if (rc == -ENODEV)
@@ -1044,18 +1054,12 @@ static void ap_poll_timeout(unsigned long unused)
1044 */ 1054 */
1045static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags) 1055static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags)
1046{ 1056{
1047 int rc;
1048
1049 spin_lock(&ap_dev->lock); 1057 spin_lock(&ap_dev->lock);
1050 if (!ap_dev->unregistered) { 1058 if (!ap_dev->unregistered) {
1051 rc = ap_poll_queue(ap_dev, flags); 1059 if (ap_poll_queue(ap_dev, flags))
1052 if (rc)
1053 ap_dev->unregistered = 1; 1060 ap_dev->unregistered = 1;
1054 } else 1061 }
1055 rc = 0;
1056 spin_unlock(&ap_dev->lock); 1062 spin_unlock(&ap_dev->lock);
1057 if (rc)
1058 device_unregister(&ap_dev->device);
1059 return 0; 1063 return 0;
1060} 1064}
1061 1065
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 8c81cec85298..60446b88f721 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -3091,6 +3091,7 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b)
3091 cmdp->u.raw64.direction = 3091 cmdp->u.raw64.direction =
3092 gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN; 3092 gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN;
3093 memcpy(cmdp->u.raw64.cmd,scp->cmnd,16); 3093 memcpy(cmdp->u.raw64.cmd,scp->cmnd,16);
3094 cmdp->u.raw64.sg_ranz = 0;
3094 } else { 3095 } else {
3095 cmdp->u.raw.reserved = 0; 3096 cmdp->u.raw.reserved = 0;
3096 cmdp->u.raw.mdisc_time = 0; 3097 cmdp->u.raw.mdisc_time = 0;
@@ -3107,6 +3108,7 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b)
3107 cmdp->u.raw.direction = 3108 cmdp->u.raw.direction =
3108 gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN; 3109 gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN;
3109 memcpy(cmdp->u.raw.cmd,scp->cmnd,12); 3110 memcpy(cmdp->u.raw.cmd,scp->cmnd,12);
3111 cmdp->u.raw.sg_ranz = 0;
3110 } 3112 }
3111 3113
3112 if (scp->use_sg) { 3114 if (scp->use_sg) {
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 9d014e5a81c4..057fd7e0e379 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1817,10 +1817,9 @@ static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev,
1817 struct lpfc_sli *psli = &phba->sli; 1817 struct lpfc_sli *psli = &phba->sli;
1818 struct lpfc_sli_ring *pring; 1818 struct lpfc_sli_ring *pring;
1819 1819
1820 if (state == pci_channel_io_perm_failure) { 1820 if (state == pci_channel_io_perm_failure)
1821 lpfc_pci_remove_one(pdev);
1822 return PCI_ERS_RESULT_DISCONNECT; 1821 return PCI_ERS_RESULT_DISCONNECT;
1823 } 1822
1824 pci_disable_device(pdev); 1823 pci_disable_device(pdev);
1825 /* 1824 /*
1826 * There may be I/Os dropped by the firmware. 1825 * There may be I/Os dropped by the firmware.
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 2328128728be..6657331eed93 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -189,8 +189,8 @@ static DECLARE_MUTEX(board_lock);
189 * this is exported so that for example a USB or parport based adapter 189 * this is exported so that for example a USB or parport based adapter
190 * driver could add devices (which it would learn about out-of-band). 190 * driver could add devices (which it would learn about out-of-band).
191 */ 191 */
192struct spi_device *__init_or_module 192struct spi_device *spi_new_device(struct spi_master *master,
193spi_new_device(struct spi_master *master, struct spi_board_info *chip) 193 struct spi_board_info *chip)
194{ 194{
195 struct spi_device *proxy; 195 struct spi_device *proxy;
196 struct device *dev = master->cdev.dev; 196 struct device *dev = master->cdev.dev;
@@ -352,8 +352,7 @@ static struct class spi_master_class = {
352 * the master's methods before calling spi_register_master(); and (after errors 352 * the master's methods before calling spi_register_master(); and (after errors
353 * adding the device) calling spi_master_put() to prevent a memory leak. 353 * adding the device) calling spi_master_put() to prevent a memory leak.
354 */ 354 */
355struct spi_master * __init_or_module 355struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
356spi_alloc_master(struct device *dev, unsigned size)
357{ 356{
358 struct spi_master *master; 357 struct spi_master *master;
359 358
@@ -392,8 +391,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master);
392 * After a successful return, the caller is responsible for calling 391 * After a successful return, the caller is responsible for calling
393 * spi_unregister_master(). 392 * spi_unregister_master().
394 */ 393 */
395int __init_or_module 394int spi_register_master(struct spi_master *master)
396spi_register_master(struct spi_master *master)
397{ 395{
398 static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1); 396 static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1);
399 struct device *dev = master->cdev.dev; 397 struct device *dev = master->cdev.dev;
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 0e5c646cb4f6..f08ec85a6d64 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -30,7 +30,8 @@
30static const struct usb_device_id usb_quirk_list[] = { 30static const struct usb_device_id usb_quirk_list[] = {
31 /* HP 5300/5370C scanner */ 31 /* HP 5300/5370C scanner */
32 { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, 32 { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 },
33 33 /* Seiko Epson Corp - Perfection 1670 */
34 { USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
34 /* Elsa MicroLink 56k (V.250) */ 35 /* Elsa MicroLink 56k (V.250) */
35 { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 36 { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
36 37
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 8f9a2b615422..b394e63894d2 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -296,6 +296,15 @@ omap_free_request(struct usb_ep *ep, struct usb_request *_req)
296 296
297/*-------------------------------------------------------------------------*/ 297/*-------------------------------------------------------------------------*/
298 298
299/*
300 * dma-coherent memory allocation (for dma-capable endpoints)
301 *
302 * NOTE: the dma_*_coherent() API calls suck. Most implementations are
303 * (a) page-oriented, so small buffers lose big; and (b) asymmetric with
304 * respect to calls with irqs disabled: alloc is safe, free is not.
305 * We currently work around (b), but not (a).
306 */
307
299static void * 308static void *
300omap_alloc_buffer( 309omap_alloc_buffer(
301 struct usb_ep *_ep, 310 struct usb_ep *_ep,
@@ -307,6 +316,9 @@ omap_alloc_buffer(
307 void *retval; 316 void *retval;
308 struct omap_ep *ep; 317 struct omap_ep *ep;
309 318
319 if (!_ep)
320 return NULL;
321
310 ep = container_of(_ep, struct omap_ep, ep); 322 ep = container_of(_ep, struct omap_ep, ep);
311 if (use_dma && ep->has_dma) { 323 if (use_dma && ep->has_dma) {
312 static int warned; 324 static int warned;
@@ -326,6 +338,35 @@ omap_alloc_buffer(
326 return retval; 338 return retval;
327} 339}
328 340
341static DEFINE_SPINLOCK(buflock);
342static LIST_HEAD(buffers);
343
344struct free_record {
345 struct list_head list;
346 struct device *dev;
347 unsigned bytes;
348 dma_addr_t dma;
349};
350
351static void do_free(unsigned long ignored)
352{
353 spin_lock_irq(&buflock);
354 while (!list_empty(&buffers)) {
355 struct free_record *buf;
356
357 buf = list_entry(buffers.next, struct free_record, list);
358 list_del(&buf->list);
359 spin_unlock_irq(&buflock);
360
361 dma_free_coherent(buf->dev, buf->bytes, buf, buf->dma);
362
363 spin_lock_irq(&buflock);
364 }
365 spin_unlock_irq(&buflock);
366}
367
368static DECLARE_TASKLET(deferred_free, do_free, 0);
369
329static void omap_free_buffer( 370static void omap_free_buffer(
330 struct usb_ep *_ep, 371 struct usb_ep *_ep,
331 void *buf, 372 void *buf,
@@ -333,13 +374,29 @@ static void omap_free_buffer(
333 unsigned bytes 374 unsigned bytes
334) 375)
335{ 376{
336 struct omap_ep *ep; 377 if (!_ep) {
378 WARN_ON(1);
379 return;
380 }
337 381
338 ep = container_of(_ep, struct omap_ep, ep); 382 /* free memory into the right allocator */
339 if (use_dma && _ep && ep->has_dma) 383 if (dma != DMA_ADDR_INVALID) {
340 dma_free_coherent(ep->udc->gadget.dev.parent, bytes, buf, dma); 384 struct omap_ep *ep;
341 else 385 struct free_record *rec = buf;
342 kfree (buf); 386 unsigned long flags;
387
388 ep = container_of(_ep, struct omap_ep, ep);
389
390 rec->dev = ep->udc->gadget.dev.parent;
391 rec->bytes = bytes;
392 rec->dma = dma;
393
394 spin_lock_irqsave(&buflock, flags);
395 list_add_tail(&rec->list, &buffers);
396 tasklet_schedule(&deferred_free);
397 spin_unlock_irqrestore(&buflock, flags);
398 } else
399 kfree(buf);
343} 400}
344 401
345/*-------------------------------------------------------------------------*/ 402/*-------------------------------------------------------------------------*/
@@ -1691,12 +1748,38 @@ ep0out_status_stage:
1691 udc->ep0_pending = 0; 1748 udc->ep0_pending = 0;
1692 break; 1749 break;
1693 case USB_REQ_GET_STATUS: 1750 case USB_REQ_GET_STATUS:
1751 /* USB_ENDPOINT_HALT status? */
1752 if (u.r.bRequestType != (USB_DIR_IN|USB_RECIP_ENDPOINT))
1753 goto intf_status;
1754
1755 /* ep0 never stalls */
1756 if (!(w_index & 0xf))
1757 goto zero_status;
1758
1759 /* only active endpoints count */
1760 ep = &udc->ep[w_index & 0xf];
1761 if (w_index & USB_DIR_IN)
1762 ep += 16;
1763 if (!ep->desc)
1764 goto do_stall;
1765
1766 /* iso never stalls */
1767 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC)
1768 goto zero_status;
1769
1770 /* FIXME don't assume non-halted endpoints!! */
1771 ERR("%s status, can't report\n", ep->ep.name);
1772 goto do_stall;
1773
1774intf_status:
1694 /* return interface status. if we were pedantic, 1775 /* return interface status. if we were pedantic,
1695 * we'd detect non-existent interfaces, and stall. 1776 * we'd detect non-existent interfaces, and stall.
1696 */ 1777 */
1697 if (u.r.bRequestType 1778 if (u.r.bRequestType
1698 != (USB_DIR_IN|USB_RECIP_INTERFACE)) 1779 != (USB_DIR_IN|USB_RECIP_INTERFACE))
1699 goto delegate; 1780 goto delegate;
1781
1782zero_status:
1700 /* return two zero bytes */ 1783 /* return two zero bytes */
1701 UDC_EP_NUM_REG = UDC_EP_SEL|UDC_EP_DIR; 1784 UDC_EP_NUM_REG = UDC_EP_SEL|UDC_EP_DIR;
1702 UDC_DATA_REG = 0; 1785 UDC_DATA_REG = 0;
@@ -2068,7 +2151,7 @@ static irqreturn_t omap_udc_iso_irq(int irq, void *_dev)
2068 2151
2069/*-------------------------------------------------------------------------*/ 2152/*-------------------------------------------------------------------------*/
2070 2153
2071static inline int machine_needs_vbus_session(void) 2154static inline int machine_without_vbus_sense(void)
2072{ 2155{
2073 return (machine_is_omap_innovator() 2156 return (machine_is_omap_innovator()
2074 || machine_is_omap_osk() 2157 || machine_is_omap_osk()
@@ -2156,7 +2239,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
2156 /* boards that don't have VBUS sensing can't autogate 48MHz; 2239 /* boards that don't have VBUS sensing can't autogate 48MHz;
2157 * can't enter deep sleep while a gadget driver is active. 2240 * can't enter deep sleep while a gadget driver is active.
2158 */ 2241 */
2159 if (machine_needs_vbus_session()) 2242 if (machine_without_vbus_sense())
2160 omap_vbus_session(&udc->gadget, 1); 2243 omap_vbus_session(&udc->gadget, 1);
2161 2244
2162done: 2245done:
@@ -2179,7 +2262,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
2179 if (udc->dc_clk != NULL) 2262 if (udc->dc_clk != NULL)
2180 omap_udc_enable_clock(1); 2263 omap_udc_enable_clock(1);
2181 2264
2182 if (machine_needs_vbus_session()) 2265 if (machine_without_vbus_sense())
2183 omap_vbus_session(&udc->gadget, 0); 2266 omap_vbus_session(&udc->gadget, 0);
2184 2267
2185 if (udc->transceiver) 2268 if (udc->transceiver)
@@ -2822,7 +2905,7 @@ static int __init omap_udc_probe(struct platform_device *pdev)
2822 hmc = HMC_1510; 2905 hmc = HMC_1510;
2823 type = "(unknown)"; 2906 type = "(unknown)";
2824 2907
2825 if (machine_is_omap_innovator() || machine_is_sx1()) { 2908 if (machine_without_vbus_sense()) {
2826 /* just set up software VBUS detect, and then 2909 /* just set up software VBUS detect, and then
2827 * later rig it so we always report VBUS. 2910 * later rig it so we always report VBUS.
2828 * FIXME without really sensing VBUS, we can't 2911 * FIXME without really sensing VBUS, we can't
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index 8d24d3dc0a61..1497371583b9 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -145,7 +145,8 @@ static int uhci_show_urbp(struct urb_priv *urbp, char *buf, int len, int space)
145 return out - buf; 145 return out - buf;
146} 146}
147 147
148static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) 148static int uhci_show_qh(struct uhci_hcd *uhci,
149 struct uhci_qh *qh, char *buf, int len, int space)
149{ 150{
150 char *out = buf; 151 char *out = buf;
151 int i, nurbs; 152 int i, nurbs;
@@ -190,6 +191,9 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space)
190 191
191 if (list_empty(&qh->queue)) { 192 if (list_empty(&qh->queue)) {
192 out += sprintf(out, "%*s queue is empty\n", space, ""); 193 out += sprintf(out, "%*s queue is empty\n", space, "");
194 if (qh == uhci->skel_async_qh)
195 out += uhci_show_td(uhci->term_td, out,
196 len - (out - buf), 0);
193 } else { 197 } else {
194 struct urb_priv *urbp = list_entry(qh->queue.next, 198 struct urb_priv *urbp = list_entry(qh->queue.next,
195 struct urb_priv, node); 199 struct urb_priv, node);
@@ -343,6 +347,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
343 struct list_head *tmp, *head; 347 struct list_head *tmp, *head;
344 int nframes, nerrs; 348 int nframes, nerrs;
345 __le32 link; 349 __le32 link;
350 __le32 fsbr_link;
346 351
347 static const char * const qh_names[] = { 352 static const char * const qh_names[] = {
348 "unlink", "iso", "int128", "int64", "int32", "int16", 353 "unlink", "iso", "int128", "int64", "int32", "int16",
@@ -424,21 +429,22 @@ check_link:
424 429
425 out += sprintf(out, "Skeleton QHs\n"); 430 out += sprintf(out, "Skeleton QHs\n");
426 431
432 fsbr_link = 0;
427 for (i = 0; i < UHCI_NUM_SKELQH; ++i) { 433 for (i = 0; i < UHCI_NUM_SKELQH; ++i) {
428 int cnt = 0; 434 int cnt = 0;
429 __le32 fsbr_link = 0;
430 435
431 qh = uhci->skelqh[i]; 436 qh = uhci->skelqh[i];
432 out += sprintf(out, "- skel_%s_qh\n", qh_names[i]); \ 437 out += sprintf(out, "- skel_%s_qh\n", qh_names[i]); \
433 out += uhci_show_qh(qh, out, len - (out - buf), 4); 438 out += uhci_show_qh(uhci, qh, out, len - (out - buf), 4);
434 439
435 /* Last QH is the Terminating QH, it's different */ 440 /* Last QH is the Terminating QH, it's different */
436 if (i == SKEL_TERM) { 441 if (i == SKEL_TERM) {
437 if (qh_element(qh) != LINK_TO_TD(uhci->term_td)) 442 if (qh_element(qh) != LINK_TO_TD(uhci->term_td))
438 out += sprintf(out, " skel_term_qh element is not set to term_td!\n"); 443 out += sprintf(out, " skel_term_qh element is not set to term_td!\n");
439 if (link == LINK_TO_QH(uhci->skel_term_qh)) 444 link = fsbr_link;
440 goto check_qh_link; 445 if (!link)
441 continue; 446 link = LINK_TO_QH(uhci->skel_term_qh);
447 goto check_qh_link;
442 } 448 }
443 449
444 head = &qh->node; 450 head = &qh->node;
@@ -448,7 +454,7 @@ check_link:
448 qh = list_entry(tmp, struct uhci_qh, node); 454 qh = list_entry(tmp, struct uhci_qh, node);
449 tmp = tmp->next; 455 tmp = tmp->next;
450 if (++cnt <= 10) 456 if (++cnt <= 10)
451 out += uhci_show_qh(qh, out, 457 out += uhci_show_qh(uhci, qh, out,
452 len - (out - buf), 4); 458 len - (out - buf), 4);
453 if (!fsbr_link && qh->skel >= SKEL_FSBR) 459 if (!fsbr_link && qh->skel >= SKEL_FSBR)
454 fsbr_link = LINK_TO_QH(qh); 460 fsbr_link = LINK_TO_QH(qh);
@@ -463,8 +469,6 @@ check_link:
463 link = LINK_TO_QH(uhci->skel_async_qh); 469 link = LINK_TO_QH(uhci->skel_async_qh);
464 else if (!uhci->fsbr_is_on) 470 else if (!uhci->fsbr_is_on)
465 ; 471 ;
466 else if (fsbr_link)
467 link = fsbr_link;
468 else 472 else
469 link = LINK_TO_QH(uhci->skel_term_qh); 473 link = LINK_TO_QH(uhci->skel_term_qh);
470check_qh_link: 474check_qh_link:
@@ -573,8 +577,8 @@ static const struct file_operations uhci_debug_operations = {
573static inline void lprintk(char *buf) 577static inline void lprintk(char *buf)
574{} 578{}
575 579
576static inline int uhci_show_qh(struct uhci_qh *qh, char *buf, 580static inline int uhci_show_qh(struct uhci_hcd *uhci,
577 int len, int space) 581 struct uhci_qh *qh, char *buf, int len, int space)
578{ 582{
579 return 0; 583 return 0;
580} 584}
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 44da4334f1d6..d22da26ff167 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -632,7 +632,8 @@ static int uhci_start(struct usb_hcd *hcd)
632 */ 632 */
633 for (i = SKEL_ISO + 1; i < SKEL_ASYNC; ++i) 633 for (i = SKEL_ISO + 1; i < SKEL_ASYNC; ++i)
634 uhci->skelqh[i]->link = LINK_TO_QH(uhci->skel_async_qh); 634 uhci->skelqh[i]->link = LINK_TO_QH(uhci->skel_async_qh);
635 uhci->skel_async_qh->link = uhci->skel_term_qh->link = UHCI_PTR_TERM; 635 uhci->skel_async_qh->link = UHCI_PTR_TERM;
636 uhci->skel_term_qh->link = LINK_TO_QH(uhci->skel_term_qh);
636 637
637 /* This dummy TD is to work around a bug in Intel PIIX controllers */ 638 /* This dummy TD is to work around a bug in Intel PIIX controllers */
638 uhci_fill_td(uhci->term_td, 0, uhci_explen(0) | 639 uhci_fill_td(uhci->term_td, 0, uhci_explen(0) |
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index f4ebdb3e488f..19a0cc02b9a2 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -45,43 +45,27 @@ static inline void uhci_clear_next_interrupt(struct uhci_hcd *uhci)
45 */ 45 */
46static void uhci_fsbr_on(struct uhci_hcd *uhci) 46static void uhci_fsbr_on(struct uhci_hcd *uhci)
47{ 47{
48 struct uhci_qh *fsbr_qh, *lqh, *tqh; 48 struct uhci_qh *lqh;
49 49
50 /* The terminating skeleton QH always points back to the first
51 * FSBR QH. Make the last async QH point to the terminating
52 * skeleton QH. */
50 uhci->fsbr_is_on = 1; 53 uhci->fsbr_is_on = 1;
51 lqh = list_entry(uhci->skel_async_qh->node.prev, 54 lqh = list_entry(uhci->skel_async_qh->node.prev,
52 struct uhci_qh, node); 55 struct uhci_qh, node);
53 56 lqh->link = LINK_TO_QH(uhci->skel_term_qh);
54 /* Find the first FSBR QH. Linear search through the list is
55 * acceptable because normally FSBR gets turned on as soon as
56 * one QH needs it. */
57 fsbr_qh = NULL;
58 list_for_each_entry_reverse(tqh, &uhci->skel_async_qh->node, node) {
59 if (tqh->skel < SKEL_FSBR)
60 break;
61 fsbr_qh = tqh;
62 }
63
64 /* No FSBR QH means we must insert the terminating skeleton QH */
65 if (!fsbr_qh) {
66 uhci->skel_term_qh->link = LINK_TO_QH(uhci->skel_term_qh);
67 wmb();
68 lqh->link = uhci->skel_term_qh->link;
69
70 /* Otherwise loop the last QH to the first FSBR QH */
71 } else
72 lqh->link = LINK_TO_QH(fsbr_qh);
73} 57}
74 58
75static void uhci_fsbr_off(struct uhci_hcd *uhci) 59static void uhci_fsbr_off(struct uhci_hcd *uhci)
76{ 60{
77 struct uhci_qh *lqh; 61 struct uhci_qh *lqh;
78 62
63 /* Remove the link from the last async QH to the terminating
64 * skeleton QH. */
79 uhci->fsbr_is_on = 0; 65 uhci->fsbr_is_on = 0;
80 lqh = list_entry(uhci->skel_async_qh->node.prev, 66 lqh = list_entry(uhci->skel_async_qh->node.prev,
81 struct uhci_qh, node); 67 struct uhci_qh, node);
82 68 lqh->link = UHCI_PTR_TERM;
83 /* End the async list normally and unlink the terminating QH */
84 lqh->link = uhci->skel_term_qh->link = UHCI_PTR_TERM;
85} 69}
86 70
87static void uhci_add_fsbr(struct uhci_hcd *uhci, struct urb *urb) 71static void uhci_add_fsbr(struct uhci_hcd *uhci, struct urb *urb)
@@ -464,9 +448,8 @@ static void link_interrupt(struct uhci_hcd *uhci, struct uhci_qh *qh)
464 */ 448 */
465static void link_async(struct uhci_hcd *uhci, struct uhci_qh *qh) 449static void link_async(struct uhci_hcd *uhci, struct uhci_qh *qh)
466{ 450{
467 struct uhci_qh *pqh, *lqh; 451 struct uhci_qh *pqh;
468 __le32 link_to_new_qh; 452 __le32 link_to_new_qh;
469 __le32 *extra_link = &link_to_new_qh;
470 453
471 /* Find the predecessor QH for our new one and insert it in the list. 454 /* Find the predecessor QH for our new one and insert it in the list.
472 * The list of QHs is expected to be short, so linear search won't 455 * The list of QHs is expected to be short, so linear search won't
@@ -476,31 +459,17 @@ static void link_async(struct uhci_hcd *uhci, struct uhci_qh *qh)
476 break; 459 break;
477 } 460 }
478 list_add(&qh->node, &pqh->node); 461 list_add(&qh->node, &pqh->node);
479 qh->link = pqh->link;
480
481 link_to_new_qh = LINK_TO_QH(qh);
482
483 /* If this is now the first FSBR QH, take special action */
484 if (uhci->fsbr_is_on && pqh->skel < SKEL_FSBR &&
485 qh->skel >= SKEL_FSBR) {
486 lqh = list_entry(uhci->skel_async_qh->node.prev,
487 struct uhci_qh, node);
488
489 /* If the new QH is also the last one, we must unlink
490 * the terminating skeleton QH and make the new QH point
491 * back to itself. */
492 if (qh == lqh) {
493 qh->link = link_to_new_qh;
494 extra_link = &uhci->skel_term_qh->link;
495
496 /* Otherwise the last QH must point to the new QH */
497 } else
498 extra_link = &lqh->link;
499 }
500 462
501 /* Link it into the schedule */ 463 /* Link it into the schedule */
464 qh->link = pqh->link;
502 wmb(); 465 wmb();
503 *extra_link = pqh->link = link_to_new_qh; 466 link_to_new_qh = LINK_TO_QH(qh);
467 pqh->link = link_to_new_qh;
468
469 /* If this is now the first FSBR QH, link the terminating skeleton
470 * QH to it. */
471 if (pqh->skel < SKEL_FSBR && qh->skel >= SKEL_FSBR)
472 uhci->skel_term_qh->link = link_to_new_qh;
504} 473}
505 474
506/* 475/*
@@ -561,31 +530,16 @@ static void unlink_interrupt(struct uhci_hcd *uhci, struct uhci_qh *qh)
561 */ 530 */
562static void unlink_async(struct uhci_hcd *uhci, struct uhci_qh *qh) 531static void unlink_async(struct uhci_hcd *uhci, struct uhci_qh *qh)
563{ 532{
564 struct uhci_qh *pqh, *lqh; 533 struct uhci_qh *pqh;
565 __le32 link_to_next_qh = qh->link; 534 __le32 link_to_next_qh = qh->link;
566 535
567 pqh = list_entry(qh->node.prev, struct uhci_qh, node); 536 pqh = list_entry(qh->node.prev, struct uhci_qh, node);
568
569 /* If this is the first FSBQ QH, take special action */
570 if (uhci->fsbr_is_on && pqh->skel < SKEL_FSBR &&
571 qh->skel >= SKEL_FSBR) {
572 lqh = list_entry(uhci->skel_async_qh->node.prev,
573 struct uhci_qh, node);
574
575 /* If this QH is also the last one, we must link in
576 * the terminating skeleton QH. */
577 if (qh == lqh) {
578 link_to_next_qh = LINK_TO_QH(uhci->skel_term_qh);
579 uhci->skel_term_qh->link = link_to_next_qh;
580 wmb();
581 qh->link = link_to_next_qh;
582
583 /* Otherwise the last QH must point to the new first FSBR QH */
584 } else
585 lqh->link = link_to_next_qh;
586 }
587
588 pqh->link = link_to_next_qh; 537 pqh->link = link_to_next_qh;
538
539 /* If this was the old first FSBR QH, link the terminating skeleton
540 * QH to the next (new first FSBR) QH. */
541 if (pqh->skel < SKEL_FSBR && qh->skel >= SKEL_FSBR)
542 uhci->skel_term_qh->link = link_to_next_qh;
589 mb(); 543 mb();
590} 544}
591 545
@@ -1217,7 +1171,7 @@ static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb)
1217 1171
1218 if (debug > 1 && errbuf) { 1172 if (debug > 1 && errbuf) {
1219 /* Print the chain for debugging */ 1173 /* Print the chain for debugging */
1220 uhci_show_qh(urbp->qh, errbuf, 1174 uhci_show_qh(uhci, urbp->qh, errbuf,
1221 ERRBUF_LEN, 0); 1175 ERRBUF_LEN, 0);
1222 lprintk(errbuf); 1176 lprintk(errbuf);
1223 } 1177 }
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index 7538c64a5097..39a498362594 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -18,7 +18,6 @@
18 18
19static struct usb_device_id id_table [] = { 19static struct usb_device_id id_table [] = {
20 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ 20 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
21 { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */
22 { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ 21 { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */
23 { }, 22 { },
24}; 23};
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 1633a0fd48e8..8ff9d54b21e6 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -879,6 +879,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
879 break; 879 break;
880 case FT232BM: /* FT232BM chip */ 880 case FT232BM: /* FT232BM chip */
881 case FT2232C: /* FT2232C chip */ 881 case FT2232C: /* FT2232C chip */
882 case FT232RL:
882 if (baud <= 3000000) { 883 if (baud <= 3000000) {
883 div_value = ftdi_232bm_baud_to_divisor(baud); 884 div_value = ftdi_232bm_baud_to_divisor(baud);
884 } else { 885 } else {
@@ -1021,9 +1022,12 @@ static void ftdi_determine_type(struct usb_serial_port *port)
1021 /* (It might be a BM because of the iSerialNumber bug, 1022 /* (It might be a BM because of the iSerialNumber bug,
1022 * but it will still work as an AM device.) */ 1023 * but it will still work as an AM device.) */
1023 priv->chip_type = FT8U232AM; 1024 priv->chip_type = FT8U232AM;
1024 } else { 1025 } else if (version < 0x600) {
1025 /* Assume its an FT232BM (or FT245BM) */ 1026 /* Assume its an FT232BM (or FT245BM) */
1026 priv->chip_type = FT232BM; 1027 priv->chip_type = FT232BM;
1028 } else {
1029 /* Assume its an FT232R */
1030 priv->chip_type = FT232RL;
1027 } 1031 }
1028 info("Detected %s", ftdi_chip_name[priv->chip_type]); 1032 info("Detected %s", ftdi_chip_name[priv->chip_type]);
1029} 1033}
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 53baeec8f265..4f8282ad7720 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -20,13 +20,14 @@
20#include <linux/usb/serial.h> 20#include <linux/usb/serial.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22 22
23static int generic_probe(struct usb_interface *interface,
24 const struct usb_device_id *id);
25
26 23
27static int debug; 24static int debug;
28 25
29#ifdef CONFIG_USB_SERIAL_GENERIC 26#ifdef CONFIG_USB_SERIAL_GENERIC
27
28static int generic_probe(struct usb_interface *interface,
29 const struct usb_device_id *id);
30
30static __u16 vendor = 0x05f9; 31static __u16 vendor = 0x05f9;
31static __u16 product = 0xffff; 32static __u16 product = 0xffff;
32 33
diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h
index 8ada4c5c5d70..6a82d39dc498 100644
--- a/fs/9p/v9fs_vfs.h
+++ b/fs/9p/v9fs_vfs.h
@@ -40,7 +40,6 @@
40extern struct file_system_type v9fs_fs_type; 40extern struct file_system_type v9fs_fs_type;
41extern const struct address_space_operations v9fs_addr_operations; 41extern const struct address_space_operations v9fs_addr_operations;
42extern const struct file_operations v9fs_file_operations; 42extern const struct file_operations v9fs_file_operations;
43extern const struct file_operations v9fs_cached_file_operations;
44extern const struct file_operations v9fs_dir_operations; 43extern const struct file_operations v9fs_dir_operations;
45extern struct dentry_operations v9fs_dentry_operations; 44extern struct dentry_operations v9fs_dentry_operations;
46extern struct dentry_operations v9fs_cached_dentry_operations; 45extern struct dentry_operations v9fs_cached_dentry_operations;
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 653dfa5b2531..c7b677253843 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -42,6 +42,8 @@
42#include "v9fs_vfs.h" 42#include "v9fs_vfs.h"
43#include "fid.h" 43#include "fid.h"
44 44
45static const struct file_operations v9fs_cached_file_operations;
46
45/** 47/**
46 * v9fs_file_open - open a file (or directory) 48 * v9fs_file_open - open a file (or directory)
47 * @inode: inode to be opened 49 * @inode: inode to be opened
@@ -245,7 +247,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
245 return total; 247 return total;
246} 248}
247 249
248const struct file_operations v9fs_cached_file_operations = { 250static const struct file_operations v9fs_cached_file_operations = {
249 .llseek = generic_file_llseek, 251 .llseek = generic_file_llseek,
250 .read = do_sync_read, 252 .read = do_sync_read,
251 .aio_read = generic_file_aio_read, 253 .aio_read = generic_file_aio_read,
diff --git a/fs/aio.c b/fs/aio.c
index 0b4ee0a5c83e..e4598d6d49dd 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -136,7 +136,6 @@ static int aio_setup_ring(struct kioctx *ctx)
136 0); 136 0);
137 if (IS_ERR((void *)info->mmap_base)) { 137 if (IS_ERR((void *)info->mmap_base)) {
138 up_write(&ctx->mm->mmap_sem); 138 up_write(&ctx->mm->mmap_sem);
139 printk("mmap err: %ld\n", -info->mmap_base);
140 info->mmap_size = 0; 139 info->mmap_size = 0;
141 aio_free_ring(ctx); 140 aio_free_ring(ctx);
142 return -EAGAIN; 141 return -EAGAIN;
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 6f677988c71d..7e4bb0af24d7 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -859,8 +859,8 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
859#define NFS3_ENTRY_BAGGAGE (2 + 1 + 2 + 1) 859#define NFS3_ENTRY_BAGGAGE (2 + 1 + 2 + 1)
860#define NFS3_ENTRYPLUS_BAGGAGE (1 + 21 + 1 + (NFS3_FHSIZE >> 2)) 860#define NFS3_ENTRYPLUS_BAGGAGE (1 + 21 + 1 + (NFS3_FHSIZE >> 2))
861static int 861static int
862encode_entry(struct readdir_cd *ccd, const char *name, 862encode_entry(struct readdir_cd *ccd, const char *name, int namlen,
863 int namlen, off_t offset, ino_t ino, unsigned int d_type, int plus) 863 loff_t offset, ino_t ino, unsigned int d_type, int plus)
864{ 864{
865 struct nfsd3_readdirres *cd = container_of(ccd, struct nfsd3_readdirres, 865 struct nfsd3_readdirres *cd = container_of(ccd, struct nfsd3_readdirres,
866 common); 866 common);
@@ -880,7 +880,7 @@ encode_entry(struct readdir_cd *ccd, const char *name,
880 *cd->offset1 = htonl(offset64 & 0xffffffff); 880 *cd->offset1 = htonl(offset64 & 0xffffffff);
881 cd->offset1 = NULL; 881 cd->offset1 = NULL;
882 } else { 882 } else {
883 xdr_encode_hyper(cd->offset, (u64) offset); 883 xdr_encode_hyper(cd->offset, offset64);
884 } 884 }
885 } 885 }
886 886
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 832673b14587..673a53c014a3 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -228,7 +228,7 @@ _posix_to_nfsv4_one(struct posix_acl *pacl, struct nfs4_acl *acl,
228 struct posix_acl_summary pas; 228 struct posix_acl_summary pas;
229 unsigned short deny; 229 unsigned short deny;
230 int eflag = ((flags & NFS4_ACL_TYPE_DEFAULT) ? 230 int eflag = ((flags & NFS4_ACL_TYPE_DEFAULT) ?
231 NFS4_INHERITANCE_FLAGS : 0); 231 NFS4_INHERITANCE_FLAGS | NFS4_ACE_INHERIT_ONLY_ACE : 0);
232 232
233 BUG_ON(pacl->a_count < 3); 233 BUG_ON(pacl->a_count < 3);
234 summarize_posix_acl(pacl, &pas); 234 summarize_posix_acl(pacl, &pas);
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 9e4067999209..af360705e551 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -750,9 +750,8 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
750 status = nfserr_clid_inuse; 750 status = nfserr_clid_inuse;
751 if (!cmp_creds(&conf->cl_cred, &rqstp->rq_cred) 751 if (!cmp_creds(&conf->cl_cred, &rqstp->rq_cred)
752 || conf->cl_addr != sin->sin_addr.s_addr) { 752 || conf->cl_addr != sin->sin_addr.s_addr) {
753 printk("NFSD: setclientid: string in use by client" 753 dprintk("NFSD: setclientid: string in use by client"
754 "(clientid %08x/%08x)\n", 754 "at %u.%u.%u.%u\n", NIPQUAD(conf->cl_addr));
755 conf->cl_clientid.cl_boot, conf->cl_clientid.cl_id);
756 goto out; 755 goto out;
757 } 756 }
758 } 757 }
@@ -3261,7 +3260,6 @@ __nfs4_state_shutdown(void)
3261 unhash_delegation(dp); 3260 unhash_delegation(dp);
3262 } 3261 }
3263 3262
3264 cancel_delayed_work(&laundromat_work);
3265 nfsd4_shutdown_recdir(); 3263 nfsd4_shutdown_recdir();
3266 nfs4_init = 0; 3264 nfs4_init = 0;
3267} 3265}
diff --git a/fs/proc/Makefile b/fs/proc/Makefile
index a6b3a8f878f0..bce38e3f06cb 100644
--- a/fs/proc/Makefile
+++ b/fs/proc/Makefile
@@ -8,8 +8,9 @@ proc-y := nommu.o task_nommu.o
8proc-$(CONFIG_MMU) := mmu.o task_mmu.o 8proc-$(CONFIG_MMU) := mmu.o task_mmu.o
9 9
10proc-y += inode.o root.o base.o generic.o array.o \ 10proc-y += inode.o root.o base.o generic.o array.o \
11 proc_tty.o proc_misc.o proc_sysctl.o 11 proc_tty.o proc_misc.o
12 12
13proc-$(CONFIG_PROC_SYSCTL) += proc_sysctl.o
13proc-$(CONFIG_PROC_KCORE) += kcore.o 14proc-$(CONFIG_PROC_KCORE) += kcore.o
14proc-$(CONFIG_PROC_VMCORE) += vmcore.o 15proc-$(CONFIG_PROC_VMCORE) += vmcore.o
15proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o 16proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o
diff --git a/fs/splice.c b/fs/splice.c
index 2fca6ebf4cc2..07f6556add0a 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -576,76 +576,21 @@ static int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
576 if (this_len + offset > PAGE_CACHE_SIZE) 576 if (this_len + offset > PAGE_CACHE_SIZE)
577 this_len = PAGE_CACHE_SIZE - offset; 577 this_len = PAGE_CACHE_SIZE - offset;
578 578
579 /*
580 * Reuse buf page, if SPLICE_F_MOVE is set and we are doing a full
581 * page.
582 */
583 if ((sd->flags & SPLICE_F_MOVE) && this_len == PAGE_CACHE_SIZE) {
584 /*
585 * If steal succeeds, buf->page is now pruned from the
586 * pagecache and we can reuse it. The page will also be
587 * locked on successful return.
588 */
589 if (buf->ops->steal(pipe, buf))
590 goto find_page;
591
592 page = buf->page;
593 if (add_to_page_cache(page, mapping, index, GFP_KERNEL)) {
594 unlock_page(page);
595 goto find_page;
596 }
597
598 page_cache_get(page);
599
600 if (!(buf->flags & PIPE_BUF_FLAG_LRU))
601 lru_cache_add(page);
602 } else {
603find_page: 579find_page:
604 page = find_lock_page(mapping, index); 580 page = find_lock_page(mapping, index);
605 if (!page) { 581 if (!page) {
606 ret = -ENOMEM; 582 ret = -ENOMEM;
607 page = page_cache_alloc_cold(mapping); 583 page = page_cache_alloc_cold(mapping);
608 if (unlikely(!page)) 584 if (unlikely(!page))
609 goto out_ret; 585 goto out_ret;
610
611 /*
612 * This will also lock the page
613 */
614 ret = add_to_page_cache_lru(page, mapping, index,
615 GFP_KERNEL);
616 if (unlikely(ret))
617 goto out;
618 }
619 586
620 /* 587 /*
621 * We get here with the page locked. If the page is also 588 * This will also lock the page
622 * uptodate, we don't need to do more. If it isn't, we
623 * may need to bring it in if we are not going to overwrite
624 * the full page.
625 */ 589 */
626 if (!PageUptodate(page)) { 590 ret = add_to_page_cache_lru(page, mapping, index,
627 if (this_len < PAGE_CACHE_SIZE) { 591 GFP_KERNEL);
628 ret = mapping->a_ops->readpage(file, page); 592 if (unlikely(ret))
629 if (unlikely(ret)) 593 goto out;
630 goto out;
631
632 lock_page(page);
633
634 if (!PageUptodate(page)) {
635 /*
636 * Page got invalidated, repeat.
637 */
638 if (!page->mapping) {
639 unlock_page(page);
640 page_cache_release(page);
641 goto find_page;
642 }
643 ret = -EIO;
644 goto out;
645 }
646 } else
647 SetPageUptodate(page);
648 }
649 } 594 }
650 595
651 ret = mapping->a_ops->prepare_write(file, page, offset, offset+this_len); 596 ret = mapping->a_ops->prepare_write(file, page, offset, offset+this_len);
@@ -706,9 +651,9 @@ out_ret:
706 * key here is the 'actor' worker passed in that actually moves the data 651 * key here is the 'actor' worker passed in that actually moves the data
707 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above. 652 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above.
708 */ 653 */
709static ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, 654ssize_t __splice_from_pipe(struct pipe_inode_info *pipe,
710 struct file *out, loff_t *ppos, size_t len, 655 struct file *out, loff_t *ppos, size_t len,
711 unsigned int flags, splice_actor *actor) 656 unsigned int flags, splice_actor *actor)
712{ 657{
713 int ret, do_wakeup, err; 658 int ret, do_wakeup, err;
714 struct splice_desc sd; 659 struct splice_desc sd;
@@ -802,6 +747,7 @@ static ssize_t __splice_from_pipe(struct pipe_inode_info *pipe,
802 747
803 return ret; 748 return ret;
804} 749}
750EXPORT_SYMBOL(__splice_from_pipe);
805 751
806ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out, 752ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,
807 loff_t *ppos, size_t len, unsigned int flags, 753 loff_t *ppos, size_t len, unsigned int flags,
diff --git a/include/asm-i386/termbits.h b/include/asm-i386/termbits.h
index 12baf1d6343f..2e6237693814 100644
--- a/include/asm-i386/termbits.h
+++ b/include/asm-i386/termbits.h
@@ -144,7 +144,7 @@ struct ktermios {
144#define B3000000 0010015 144#define B3000000 0010015
145#define B3500000 0010016 145#define B3500000 0010016
146#define B4000000 0010017 146#define B4000000 0010017
147#define CIBAUD 002003600000 /* input baud rate (not used) */ 147#define CIBAUD 002003600000
148#define CMSPAR 010000000000 /* mark or space (stick) parity */ 148#define CMSPAR 010000000000 /* mark or space (stick) parity */
149#define CRTSCTS 020000000000 /* flow control */ 149#define CRTSCTS 020000000000 /* flow control */
150 150
diff --git a/include/asm-s390/checksum.h b/include/asm-s390/checksum.h
index 0a3cd7ec8451..d5a8e7c1477c 100644
--- a/include/asm-s390/checksum.h
+++ b/include/asm-s390/checksum.h
@@ -121,50 +121,21 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
121 unsigned short len, unsigned short proto, 121 unsigned short len, unsigned short proto,
122 __wsum sum) 122 __wsum sum)
123{ 123{
124#ifndef __s390x__ 124 __u32 csum = (__force __u32)sum;
125 asm volatile( 125
126 " alr %0,%1\n" /* sum += saddr */ 126 csum += (__force __u32)saddr;
127 " brc 12,0f\n" 127 if (csum < (__force __u32)saddr)
128 " ahi %0,1\n" /* add carry */ 128 csum++;
129 "0:" 129
130 : "+&d" (sum) : "d" (saddr) : "cc"); 130 csum += (__force __u32)daddr;
131 asm volatile( 131 if (csum < (__force __u32)daddr)
132 " alr %0,%1\n" /* sum += daddr */ 132 csum++;
133 " brc 12,1f\n" 133
134 " ahi %0,1\n" /* add carry */ 134 csum += len + proto;
135 "1:" 135 if (csum < len + proto)
136 : "+&d" (sum) : "d" (daddr) : "cc"); 136 csum++;
137 asm volatile( 137
138 " alr %0,%1\n" /* sum += len + proto */ 138 return (__force __wsum)csum;
139 " brc 12,2f\n"
140 " ahi %0,1\n" /* add carry */
141 "2:"
142 : "+&d" (sum)
143 : "d" (len + proto)
144 : "cc");
145#else /* __s390x__ */
146 asm volatile(
147 " lgfr %0,%0\n"
148 " algr %0,%1\n" /* sum += saddr */
149 " brc 12,0f\n"
150 " aghi %0,1\n" /* add carry */
151 "0: algr %0,%2\n" /* sum += daddr */
152 " brc 12,1f\n"
153 " aghi %0,1\n" /* add carry */
154 "1: algfr %0,%3\n" /* sum += len + proto */
155 " brc 12,2f\n"
156 " aghi %0,1\n" /* add carry */
157 "2: srlg 0,%0,32\n"
158 " alr %0,0\n" /* fold to 32 bits */
159 " brc 12,3f\n"
160 " ahi %0,1\n" /* add carry */
161 "3: llgfr %0,%0"
162 : "+&d" (sum)
163 : "d" (saddr), "d" (daddr),
164 "d" (len + proto)
165 : "cc", "0");
166#endif /* __s390x__ */
167 return sum;
168} 139}
169 140
170/* 141/*
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index f0454516dd31..b16222b42821 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -15,6 +15,7 @@
15 PROVIDE (_unprotected_end = .); 15 PROVIDE (_unprotected_end = .);
16 16
17 . = ALIGN(4096); 17 . = ALIGN(4096);
18 .note : { *(note.*) }
18 __start___ex_table = .; 19 __start___ex_table = .;
19 __ex_table : { *(__ex_table) } 20 __ex_table : { *(__ex_table) }
20 __stop___ex_table = .; 21 __stop___ex_table = .;
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index aca66984aafd..3b6949b41745 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -15,8 +15,8 @@
15# define __acquire(x) __context__(x,1) 15# define __acquire(x) __context__(x,1)
16# define __release(x) __context__(x,-1) 16# define __release(x) __context__(x,-1)
17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) 17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
18extern void __chk_user_ptr(void __user *); 18extern void __chk_user_ptr(const void __user *);
19extern void __chk_io_ptr(void __iomem *); 19extern void __chk_io_ptr(const void __iomem *);
20#else 20#else
21# define __user 21# define __user
22# define __kernel 22# define __kernel
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 84cfa8bbdc36..d2a96cbf4f0e 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -31,12 +31,19 @@
31/* 31/*
32 * On x86-64 make the 64bit structure have the same alignment as the 32 * On x86-64 make the 64bit structure have the same alignment as the
33 * 32bit structure. This makes 32bit emulation easier. 33 * 32bit structure. This makes 32bit emulation easier.
34 *
35 * UML/x86_64 needs the same packing as x86_64 - UML + UML_X86 +
36 * 64_BIT adds up to UML/x86_64.
34 */ 37 */
35#ifdef __x86_64__ 38#ifdef __x86_64__
36#define EPOLL_PACKED __attribute__((packed)) 39#define EPOLL_PACKED __attribute__((packed))
37#else 40#else
41#if defined(CONFIG_UML) && defined(CONFIG_UML_X86) && defined(CONFIG_64BIT)
42#define EPOLL_PACKED __attribute__((packed))
43#else
38#define EPOLL_PACKED 44#define EPOLL_PACKED
39#endif 45#endif
46#endif
40 47
41struct epoll_event { 48struct epoll_event {
42 __u32 events; 49 __u32 events;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 34f2676b3c62..58564a199862 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -615,6 +615,7 @@ typedef struct ide_drive_s {
615 u8 init_speed; /* transfer rate set at boot */ 615 u8 init_speed; /* transfer rate set at boot */
616 u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ 616 u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */
617 u8 current_speed; /* current transfer rate set */ 617 u8 current_speed; /* current transfer rate set */
618 u8 desired_speed; /* desired transfer rate set */
618 u8 dn; /* now wide spread use */ 619 u8 dn; /* now wide spread use */
619 u8 wcache; /* status of write cache */ 620 u8 wcache; /* status of write cache */
620 u8 acoustic; /* acoustic management */ 621 u8 acoustic; /* acoustic management */
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 636094c29b16..6da6772c19ff 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -92,19 +92,16 @@ extern struct ipc_namespace init_ipc_ns;
92 92
93#ifdef CONFIG_SYSVIPC 93#ifdef CONFIG_SYSVIPC
94#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, 94#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
95extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
95#else 96#else
96#define INIT_IPC_NS(ns) 97#define INIT_IPC_NS(ns)
98static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk)
99{ return 0; }
97#endif 100#endif
98 101
99#ifdef CONFIG_IPC_NS 102#ifdef CONFIG_IPC_NS
100extern void free_ipc_ns(struct kref *kref); 103extern void free_ipc_ns(struct kref *kref);
101extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
102extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns); 104extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns);
103#else
104static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk)
105{
106 return 0;
107}
108#endif 105#endif
109 106
110static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) 107static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 2e19478e9e84..8bcbc54e1b48 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -99,4 +99,8 @@ extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
99 loff_t *, size_t, unsigned int, 99 loff_t *, size_t, unsigned int,
100 splice_actor *); 100 splice_actor *);
101 101
102extern ssize_t __splice_from_pipe(struct pipe_inode_info *, struct file *,
103 loff_t *, size_t, unsigned int,
104 splice_actor *);
105
102#endif 106#endif
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index a4555fe3754c..e10267d402c5 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -70,6 +70,8 @@ static inline int unshare_utsname(unsigned long unshare_flags,
70 70
71static inline int copy_utsname(int flags, struct task_struct *tsk) 71static inline int copy_utsname(int flags, struct task_struct *tsk)
72{ 72{
73 if (flags & CLONE_NEWUTS)
74 return -EINVAL;
73 return 0; 75 return 0;
74} 76}
75static inline void put_uts_ns(struct uts_namespace *ns) 77static inline void put_uts_ns(struct uts_namespace *ns)
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index 83fe2e3d1e25..50e33b0e9349 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -239,7 +239,8 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits);
239#define SAA7146_HPS_SYNC_PORT_B 0x01 239#define SAA7146_HPS_SYNC_PORT_B 0x01
240 240
241/* some memory sizes */ 241/* some memory sizes */
242#define SAA7146_CLIPPING_MEM (14*PAGE_SIZE) 242/* max. 16 clipping rectangles */
243#define SAA7146_CLIPPING_MEM (16 * 4 * sizeof(u32))
243 244
244/* some defines for the various clipping-modes */ 245/* some defines for the various clipping-modes */
245#define SAA7146_CLIPPING_RECT 0x4 246#define SAA7146_CLIPPING_RECT 0x4
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index bc3c26494c3d..d585ea9fa97d 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -34,6 +34,7 @@ struct fib_rules_ops
34 int family; 34 int family;
35 struct list_head list; 35 struct list_head list;
36 int rule_size; 36 int rule_size;
37 int addr_size;
37 38
38 int (*action)(struct fib_rule *, 39 int (*action)(struct fib_rule *,
39 struct flowi *, int, 40 struct flowi *, int,
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 9eda572a2a65..cf355a3c2ad5 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -58,6 +58,7 @@ struct fib6_node
58 __u16 fn_bit; /* bit key */ 58 __u16 fn_bit; /* bit key */
59 __u16 fn_flags; 59 __u16 fn_flags;
60 __u32 fn_sernum; 60 __u32 fn_sernum;
61 struct rt6_info *rr_ptr;
61}; 62};
62 63
63#ifndef CONFIG_IPV6_SUBTREES 64#ifndef CONFIG_IPV6_SUBTREES
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3725b93c52f3..ad7fe1121412 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -36,7 +36,7 @@ struct neigh_parms
36 struct net_device *dev; 36 struct net_device *dev;
37 struct neigh_parms *next; 37 struct neigh_parms *next;
38 int (*neigh_setup)(struct neighbour *); 38 int (*neigh_setup)(struct neighbour *);
39 void (*neigh_destructor)(struct neighbour *); 39 void (*neigh_cleanup)(struct neighbour *);
40 struct neigh_table *tbl; 40 struct neigh_table *tbl;
41 41
42 void *sysctl_table; 42 void *sysctl_table;
diff --git a/ipc/util.c b/ipc/util.c
index 08a647965b9e..0b652387d169 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -144,6 +144,13 @@ void free_ipc_ns(struct kref *kref)
144 shm_exit_ns(ns); 144 shm_exit_ns(ns);
145 kfree(ns); 145 kfree(ns);
146} 146}
147#else
148int copy_ipcs(unsigned long flags, struct task_struct *tsk)
149{
150 if (flags & CLONE_NEWIPC)
151 return -EINVAL;
152 return 0;
153}
147#endif 154#endif
148 155
149/** 156/**
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index dee0ff40befd..aec19b063e3f 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -58,7 +58,6 @@ static inline int platform_prepare(void)
58 58
59static void power_down(suspend_disk_method_t mode) 59static void power_down(suspend_disk_method_t mode)
60{ 60{
61 disable_nonboot_cpus();
62 switch(mode) { 61 switch(mode) {
63 case PM_DISK_PLATFORM: 62 case PM_DISK_PLATFORM:
64 if (pm_ops && pm_ops->enter) { 63 if (pm_ops && pm_ops->enter) {
diff --git a/kernel/power/user.c b/kernel/power/user.c
index bf211fee1222..7cf6713b2325 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -401,10 +401,9 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
401 401
402 case PMOPS_ENTER: 402 case PMOPS_ENTER:
403 if (data->platform_suspend) { 403 if (data->platform_suspend) {
404 disable_nonboot_cpus();
405 kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); 404 kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
406 error = pm_ops->enter(PM_SUSPEND_DISK); 405 error = pm_ops->enter(PM_SUSPEND_DISK);
407 enable_nonboot_cpus(); 406 error = 0;
408 } 407 }
409 break; 408 break;
410 409
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 67932ea78c17..76212b2a99de 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -274,72 +274,3 @@ void clockevents_notify(unsigned long reason, void *arg)
274} 274}
275EXPORT_SYMBOL_GPL(clockevents_notify); 275EXPORT_SYMBOL_GPL(clockevents_notify);
276 276
277#ifdef CONFIG_SYSFS
278
279/**
280 * clockevents_show_registered - sysfs interface for listing clockevents
281 * @dev: unused
282 * @buf: char buffer to be filled with clock events list
283 *
284 * Provides sysfs interface for listing registered clock event devices
285 */
286static ssize_t clockevents_show_registered(struct sys_device *dev, char *buf)
287{
288 struct list_head *tmp;
289 char *p = buf;
290 int cpu;
291
292 spin_lock(&clockevents_lock);
293
294 list_for_each(tmp, &clockevent_devices) {
295 struct clock_event_device *ce;
296
297 ce = list_entry(tmp, struct clock_event_device, list);
298 p += sprintf(p, "%-20s F:%04x M:%d", ce->name,
299 ce->features, ce->mode);
300 p += sprintf(p, " C:");
301 if (!cpus_equal(ce->cpumask, cpu_possible_map)) {
302 for_each_cpu_mask(cpu, ce->cpumask)
303 p += sprintf(p, " %d", cpu);
304 } else {
305 /*
306 * FIXME: Add the cpu which is handling this sucker
307 */
308 }
309 p += sprintf(p, "\n");
310 }
311
312 spin_unlock(&clockevents_lock);
313
314 return p - buf;
315}
316
317/*
318 * Sysfs setup bits:
319 */
320static SYSDEV_ATTR(registered, 0600,
321 clockevents_show_registered, NULL);
322
323static struct sysdev_class clockevents_sysclass = {
324 set_kset_name("clockevents"),
325};
326
327static struct sys_device clockevents_sys_device = {
328 .id = 0,
329 .cls = &clockevents_sysclass,
330};
331
332static int __init clockevents_sysfs_init(void)
333{
334 int error = sysdev_class_register(&clockevents_sysclass);
335
336 if (!error)
337 error = sysdev_register(&clockevents_sys_device);
338 if (!error)
339 error = sysdev_create_file(
340 &clockevents_sys_device,
341 &attr_registered);
342 return error;
343}
344device_initcall(clockevents_sysfs_init);
345#endif
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index eb12509e00bd..cb25649c6f50 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -32,7 +32,7 @@ static u64 tick_length, tick_length_base;
32/* TIME_ERROR prevents overwriting the CMOS clock */ 32/* TIME_ERROR prevents overwriting the CMOS clock */
33static int time_state = TIME_OK; /* clock synchronization status */ 33static int time_state = TIME_OK; /* clock synchronization status */
34int time_status = STA_UNSYNC; /* clock status bits */ 34int time_status = STA_UNSYNC; /* clock status bits */
35static long time_offset; /* time adjustment (ns) */ 35static s64 time_offset; /* time adjustment (ns) */
36static long time_constant = 2; /* pll time constant */ 36static long time_constant = 2; /* pll time constant */
37long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */ 37long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */
38long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ 38long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */
@@ -196,7 +196,7 @@ void __attribute__ ((weak)) notify_arch_cmos_timer(void)
196 */ 196 */
197int do_adjtimex(struct timex *txc) 197int do_adjtimex(struct timex *txc)
198{ 198{
199 long ltemp, mtemp, save_adjust; 199 long mtemp, save_adjust, rem;
200 s64 freq_adj, temp64; 200 s64 freq_adj, temp64;
201 int result; 201 int result;
202 202
@@ -277,14 +277,14 @@ int do_adjtimex(struct timex *txc)
277 time_adjust = txc->offset; 277 time_adjust = txc->offset;
278 } 278 }
279 else if (time_status & STA_PLL) { 279 else if (time_status & STA_PLL) {
280 ltemp = txc->offset * NSEC_PER_USEC; 280 time_offset = txc->offset * NSEC_PER_USEC;
281 281
282 /* 282 /*
283 * Scale the phase adjustment and 283 * Scale the phase adjustment and
284 * clamp to the operating range. 284 * clamp to the operating range.
285 */ 285 */
286 time_offset = min(ltemp, MAXPHASE * NSEC_PER_USEC); 286 time_offset = min(time_offset, (s64)MAXPHASE * NSEC_PER_USEC);
287 time_offset = max(time_offset, -MAXPHASE * NSEC_PER_USEC); 287 time_offset = max(time_offset, (s64)-MAXPHASE * NSEC_PER_USEC);
288 288
289 /* 289 /*
290 * Select whether the frequency is to be controlled 290 * Select whether the frequency is to be controlled
@@ -297,11 +297,11 @@ int do_adjtimex(struct timex *txc)
297 mtemp = xtime.tv_sec - time_reftime; 297 mtemp = xtime.tv_sec - time_reftime;
298 time_reftime = xtime.tv_sec; 298 time_reftime = xtime.tv_sec;
299 299
300 freq_adj = (s64)time_offset * mtemp; 300 freq_adj = time_offset * mtemp;
301 freq_adj = shift_right(freq_adj, time_constant * 2 + 301 freq_adj = shift_right(freq_adj, time_constant * 2 +
302 (SHIFT_PLL + 2) * 2 - SHIFT_NSEC); 302 (SHIFT_PLL + 2) * 2 - SHIFT_NSEC);
303 if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) { 303 if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) {
304 temp64 = (s64)time_offset << (SHIFT_NSEC - SHIFT_FLL); 304 temp64 = time_offset << (SHIFT_NSEC - SHIFT_FLL);
305 if (time_offset < 0) { 305 if (time_offset < 0) {
306 temp64 = -temp64; 306 temp64 = -temp64;
307 do_div(temp64, mtemp); 307 do_div(temp64, mtemp);
@@ -314,8 +314,10 @@ int do_adjtimex(struct timex *txc)
314 freq_adj += time_freq; 314 freq_adj += time_freq;
315 freq_adj = min(freq_adj, (s64)MAXFREQ_NSEC); 315 freq_adj = min(freq_adj, (s64)MAXFREQ_NSEC);
316 time_freq = max(freq_adj, (s64)-MAXFREQ_NSEC); 316 time_freq = max(freq_adj, (s64)-MAXFREQ_NSEC);
317 time_offset = (time_offset / NTP_INTERVAL_FREQ) 317 time_offset = div_long_long_rem_signed(time_offset,
318 << SHIFT_UPDATE; 318 NTP_INTERVAL_FREQ,
319 &rem);
320 time_offset <<= SHIFT_UPDATE;
319 } /* STA_PLL */ 321 } /* STA_PLL */
320 } /* txc->modes & ADJ_OFFSET */ 322 } /* txc->modes & ADJ_OFFSET */
321 if (txc->modes & ADJ_TICK) 323 if (txc->modes & ADJ_TICK)
@@ -328,12 +330,12 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0)
328 result = TIME_ERROR; 330 result = TIME_ERROR;
329 331
330 if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) 332 if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
331 txc->offset = save_adjust; 333 txc->offset = save_adjust;
332 else 334 else
333 txc->offset = shift_right(time_offset, SHIFT_UPDATE) 335 txc->offset = ((long)shift_right(time_offset, SHIFT_UPDATE)) *
334 * NTP_INTERVAL_FREQ / 1000; 336 NTP_INTERVAL_FREQ / 1000;
335 txc->freq = (time_freq / NSEC_PER_USEC) 337 txc->freq = (time_freq / NSEC_PER_USEC) <<
336 << (SHIFT_USEC - SHIFT_NSEC); 338 (SHIFT_USEC - SHIFT_NSEC);
337 txc->maxerror = time_maxerror; 339 txc->maxerror = time_maxerror;
338 txc->esterror = time_esterror; 340 txc->esterror = time_esterror;
339 txc->status = time_status; 341 txc->status = time_status;
diff --git a/mm/bounce.c b/mm/bounce.c
index 643efbe82402..ad401fc57440 100644
--- a/mm/bounce.c
+++ b/mm/bounce.c
@@ -204,7 +204,7 @@ static void __blk_queue_bounce(request_queue_t *q, struct bio **bio_orig,
204 /* 204 /*
205 * is destination page below bounce pfn? 205 * is destination page below bounce pfn?
206 */ 206 */
207 if (page_to_pfn(page) < q->bounce_pfn) 207 if (page_to_pfn(page) <= q->bounce_pfn)
208 continue; 208 continue;
209 209
210 /* 210 /*
diff --git a/net/atm/clip.c b/net/atm/clip.c
index ebb5d0ce8b6f..8c3825816085 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -261,14 +261,6 @@ static void clip_pop(struct atm_vcc *vcc, struct sk_buff *skb)
261 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock, flags); 261 spin_unlock_irqrestore(&PRIV(dev)->xoff_lock, flags);
262} 262}
263 263
264static void clip_neigh_destroy(struct neighbour *neigh)
265{
266 DPRINTK("clip_neigh_destroy (neigh %p)\n", neigh);
267 if (NEIGH2ENTRY(neigh)->vccs)
268 printk(KERN_CRIT "clip_neigh_destroy: vccs != NULL !!!\n");
269 NEIGH2ENTRY(neigh)->vccs = (void *) NEIGHBOR_DEAD;
270}
271
272static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb) 264static void clip_neigh_solicit(struct neighbour *neigh, struct sk_buff *skb)
273{ 265{
274 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb); 266 DPRINTK("clip_neigh_solicit (neigh %p, skb %p)\n", neigh, skb);
@@ -342,7 +334,6 @@ static struct neigh_table clip_tbl = {
342 /* parameters are copied from ARP ... */ 334 /* parameters are copied from ARP ... */
343 .parms = { 335 .parms = {
344 .tbl = &clip_tbl, 336 .tbl = &clip_tbl,
345 .neigh_destructor = clip_neigh_destroy,
346 .base_reachable_time = 30 * HZ, 337 .base_reachable_time = 30 * HZ,
347 .retrans_time = 1 * HZ, 338 .retrans_time = 1 * HZ,
348 .gc_staletime = 60 * HZ, 339 .gc_staletime = 60 * HZ,
diff --git a/net/ax25/Kconfig b/net/ax25/Kconfig
index a8993a041724..43dd86fca4d3 100644
--- a/net/ax25/Kconfig
+++ b/net/ax25/Kconfig
@@ -1,30 +1,27 @@
1# 1#
2# Amateur Radio protocols and AX.25 device configuration 2# Amateur Radio protocols and AX.25 device configuration
3# 3#
4# 19971130 Now in an own category to make correct compilation of the
5# AX.25 stuff easier...
6# Joerg Reuter DL1BKE <jreuter@yaina.de>
7# 19980129 Moved to net/ax25/Config.in, sourcing device drivers.
8 4
9menuconfig HAMRADIO 5menuconfig HAMRADIO
10 depends on NET 6 depends on NET
11 bool "Amateur Radio support" 7 bool "Amateur Radio support"
12 help 8 help
13 If you want to connect your Linux box to an amateur radio, answer Y 9 If you want to connect your Linux box to an amateur radio, answer Y
14 here. You want to read <http://www.tapr.org/tapr/html/pkthome.html> and 10 here. You want to read <http://www.tapr.org/tapr/html/pkthome.html>
15 the AX25-HOWTO, available from <http://www.tldp.org/docs.html#howto>. 11 and more specifically about AX.25 on Linux
12 <http://www.linux-ax25.org/>.
16 13
17 Note that the answer to this question won't directly affect the 14 Note that the answer to this question won't directly affect the
18 kernel: saying N will just cause the configurator to skip all 15 kernel: saying N will just cause the configurator to skip all
19 the questions about amateur radio. 16 the questions about amateur radio.
20 17
21comment "Packet Radio protocols" 18comment "Packet Radio protocols"
22 depends on HAMRADIO && NET 19 depends on HAMRADIO
23 20
24config AX25 21config AX25
25 tristate "Amateur Radio AX.25 Level 2 protocol" 22 tristate "Amateur Radio AX.25 Level 2 protocol"
26 depends on HAMRADIO && NET 23 depends on HAMRADIO
27 ---help--- 24 help
28 This is the protocol used for computer communication over amateur 25 This is the protocol used for computer communication over amateur
29 radio. It is either used by itself for point-to-point links, or to 26 radio. It is either used by itself for point-to-point links, or to
30 carry other protocols such as tcp/ip. To use it, you need a device 27 carry other protocols such as tcp/ip. To use it, you need a device
@@ -52,6 +49,7 @@ config AX25
52 49
53config AX25_DAMA_SLAVE 50config AX25_DAMA_SLAVE
54 bool "AX.25 DAMA Slave support" 51 bool "AX.25 DAMA Slave support"
52 default y
55 depends on AX25 53 depends on AX25
56 help 54 help
57 DAMA is a mechanism to prevent collisions when doing AX.25 55 DAMA is a mechanism to prevent collisions when doing AX.25
@@ -59,23 +57,38 @@ config AX25_DAMA_SLAVE
59 from clients (called "slaves") and redistributes it to other slaves. 57 from clients (called "slaves") and redistributes it to other slaves.
60 If you say Y here, your Linux box will act as a DAMA slave; this is 58 If you say Y here, your Linux box will act as a DAMA slave; this is
61 transparent in that you don't have to do any special DAMA 59 transparent in that you don't have to do any special DAMA
62 configuration. (Linux cannot yet act as a DAMA server.) If unsure, 60 configuration. Linux cannot yet act as a DAMA server. This option
63 say N. 61 only compiles DAMA slave support into the kernel. It still needs to
62 be enabled at runtime. For more about DAMA see
63 <http://www.linux-ax25.org>. If unsure, say Y.
64
65# placeholder until implemented
66config AX25_DAMA_MASTER
67 bool 'AX.25 DAMA Master support'
68 depends on AX25_DAMA_SLAVE && BROKEN
69 help
70 DAMA is a mechanism to prevent collisions when doing AX.25
71 networking. A DAMA server (called "master") accepts incoming traffic
72 from clients (called "slaves") and redistributes it to other slaves.
73 If you say Y here, your Linux box will act as a DAMA master; this is
74 transparent in that you don't have to do any special DAMA
75 configuration. Linux cannot yet act as a DAMA server. This option
76 only compiles DAMA slave support into the kernel. It still needs to
77 be explicitly enabled, so if unsure, say Y.
64 78
65# bool ' AX.25 DAMA Master support' CONFIG_AX25_DAMA_MASTER
66config NETROM 79config NETROM
67 tristate "Amateur Radio NET/ROM protocol" 80 tristate "Amateur Radio NET/ROM protocol"
68 depends on AX25 81 depends on AX25
69 ---help--- 82 help
70 NET/ROM is a network layer protocol on top of AX.25 useful for 83 NET/ROM is a network layer protocol on top of AX.25 useful for
71 routing. 84 routing.
72 85
73 A comprehensive listing of all the software for Linux amateur radio 86 A comprehensive listing of all the software for Linux amateur radio
74 users as well as information about how to configure an AX.25 port is 87 users as well as information about how to configure an AX.25 port is
75 contained in the AX25-HOWTO, available from 88 contained in the Linux Ham Wiki, available from
76 <http://www.tldp.org/docs.html#howto>. You also might want to 89 <http://www.linux-ax25.org>. You also might want to check out the
77 check out the file <file:Documentation/networking/ax25.txt>. More 90 file <file:Documentation/networking/ax25.txt>. More information about
78 information about digital amateur radio in general is on the WWW at 91 digital amateur radio in general is on the WWW at
79 <http://www.tapr.org/tapr/html/pkthome.html>. 92 <http://www.tapr.org/tapr/html/pkthome.html>.
80 93
81 To compile this driver as a module, choose M here: the 94 To compile this driver as a module, choose M here: the
@@ -84,27 +97,25 @@ config NETROM
84config ROSE 97config ROSE
85 tristate "Amateur Radio X.25 PLP (Rose)" 98 tristate "Amateur Radio X.25 PLP (Rose)"
86 depends on AX25 99 depends on AX25
87 ---help--- 100 help
88 The Packet Layer Protocol (PLP) is a way to route packets over X.25 101 The Packet Layer Protocol (PLP) is a way to route packets over X.25
89 connections in general and amateur radio AX.25 connections in 102 connections in general and amateur radio AX.25 connections in
90 particular, essentially an alternative to NET/ROM. 103 particular, essentially an alternative to NET/ROM.
91 104
92 A comprehensive listing of all the software for Linux amateur radio 105 A comprehensive listing of all the software for Linux amateur radio
93 users as well as information about how to configure an AX.25 port is 106 users as well as information about how to configure an AX.25 port is
94 contained in the AX25-HOWTO, available from 107 contained in the Linux Ham Wiki, available from
95 <http://www.tldp.org/docs.html#howto>. You also might want to 108 <http://www.linux-ax25.org>. You also might want to check out the
96 check out the file <file:Documentation/networking/ax25.txt>. More 109 file <file:Documentation/networking/ax25.txt>. More information about
97 information about digital amateur radio in general is on the WWW at 110 digital amateur radio in general is on the WWW at
98 <http://www.tapr.org/tapr/html/pkthome.html>. 111 <http://www.tapr.org/tapr/html/pkthome.html>.
99 112
100 To compile this driver as a module, choose M here: the 113 To compile this driver as a module, choose M here: the
101 module will be called rose. 114 module will be called rose.
102 115
103
104menu "AX.25 network device drivers" 116menu "AX.25 network device drivers"
105 depends on HAMRADIO && NET && AX25!=n 117 depends on HAMRADIO && AX25
106 118
107source "drivers/net/hamradio/Kconfig" 119source "drivers/net/hamradio/Kconfig"
108 120
109endmenu 121endmenu
110
diff --git a/net/core/dev.c b/net/core/dev.c
index cf71614dae93..5984b55311a1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1750,10 +1750,10 @@ static int ing_filter(struct sk_buff *skb)
1750 1750
1751 skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS); 1751 skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS);
1752 1752
1753 spin_lock(&dev->ingress_lock); 1753 spin_lock(&dev->queue_lock);
1754 if ((q = dev->qdisc_ingress) != NULL) 1754 if ((q = dev->qdisc_ingress) != NULL)
1755 result = q->enqueue(skb, q); 1755 result = q->enqueue(skb, q);
1756 spin_unlock(&dev->ingress_lock); 1756 spin_unlock(&dev->queue_lock);
1757 1757
1758 } 1758 }
1759 1759
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 3aea4e87d3d7..d011819a8058 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -152,6 +152,28 @@ out:
152 152
153EXPORT_SYMBOL_GPL(fib_rules_lookup); 153EXPORT_SYMBOL_GPL(fib_rules_lookup);
154 154
155static int validate_rulemsg(struct fib_rule_hdr *frh, struct nlattr **tb,
156 struct fib_rules_ops *ops)
157{
158 int err = -EINVAL;
159
160 if (frh->src_len)
161 if (tb[FRA_SRC] == NULL ||
162 frh->src_len > (ops->addr_size * 8) ||
163 nla_len(tb[FRA_SRC]) != ops->addr_size)
164 goto errout;
165
166 if (frh->dst_len)
167 if (tb[FRA_DST] == NULL ||
168 frh->dst_len > (ops->addr_size * 8) ||
169 nla_len(tb[FRA_DST]) != ops->addr_size)
170 goto errout;
171
172 err = 0;
173errout:
174 return err;
175}
176
155int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) 177int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
156{ 178{
157 struct fib_rule_hdr *frh = nlmsg_data(nlh); 179 struct fib_rule_hdr *frh = nlmsg_data(nlh);
@@ -173,6 +195,10 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
173 if (err < 0) 195 if (err < 0)
174 goto errout; 196 goto errout;
175 197
198 err = validate_rulemsg(frh, tb, ops);
199 if (err < 0)
200 goto errout;
201
176 rule = kzalloc(ops->rule_size, GFP_KERNEL); 202 rule = kzalloc(ops->rule_size, GFP_KERNEL);
177 if (rule == NULL) { 203 if (rule == NULL) {
178 err = -ENOMEM; 204 err = -ENOMEM;
@@ -260,6 +286,10 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
260 if (err < 0) 286 if (err < 0)
261 goto errout; 287 goto errout;
262 288
289 err = validate_rulemsg(frh, tb, ops);
290 if (err < 0)
291 goto errout;
292
263 list_for_each_entry(rule, ops->rules_list, list) { 293 list_for_each_entry(rule, ops->rules_list, list) {
264 if (frh->action && (frh->action != rule->action)) 294 if (frh->action && (frh->action != rule->action))
265 continue; 295 continue;
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 3183142c6044..cfc60019cf92 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -140,6 +140,8 @@ static int neigh_forced_gc(struct neigh_table *tbl)
140 n->dead = 1; 140 n->dead = 1;
141 shrunk = 1; 141 shrunk = 1;
142 write_unlock(&n->lock); 142 write_unlock(&n->lock);
143 if (n->parms->neigh_cleanup)
144 n->parms->neigh_cleanup(n);
143 neigh_release(n); 145 neigh_release(n);
144 continue; 146 continue;
145 } 147 }
@@ -211,6 +213,8 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct net_device *dev)
211 NEIGH_PRINTK2("neigh %p is stray.\n", n); 213 NEIGH_PRINTK2("neigh %p is stray.\n", n);
212 } 214 }
213 write_unlock(&n->lock); 215 write_unlock(&n->lock);
216 if (n->parms->neigh_cleanup)
217 n->parms->neigh_cleanup(n);
214 neigh_release(n); 218 neigh_release(n);
215 } 219 }
216 } 220 }
@@ -582,9 +586,6 @@ void neigh_destroy(struct neighbour *neigh)
582 kfree(hh); 586 kfree(hh);
583 } 587 }
584 588
585 if (neigh->parms->neigh_destructor)
586 (neigh->parms->neigh_destructor)(neigh);
587
588 skb_queue_purge(&neigh->arp_queue); 589 skb_queue_purge(&neigh->arp_queue);
589 590
590 dev_put(neigh->dev); 591 dev_put(neigh->dev);
@@ -675,6 +676,8 @@ static void neigh_periodic_timer(unsigned long arg)
675 *np = n->next; 676 *np = n->next;
676 n->dead = 1; 677 n->dead = 1;
677 write_unlock(&n->lock); 678 write_unlock(&n->lock);
679 if (n->parms->neigh_cleanup)
680 n->parms->neigh_cleanup(n);
678 neigh_release(n); 681 neigh_release(n);
679 continue; 682 continue;
680 } 683 }
@@ -2088,8 +2091,11 @@ void __neigh_for_each_release(struct neigh_table *tbl,
2088 } else 2091 } else
2089 np = &n->next; 2092 np = &n->next;
2090 write_unlock(&n->lock); 2093 write_unlock(&n->lock);
2091 if (release) 2094 if (release) {
2095 if (n->parms->neigh_cleanup)
2096 n->parms->neigh_cleanup(n);
2092 neigh_release(n); 2097 neigh_release(n);
2098 }
2093 } 2099 }
2094 } 2100 }
2095} 2101}
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index a0e7cd183a5d..e33a9edb4036 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -191,7 +191,6 @@ extern void dccp_send_sync(struct sock *sk, const u64 seq,
191 const enum dccp_pkt_type pkt_type); 191 const enum dccp_pkt_type pkt_type);
192 192
193extern void dccp_write_xmit(struct sock *sk, int block); 193extern void dccp_write_xmit(struct sock *sk, int block);
194extern void dccp_write_xmit_timer(unsigned long data);
195extern void dccp_write_space(struct sock *sk); 194extern void dccp_write_space(struct sock *sk);
196 195
197extern void dccp_init_xmit_timers(struct sock *sk); 196extern void dccp_init_xmit_timers(struct sock *sk);
diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index b038a0a3ad40..0197a41c256a 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -262,7 +262,7 @@ out:
262} 262}
263 263
264/* Transmit-delay timer: used by the CCIDs to delay actual send time */ 264/* Transmit-delay timer: used by the CCIDs to delay actual send time */
265void dccp_write_xmit_timer(unsigned long data) 265static void dccp_write_xmit_timer(unsigned long data)
266{ 266{
267 struct sock *sk = (struct sock *)data; 267 struct sock *sk = (struct sock *)data;
268 struct dccp_sock *dp = dccp_sk(sk); 268 struct dccp_sock *dp = dccp_sk(sk);
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 3cbfddc98430..82d58a977e6f 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -63,7 +63,7 @@ static struct
63{ 63{
64 int error; 64 int error;
65 u8 scope; 65 u8 scope;
66} dn_fib_props[RTA_MAX+1] = { 66} dn_fib_props[RTN_MAX+1] = {
67 [RTN_UNSPEC] = { .error = 0, .scope = RT_SCOPE_NOWHERE }, 67 [RTN_UNSPEC] = { .error = 0, .scope = RT_SCOPE_NOWHERE },
68 [RTN_UNICAST] = { .error = 0, .scope = RT_SCOPE_UNIVERSE }, 68 [RTN_UNICAST] = { .error = 0, .scope = RT_SCOPE_UNIVERSE },
69 [RTN_LOCAL] = { .error = 0, .scope = RT_SCOPE_HOST }, 69 [RTN_LOCAL] = { .error = 0, .scope = RT_SCOPE_HOST },
@@ -276,6 +276,9 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct dn_kern_rta
276 struct dn_fib_info *ofi; 276 struct dn_fib_info *ofi;
277 int nhs = 1; 277 int nhs = 1;
278 278
279 if (r->rtm_type > RTN_MAX)
280 goto err_inval;
281
279 if (dn_fib_props[r->rtm_type].scope > r->rtm_scope) 282 if (dn_fib_props[r->rtm_type].scope > r->rtm_scope)
280 goto err_inval; 283 goto err_inval;
281 284
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index b6c98ac93dc8..5e86dd542302 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -109,8 +109,6 @@ errout:
109 109
110static struct nla_policy dn_fib_rule_policy[FRA_MAX+1] __read_mostly = { 110static struct nla_policy dn_fib_rule_policy[FRA_MAX+1] __read_mostly = {
111 FRA_GENERIC_POLICY, 111 FRA_GENERIC_POLICY,
112 [FRA_SRC] = { .type = NLA_U16 },
113 [FRA_DST] = { .type = NLA_U16 },
114}; 112};
115 113
116static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) 114static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
@@ -133,7 +131,7 @@ static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
133 int err = -EINVAL; 131 int err = -EINVAL;
134 struct dn_fib_rule *r = (struct dn_fib_rule *)rule; 132 struct dn_fib_rule *r = (struct dn_fib_rule *)rule;
135 133
136 if (frh->src_len > 16 || frh->dst_len > 16 || frh->tos) 134 if (frh->tos)
137 goto errout; 135 goto errout;
138 136
139 if (rule->table == RT_TABLE_UNSPEC) { 137 if (rule->table == RT_TABLE_UNSPEC) {
@@ -150,10 +148,10 @@ static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
150 } 148 }
151 } 149 }
152 150
153 if (tb[FRA_SRC]) 151 if (frh->src_len)
154 r->src = nla_get_le16(tb[FRA_SRC]); 152 r->src = nla_get_le16(tb[FRA_SRC]);
155 153
156 if (tb[FRA_DST]) 154 if (frh->dst_len)
157 r->dst = nla_get_le16(tb[FRA_DST]); 155 r->dst = nla_get_le16(tb[FRA_DST]);
158 156
159 r->src_len = frh->src_len; 157 r->src_len = frh->src_len;
@@ -176,10 +174,10 @@ static int dn_fib_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
176 if (frh->dst_len && (r->dst_len != frh->dst_len)) 174 if (frh->dst_len && (r->dst_len != frh->dst_len))
177 return 0; 175 return 0;
178 176
179 if (tb[FRA_SRC] && (r->src != nla_get_le16(tb[FRA_SRC]))) 177 if (frh->src_len && (r->src != nla_get_le16(tb[FRA_SRC])))
180 return 0; 178 return 0;
181 179
182 if (tb[FRA_DST] && (r->dst != nla_get_le16(tb[FRA_DST]))) 180 if (frh->dst_len && (r->dst != nla_get_le16(tb[FRA_DST])))
183 return 0; 181 return 0;
184 182
185 return 1; 183 return 1;
@@ -249,6 +247,7 @@ int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)
249static struct fib_rules_ops dn_fib_rules_ops = { 247static struct fib_rules_ops dn_fib_rules_ops = {
250 .family = AF_DECnet, 248 .family = AF_DECnet,
251 .rule_size = sizeof(struct dn_fib_rule), 249 .rule_size = sizeof(struct dn_fib_rule),
250 .addr_size = sizeof(u16),
252 .action = dn_fib_rule_action, 251 .action = dn_fib_rule_action,
253 .match = dn_fib_rule_match, 252 .match = dn_fib_rule_match,
254 .configure = dn_fib_rule_configure, 253 .configure = dn_fib_rule_configure,
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 1fba6439fc57..fc920f63452b 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -493,6 +493,11 @@ static int rtm_to_fib_config(struct sk_buff *skb, struct nlmsghdr *nlh,
493 cfg->fc_nlinfo.pid = NETLINK_CB(skb).pid; 493 cfg->fc_nlinfo.pid = NETLINK_CB(skb).pid;
494 cfg->fc_nlinfo.nlh = nlh; 494 cfg->fc_nlinfo.nlh = nlh;
495 495
496 if (cfg->fc_type > RTN_MAX) {
497 err = -EINVAL;
498 goto errout;
499 }
500
496 nlmsg_for_each_attr(attr, nlh, sizeof(struct rtmsg), remaining) { 501 nlmsg_for_each_attr(attr, nlh, sizeof(struct rtmsg), remaining) {
497 switch (attr->nla_type) { 502 switch (attr->nla_type) {
498 case RTA_DST: 503 case RTA_DST:
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index b837c33e0404..c660c074c76c 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -171,8 +171,6 @@ static struct fib_table *fib_empty_table(void)
171 171
172static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = { 172static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = {
173 FRA_GENERIC_POLICY, 173 FRA_GENERIC_POLICY,
174 [FRA_SRC] = { .type = NLA_U32 },
175 [FRA_DST] = { .type = NLA_U32 },
176 [FRA_FLOW] = { .type = NLA_U32 }, 174 [FRA_FLOW] = { .type = NLA_U32 },
177}; 175};
178 176
@@ -183,8 +181,7 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
183 int err = -EINVAL; 181 int err = -EINVAL;
184 struct fib4_rule *rule4 = (struct fib4_rule *) rule; 182 struct fib4_rule *rule4 = (struct fib4_rule *) rule;
185 183
186 if (frh->src_len > 32 || frh->dst_len > 32 || 184 if (frh->tos & ~IPTOS_TOS_MASK)
187 (frh->tos & ~IPTOS_TOS_MASK))
188 goto errout; 185 goto errout;
189 186
190 if (rule->table == RT_TABLE_UNSPEC) { 187 if (rule->table == RT_TABLE_UNSPEC) {
@@ -201,10 +198,10 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
201 } 198 }
202 } 199 }
203 200
204 if (tb[FRA_SRC]) 201 if (frh->src_len)
205 rule4->src = nla_get_be32(tb[FRA_SRC]); 202 rule4->src = nla_get_be32(tb[FRA_SRC]);
206 203
207 if (tb[FRA_DST]) 204 if (frh->dst_len)
208 rule4->dst = nla_get_be32(tb[FRA_DST]); 205 rule4->dst = nla_get_be32(tb[FRA_DST]);
209 206
210#ifdef CONFIG_NET_CLS_ROUTE 207#ifdef CONFIG_NET_CLS_ROUTE
@@ -242,10 +239,10 @@ static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
242 return 0; 239 return 0;
243#endif 240#endif
244 241
245 if (tb[FRA_SRC] && (rule4->src != nla_get_be32(tb[FRA_SRC]))) 242 if (frh->src_len && (rule4->src != nla_get_be32(tb[FRA_SRC])))
246 return 0; 243 return 0;
247 244
248 if (tb[FRA_DST] && (rule4->dst != nla_get_be32(tb[FRA_DST]))) 245 if (frh->dst_len && (rule4->dst != nla_get_be32(tb[FRA_DST])))
249 return 0; 246 return 0;
250 247
251 return 1; 248 return 1;
@@ -309,6 +306,7 @@ static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)
309static struct fib_rules_ops fib4_rules_ops = { 306static struct fib_rules_ops fib4_rules_ops = {
310 .family = AF_INET, 307 .family = AF_INET,
311 .rule_size = sizeof(struct fib4_rule), 308 .rule_size = sizeof(struct fib4_rule),
309 .addr_size = sizeof(u32),
312 .action = fib4_rule_action, 310 .action = fib4_rule_action,
313 .match = fib4_rule_match, 311 .match = fib4_rule_match,
314 .configure = fib4_rule_configure, 312 .configure = fib4_rule_configure,
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 2f1fdae6efa6..3dad12ee76c3 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -89,7 +89,7 @@ static const struct
89{ 89{
90 int error; 90 int error;
91 u8 scope; 91 u8 scope;
92} fib_props[RTA_MAX + 1] = { 92} fib_props[RTN_MAX + 1] = {
93 { 93 {
94 .error = 0, 94 .error = 0,
95 .scope = RT_SCOPE_NOWHERE, 95 .scope = RT_SCOPE_NOWHERE,
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index ada9b3db507d..214c34732e84 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1123,6 +1123,9 @@ err:
1123 return fa_head; 1123 return fa_head;
1124} 1124}
1125 1125
1126/*
1127 * Caller must hold RTNL.
1128 */
1126static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg) 1129static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
1127{ 1130{
1128 struct trie *t = (struct trie *) tb->tb_data; 1131 struct trie *t = (struct trie *) tb->tb_data;
@@ -1540,6 +1543,9 @@ static int trie_leaf_remove(struct trie *t, t_key key)
1540 return 1; 1543 return 1;
1541} 1544}
1542 1545
1546/*
1547 * Caller must hold RTNL.
1548 */
1543static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg) 1549static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg)
1544{ 1550{
1545 struct trie *t = (struct trie *) tb->tb_data; 1551 struct trie *t = (struct trie *) tb->tb_data;
@@ -1718,6 +1724,9 @@ up:
1718 return NULL; /* Ready. Root of trie */ 1724 return NULL; /* Ready. Root of trie */
1719} 1725}
1720 1726
1727/*
1728 * Caller must hold RTNL.
1729 */
1721static int fn_trie_flush(struct fib_table *tb) 1730static int fn_trie_flush(struct fib_table *tb)
1722{ 1731{
1723 struct trie *t = (struct trie *) tb->tb_data; 1732 struct trie *t = (struct trie *) tb->tb_data;
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 0862809ffcf7..ea3035b4e3e8 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -131,8 +131,6 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
131 131
132static struct nla_policy fib6_rule_policy[FRA_MAX+1] __read_mostly = { 132static struct nla_policy fib6_rule_policy[FRA_MAX+1] __read_mostly = {
133 FRA_GENERIC_POLICY, 133 FRA_GENERIC_POLICY,
134 [FRA_SRC] = { .len = sizeof(struct in6_addr) },
135 [FRA_DST] = { .len = sizeof(struct in6_addr) },
136}; 134};
137 135
138static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, 136static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
@@ -142,9 +140,6 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
142 int err = -EINVAL; 140 int err = -EINVAL;
143 struct fib6_rule *rule6 = (struct fib6_rule *) rule; 141 struct fib6_rule *rule6 = (struct fib6_rule *) rule;
144 142
145 if (frh->src_len > 128 || frh->dst_len > 128)
146 goto errout;
147
148 if (rule->action == FR_ACT_TO_TBL) { 143 if (rule->action == FR_ACT_TO_TBL) {
149 if (rule->table == RT6_TABLE_UNSPEC) 144 if (rule->table == RT6_TABLE_UNSPEC)
150 goto errout; 145 goto errout;
@@ -155,11 +150,11 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
155 } 150 }
156 } 151 }
157 152
158 if (tb[FRA_SRC]) 153 if (frh->src_len)
159 nla_memcpy(&rule6->src.addr, tb[FRA_SRC], 154 nla_memcpy(&rule6->src.addr, tb[FRA_SRC],
160 sizeof(struct in6_addr)); 155 sizeof(struct in6_addr));
161 156
162 if (tb[FRA_DST]) 157 if (frh->dst_len)
163 nla_memcpy(&rule6->dst.addr, tb[FRA_DST], 158 nla_memcpy(&rule6->dst.addr, tb[FRA_DST],
164 sizeof(struct in6_addr)); 159 sizeof(struct in6_addr));
165 160
@@ -186,11 +181,11 @@ static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
186 if (frh->tos && (rule6->tclass != frh->tos)) 181 if (frh->tos && (rule6->tclass != frh->tos))
187 return 0; 182 return 0;
188 183
189 if (tb[FRA_SRC] && 184 if (frh->src_len &&
190 nla_memcmp(tb[FRA_SRC], &rule6->src.addr, sizeof(struct in6_addr))) 185 nla_memcmp(tb[FRA_SRC], &rule6->src.addr, sizeof(struct in6_addr)))
191 return 0; 186 return 0;
192 187
193 if (tb[FRA_DST] && 188 if (frh->dst_len &&
194 nla_memcmp(tb[FRA_DST], &rule6->dst.addr, sizeof(struct in6_addr))) 189 nla_memcmp(tb[FRA_DST], &rule6->dst.addr, sizeof(struct in6_addr)))
195 return 0; 190 return 0;
196 191
@@ -240,6 +235,7 @@ static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule)
240static struct fib_rules_ops fib6_rules_ops = { 235static struct fib_rules_ops fib6_rules_ops = {
241 .family = AF_INET6, 236 .family = AF_INET6,
242 .rule_size = sizeof(struct fib6_rule), 237 .rule_size = sizeof(struct fib6_rule),
238 .addr_size = sizeof(struct in6_addr),
243 .action = fib6_rule_action, 239 .action = fib6_rule_action,
244 .match = fib6_rule_match, 240 .match = fib6_rule_match,
245 .configure = fib6_rule_configure, 241 .configure = fib6_rule_configure,
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index f4d7be77eb0f..268f476ef3db 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -658,6 +658,10 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
658 ins = &iter->u.dst.rt6_next; 658 ins = &iter->u.dst.rt6_next;
659 } 659 }
660 660
661 /* Reset round-robin state, if necessary */
662 if (ins == &fn->leaf)
663 fn->rr_ptr = NULL;
664
661 /* 665 /*
662 * insert node 666 * insert node
663 */ 667 */
@@ -1109,6 +1113,10 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
1109 rt6_stats.fib_rt_entries--; 1113 rt6_stats.fib_rt_entries--;
1110 rt6_stats.fib_discarded_routes++; 1114 rt6_stats.fib_discarded_routes++;
1111 1115
1116 /* Reset round-robin state, if necessary */
1117 if (fn->rr_ptr == rt)
1118 fn->rr_ptr = NULL;
1119
1112 /* Adjust walkers */ 1120 /* Adjust walkers */
1113 read_lock(&fib6_walker_lock); 1121 read_lock(&fib6_walker_lock);
1114 FOR_WALKERS(w) { 1122 FOR_WALKERS(w) {
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index a6b3117df546..3931b33b25e8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -363,55 +363,76 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
363 return m; 363 return m;
364} 364}
365 365
366static struct rt6_info *rt6_select(struct rt6_info **head, int oif, 366static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
367 int strict) 367 int *mpri, struct rt6_info *match)
368{ 368{
369 struct rt6_info *match = NULL, *last = NULL; 369 int m;
370 struct rt6_info *rt, *rt0 = *head; 370
371 u32 metric; 371 if (rt6_check_expired(rt))
372 goto out;
373
374 m = rt6_score_route(rt, oif, strict);
375 if (m < 0)
376 goto out;
377
378 if (m > *mpri) {
379 if (strict & RT6_LOOKUP_F_REACHABLE)
380 rt6_probe(match);
381 *mpri = m;
382 match = rt;
383 } else if (strict & RT6_LOOKUP_F_REACHABLE) {
384 rt6_probe(rt);
385 }
386
387out:
388 return match;
389}
390
391static struct rt6_info *find_rr_leaf(struct fib6_node *fn,
392 struct rt6_info *rr_head,
393 u32 metric, int oif, int strict)
394{
395 struct rt6_info *rt, *match;
372 int mpri = -1; 396 int mpri = -1;
373 397
374 RT6_TRACE("%s(head=%p(*head=%p), oif=%d)\n", 398 match = NULL;
375 __FUNCTION__, head, head ? *head : NULL, oif); 399 for (rt = rr_head; rt && rt->rt6i_metric == metric;
400 rt = rt->u.dst.rt6_next)
401 match = find_match(rt, oif, strict, &mpri, match);
402 for (rt = fn->leaf; rt && rt != rr_head && rt->rt6i_metric == metric;
403 rt = rt->u.dst.rt6_next)
404 match = find_match(rt, oif, strict, &mpri, match);
376 405
377 for (rt = rt0, metric = rt0->rt6i_metric; 406 return match;
378 rt && rt->rt6i_metric == metric && (!last || rt != rt0); 407}
379 rt = rt->u.dst.rt6_next) {
380 int m;
381 408
382 if (rt6_check_expired(rt)) 409static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
383 continue; 410{
411 struct rt6_info *match, *rt0;
384 412
385 last = rt; 413 RT6_TRACE("%s(fn->leaf=%p, oif=%d)\n",
414 __FUNCTION__, fn->leaf, oif);
386 415
387 m = rt6_score_route(rt, oif, strict); 416 rt0 = fn->rr_ptr;
388 if (m < 0) 417 if (!rt0)
389 continue; 418 fn->rr_ptr = rt0 = fn->leaf;
390 419
391 if (m > mpri) { 420 match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict);
392 if (strict & RT6_LOOKUP_F_REACHABLE)
393 rt6_probe(match);
394 match = rt;
395 mpri = m;
396 } else if (strict & RT6_LOOKUP_F_REACHABLE) {
397 rt6_probe(rt);
398 }
399 }
400 421
401 if (!match && 422 if (!match &&
402 (strict & RT6_LOOKUP_F_REACHABLE) && 423 (strict & RT6_LOOKUP_F_REACHABLE)) {
403 last && last != rt0) { 424 struct rt6_info *next = rt0->u.dst.rt6_next;
425
404 /* no entries matched; do round-robin */ 426 /* no entries matched; do round-robin */
405 static DEFINE_SPINLOCK(lock); 427 if (!next || next->rt6i_metric != rt0->rt6i_metric)
406 spin_lock(&lock); 428 next = fn->leaf;
407 *head = rt0->u.dst.rt6_next; 429
408 rt0->u.dst.rt6_next = last->u.dst.rt6_next; 430 if (next != rt0)
409 last->u.dst.rt6_next = rt0; 431 fn->rr_ptr = next;
410 spin_unlock(&lock);
411 } 432 }
412 433
413 RT6_TRACE("%s() => %p, score=%d\n", 434 RT6_TRACE("%s() => %p\n",
414 __FUNCTION__, match, mpri); 435 __FUNCTION__, match);
415 436
416 return (match ? match : &ip6_null_entry); 437 return (match ? match : &ip6_null_entry);
417} 438}
@@ -657,7 +678,7 @@ restart_2:
657 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src); 678 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
658 679
659restart: 680restart:
660 rt = rt6_select(&fn->leaf, fl->iif, strict | reachable); 681 rt = rt6_select(fn, fl->iif, strict | reachable);
661 BACKTRACK(&fl->fl6_src); 682 BACKTRACK(&fl->fl6_src);
662 if (rt == &ip6_null_entry || 683 if (rt == &ip6_null_entry ||
663 rt->rt6i_flags & RTF_CACHE) 684 rt->rt6i_flags & RTF_CACHE)
@@ -752,7 +773,7 @@ restart_2:
752 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src); 773 fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
753 774
754restart: 775restart:
755 rt = rt6_select(&fn->leaf, fl->oif, strict | reachable); 776 rt = rt6_select(fn, fl->oif, strict | reachable);
756 BACKTRACK(&fl->fl6_src); 777 BACKTRACK(&fl->fl6_src);
757 if (rt == &ip6_null_entry || 778 if (rt == &ip6_null_entry ||
758 rt->rt6i_flags & RTF_CACHE) 779 rt->rt6i_flags & RTF_CACHE)
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index fad08e521c24..70fe36eb66a2 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -81,6 +81,13 @@ static void basic_put(struct tcf_proto *tp, unsigned long f)
81 81
82static int basic_init(struct tcf_proto *tp) 82static int basic_init(struct tcf_proto *tp)
83{ 83{
84 struct basic_head *head;
85
86 head = kzalloc(sizeof(*head), GFP_KERNEL);
87 if (head == NULL)
88 return -ENOBUFS;
89 INIT_LIST_HEAD(&head->flist);
90 tp->root = head;
84 return 0; 91 return 0;
85} 92}
86 93
@@ -176,15 +183,6 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
176 } 183 }
177 184
178 err = -ENOBUFS; 185 err = -ENOBUFS;
179 if (head == NULL) {
180 head = kzalloc(sizeof(*head), GFP_KERNEL);
181 if (head == NULL)
182 goto errout;
183
184 INIT_LIST_HEAD(&head->flist);
185 tp->root = head;
186 }
187
188 f = kzalloc(sizeof(*f), GFP_KERNEL); 186 f = kzalloc(sizeof(*f), GFP_KERNEL);
189 if (f == NULL) 187 if (f == NULL)
190 goto errout; 188 goto errout;
diff --git a/net/socket.c b/net/socket.c
index 9566e57ac7f5..ea8f81abc45c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1381,7 +1381,7 @@ asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr,
1381 1381
1382 err = sock_attach_fd(newsock, newfile); 1382 err = sock_attach_fd(newsock, newfile);
1383 if (err < 0) 1383 if (err < 0)
1384 goto out_fd; 1384 goto out_fd_simple;
1385 1385
1386 err = security_socket_accept(sock, newsock); 1386 err = security_socket_accept(sock, newsock);
1387 if (err) 1387 if (err)
@@ -1414,6 +1414,11 @@ out_put:
1414 fput_light(sock->file, fput_needed); 1414 fput_light(sock->file, fput_needed);
1415out: 1415out:
1416 return err; 1416 return err;
1417out_fd_simple:
1418 sock_release(newsock);
1419 put_filp(newfile);
1420 put_unused_fd(newfd);
1421 goto out_put;
1417out_fd: 1422out_fd:
1418 fput(newfile); 1423 fput(newfile);
1419 put_unused_fd(newfd); 1424 put_unused_fd(newfd);