aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/i2c/busses/i2c-piix42
-rw-r--r--MAINTAINERS41
-rw-r--r--arch/i386/mm/hugetlbpage.c2
-rw-r--r--arch/ia64/mm/hugetlbpage.c6
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/setup.c2
-rw-r--r--arch/sparc64/kernel/irq.c27
-rw-r--r--arch/sparc64/kernel/pci.c1
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c18
-rw-r--r--arch/sparc64/mm/hugetlbpage.c2
-rw-r--r--arch/um/kernel/dyn.lds.S12
-rw-r--r--arch/um/kernel/uml.lds.S11
-rw-r--r--arch/um/os-Linux/sys-x86_64/registers.c15
-rw-r--r--arch/um/sys-x86_64/ptrace.c6
-rw-r--r--arch/x86_64/defconfig1
-rw-r--r--drivers/i2c/busses/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-piix4.c6
-rw-r--r--drivers/net/bnx2.c10
-rw-r--r--drivers/serial/8250_pci.c2
-rw-r--r--drivers/spi/atmel_spi.c2
-rw-r--r--drivers/spi/spi_bfin5xx.c3
-rw-r--r--drivers/spi/spi_imx.c2
-rw-r--r--drivers/spi/spi_mpc83xx.c1
-rw-r--r--drivers/spi/spi_s3c24xx.c1
-rw-r--r--drivers/spi/spi_s3c24xx_gpio.c2
-rw-r--r--drivers/spi/spi_txx9.c2
-rw-r--r--drivers/spi/xilinx_spi.c2
-rw-r--r--drivers/video/console/Kconfig2
-rw-r--r--fs/ecryptfs/inode.c4
-rw-r--r--fs/ecryptfs/mmap.c3
-rw-r--r--fs/hugetlbfs/inode.c15
-rw-r--r--fs/udf/balloc.c10
-rw-r--r--fs/udf/super.c26
-rw-r--r--include/asm-sparc64/device.h2
-rw-r--r--include/asm-sparc64/irq.h25
-rw-r--r--include/asm-um/common.lds.S124
-rw-r--r--include/asm-um/elf-x86_64.h40
-rw-r--r--include/linux/cpu.h6
-rw-r--r--include/linux/hugetlb.h10
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/slub_def.h8
-rw-r--r--include/net/sctp/sm.h2
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/net/sctp/ulpqueue.h1
-rw-r--r--kernel/cpu.c4
-rw-r--r--kernel/exit.c2
-rw-r--r--kernel/irq/manage.c11
-rw-r--r--kernel/power/Kconfig41
-rw-r--r--kernel/signal.c19
-rw-r--r--kernel/sys.c3
-rw-r--r--kernel/user_namespace.c1
-rw-r--r--mm/mempolicy.c5
-rw-r--r--mm/migrate.c11
-rw-r--r--mm/page_alloc.c2
-rw-r--r--mm/slub.c8
-rw-r--r--net/bridge/br_fdb.c5
-rw-r--r--net/bridge/br_if.c16
-rw-r--r--net/bridge/br_input.c3
-rw-r--r--net/core/pktgen.c8
-rw-r--r--net/ipv4/tcp_input.c14
-rw-r--r--net/netfilter/xt_tcpudp.c2
-rw-r--r--net/sched/sch_prio.c2
-rw-r--r--net/sctp/associola.c7
-rw-r--r--net/sctp/outqueue.c7
-rw-r--r--net/sctp/sm_make_chunk.c112
-rw-r--r--net/sctp/sm_sideeffect.c8
-rw-r--r--net/sctp/sm_statefuns.c51
-rw-r--r--net/sctp/socket.c3
-rw-r--r--net/sctp/ulpqueue.c75
69 files changed, 583 insertions, 301 deletions
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4
index fa0c786a8bf5..cf6b6cb02aa1 100644
--- a/Documentation/i2c/busses/i2c-piix4
+++ b/Documentation/i2c/busses/i2c-piix4
@@ -6,7 +6,7 @@ Supported adapters:
6 Datasheet: Publicly available at the Intel website 6 Datasheet: Publicly available at the Intel website
7 * ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges 7 * ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges
8 Datasheet: Only available via NDA from ServerWorks 8 Datasheet: Only available via NDA from ServerWorks
9 * ATI IXP200, IXP300, IXP400, SB600 and SB700 southbridges 9 * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
10 Datasheet: Not publicly available 10 Datasheet: Not publicly available
11 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge 11 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
12 Datasheet: Publicly available at the SMSC website http://www.smsc.com 12 Datasheet: Publicly available at the SMSC website http://www.smsc.com
diff --git a/MAINTAINERS b/MAINTAINERS
index 48ca8b47150d..9c54a5ef0ba7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -44,9 +44,10 @@ trivial patch so apply some common sense.
44 or does something very odd once a month document it. 44 or does something very odd once a month document it.
45 45
46 PLEASE remember that submissions must be made under the terms 46 PLEASE remember that submissions must be made under the terms
47 of the OSDL certificate of contribution 47 of the OSDL certificate of contribution and should include a
48 (http://www.osdl.org/newsroom/press_releases/2004/2004_05_24_dco.html) 48 Signed-off-by: line. The current version of this "Developer's
49 and should include a Signed-off-by: line. 49 Certificate of Origin" (DCO) is listed in the file
50 Documentation/SubmittingPatches.
50 51
516. Make sure you have the right to send any changes you make. If you 526. Make sure you have the right to send any changes you make. If you
52 do changes at work you may find your employer owns the patch 53 do changes at work you may find your employer owns the patch
@@ -2057,12 +2058,18 @@ L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
2057W: http://ipw2200.sourceforge.net 2058W: http://ipw2200.sourceforge.net
2058S: Supported 2059S: Supported
2059 2060
2060IOC3 DRIVER 2061IOC3 ETHERNET DRIVER
2061P: Ralf Baechle 2062P: Ralf Baechle
2062M: ralf@linux-mips.org 2063M: ralf@linux-mips.org
2063L: linux-mips@linux-mips.org 2064L: linux-mips@linux-mips.org
2064S: Maintained 2065S: Maintained
2065 2066
2067IOC3 SERIAL DRIVER
2068P: Pat Gefre
2069M: pfg@sgi.com
2070L: linux-kernel@linux-mips.org
2071S: Maintained
2072
2066IP MASQUERADING: 2073IP MASQUERADING:
2067P: Juanjo Ciarlante 2074P: Juanjo Ciarlante
2068M: jjciarla@raiz.uncu.edu.ar 2075M: jjciarla@raiz.uncu.edu.ar
@@ -2594,6 +2601,19 @@ M: shemminger@linux-foundation.org
2594L: netem@lists.linux-foundation.org 2601L: netem@lists.linux-foundation.org
2595S: Maintained 2602S: Maintained
2596 2603
2604NETERION (S2IO) Xframe 10GbE DRIVER
2605P: Ramkrishna Vepa
2606M: ram.vepa@neterion.com
2607P: Rastapur Santosh
2608M: santosh.rastapur@neterion.com
2609P: Sivakumar Subramani
2610M: sivakumar.subramani@neterion.com
2611P: Sreenivasa Honnur
2612M: sreenivasa.honnur@neterion.com
2613L: netdev@vger.kernel.org
2614W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/TitleIndex?anonymous
2615S: Supported
2616
2597NETFILTER/IPTABLES/IPCHAINS 2617NETFILTER/IPTABLES/IPCHAINS
2598P: Rusty Russell 2618P: Rusty Russell
2599P: Marc Boucher 2619P: Marc Boucher
@@ -2734,19 +2754,6 @@ M: adaplas@gmail.com
2734L: linux-fbdev-devel@lists.sourceforge.net (subscribers-only) 2754L: linux-fbdev-devel@lists.sourceforge.net (subscribers-only)
2735S: Maintained 2755S: Maintained
2736 2756
2737NETERION (S2IO) Xframe 10GbE DRIVER
2738P: Ramkrishna Vepa
2739M: ram.vepa@neterion.com
2740P: Rastapur Santosh
2741M: santosh.rastapur@neterion.com
2742P: Sivakumar Subramani
2743M: sivakumar.subramani@neterion.com
2744P: Sreenivasa Honnur
2745M: sreenivasa.honnur@neterion.com
2746L: netdev@vger.kernel.org
2747W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/TitleIndex?anonymous
2748S: Supported
2749
2750OPENCORES I2C BUS DRIVER 2757OPENCORES I2C BUS DRIVER
2751P: Peter Korsgaard 2758P: Peter Korsgaard
2752M: jacmet@sunsite.dk 2759M: jacmet@sunsite.dk
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index efdf95ac8031..6c06d9c0488e 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -367,7 +367,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
367 return -ENOMEM; 367 return -ENOMEM;
368 368
369 if (flags & MAP_FIXED) { 369 if (flags & MAP_FIXED) {
370 if (prepare_hugepage_range(addr, len, pgoff)) 370 if (prepare_hugepage_range(addr, len))
371 return -EINVAL; 371 return -EINVAL;
372 return addr; 372 return addr;
373 } 373 }
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index d22861c5b04c..a9ff685aea25 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -75,10 +75,8 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
75 * Don't actually need to do any preparation, but need to make sure 75 * Don't actually need to do any preparation, but need to make sure
76 * the address is in the right region. 76 * the address is in the right region.
77 */ 77 */
78int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff) 78int prepare_hugepage_range(unsigned long addr, unsigned long len)
79{ 79{
80 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
81 return -EINVAL;
82 if (len & ~HPAGE_MASK) 80 if (len & ~HPAGE_MASK)
83 return -EINVAL; 81 return -EINVAL;
84 if (addr & ~HPAGE_MASK) 82 if (addr & ~HPAGE_MASK)
@@ -151,7 +149,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u
151 149
152 /* Handle MAP_FIXED */ 150 /* Handle MAP_FIXED */
153 if (flags & MAP_FIXED) { 151 if (flags & MAP_FIXED) {
154 if (prepare_hugepage_range(addr, len, pgoff)) 152 if (prepare_hugepage_range(addr, len))
155 return -EINVAL; 153 return -EINVAL;
156 return addr; 154 return addr;
157 } 155 }
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index 84ebff711e6e..f236b1ff8923 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -1108,7 +1108,7 @@ static void __init txx9_spi_init(unsigned long base, int irq)
1108 .flags = IORESOURCE_IRQ, 1108 .flags = IORESOURCE_IRQ,
1109 }, 1109 },
1110 }; 1110 };
1111 platform_device_register_simple("txx9spi", 0, 1111 platform_device_register_simple("spi_txx9", 0,
1112 res, ARRAY_SIZE(res)); 1112 res, ARRAY_SIZE(res));
1113} 1113}
1114 1114
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 384abf410cf0..23956096b3bf 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -217,8 +217,27 @@ struct irq_handler_data {
217 void (*pre_handler)(unsigned int, void *, void *); 217 void (*pre_handler)(unsigned int, void *, void *);
218 void *pre_handler_arg1; 218 void *pre_handler_arg1;
219 void *pre_handler_arg2; 219 void *pre_handler_arg2;
220
221 u32 msi;
220}; 222};
221 223
224void sparc64_set_msi(unsigned int virt_irq, u32 msi)
225{
226 struct irq_handler_data *data = get_irq_chip_data(virt_irq);
227
228 if (data)
229 data->msi = msi;
230}
231
232u32 sparc64_get_msi(unsigned int virt_irq)
233{
234 struct irq_handler_data *data = get_irq_chip_data(virt_irq);
235
236 if (data)
237 return data->msi;
238 return 0xffffffff;
239}
240
222static inline struct ino_bucket *virt_irq_to_bucket(unsigned int virt_irq) 241static inline struct ino_bucket *virt_irq_to_bucket(unsigned int virt_irq)
223{ 242{
224 unsigned int real_irq = virt_to_real_irq(virt_irq); 243 unsigned int real_irq = virt_to_real_irq(virt_irq);
@@ -308,7 +327,7 @@ static void sun4u_irq_disable(unsigned int virt_irq)
308 327
309 if (likely(data)) { 328 if (likely(data)) {
310 unsigned long imap = data->imap; 329 unsigned long imap = data->imap;
311 u32 tmp = upa_readq(imap); 330 unsigned long tmp = upa_readq(imap);
312 331
313 tmp &= ~IMAP_VALID; 332 tmp &= ~IMAP_VALID;
314 upa_writeq(tmp, imap); 333 upa_writeq(tmp, imap);
@@ -741,7 +760,7 @@ unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p,
741 break; 760 break;
742 } 761 }
743 if (devino >= msi_end) 762 if (devino >= msi_end)
744 return 0; 763 return -ENOSPC;
745 764
746 sysino = sun4v_devino_to_sysino(devhandle, devino); 765 sysino = sun4v_devino_to_sysino(devhandle, devino);
747 bucket = &ivector_table[sysino]; 766 bucket = &ivector_table[sysino];
@@ -755,8 +774,8 @@ unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p,
755 774
756 data = kzalloc(sizeof(struct irq_handler_data), GFP_ATOMIC); 775 data = kzalloc(sizeof(struct irq_handler_data), GFP_ATOMIC);
757 if (unlikely(!data)) { 776 if (unlikely(!data)) {
758 prom_printf("IRQ: kzalloc(irq_handler_data) failed.\n"); 777 virt_irq_free(*virt_irq_p);
759 prom_halt(); 778 return -ENOMEM;
760 } 779 }
761 set_irq_chip_data(bucket->virt_irq, data); 780 set_irq_chip_data(bucket->virt_irq, data);
762 781
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 3d93e9203ba2..139b4cff8019 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -393,7 +393,6 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
393 sd->host_controller = pbm; 393 sd->host_controller = pbm;
394 sd->prom_node = node; 394 sd->prom_node = node;
395 sd->op = of_find_device_by_node(node); 395 sd->op = of_find_device_by_node(node);
396 sd->msi_num = 0xffffffff;
397 396
398 sd = &sd->op->dev.archdata; 397 sd = &sd->op->dev.archdata;
399 sd->iommu = pbm->iommu; 398 sd->iommu = pbm->iommu;
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 466f4aa8fc82..da724b13e89e 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -940,13 +940,13 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p,
940 if (msi_num < 0) 940 if (msi_num < 0)
941 return msi_num; 941 return msi_num;
942 942
943 devino = sun4v_build_msi(pbm->devhandle, virt_irq_p, 943 err = sun4v_build_msi(pbm->devhandle, virt_irq_p,
944 pbm->msiq_first_devino, 944 pbm->msiq_first_devino,
945 (pbm->msiq_first_devino + 945 (pbm->msiq_first_devino +
946 pbm->msiq_num)); 946 pbm->msiq_num));
947 err = -ENOMEM; 947 if (err < 0)
948 if (!devino)
949 goto out_err; 948 goto out_err;
949 devino = err;
950 950
951 msiqid = ((devino - pbm->msiq_first_devino) + 951 msiqid = ((devino - pbm->msiq_first_devino) +
952 pbm->msiq_first); 952 pbm->msiq_first);
@@ -971,7 +971,7 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p,
971 if (pci_sun4v_msi_setvalid(pbm->devhandle, msi_num, HV_MSIVALID_VALID)) 971 if (pci_sun4v_msi_setvalid(pbm->devhandle, msi_num, HV_MSIVALID_VALID))
972 goto out_err; 972 goto out_err;
973 973
974 pdev->dev.archdata.msi_num = msi_num; 974 sparc64_set_msi(*virt_irq_p, msi_num);
975 975
976 if (entry->msi_attrib.is_64) { 976 if (entry->msi_attrib.is_64) {
977 msg.address_hi = pbm->msi64_start >> 32; 977 msg.address_hi = pbm->msi64_start >> 32;
@@ -993,8 +993,6 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p,
993 993
994out_err: 994out_err:
995 free_msi(pbm, msi_num); 995 free_msi(pbm, msi_num);
996 sun4v_destroy_msi(*virt_irq_p);
997 *virt_irq_p = 0;
998 return err; 996 return err;
999 997
1000} 998}
@@ -1006,7 +1004,7 @@ static void pci_sun4v_teardown_msi_irq(unsigned int virt_irq,
1006 unsigned long msiqid, err; 1004 unsigned long msiqid, err;
1007 unsigned int msi_num; 1005 unsigned int msi_num;
1008 1006
1009 msi_num = pdev->dev.archdata.msi_num; 1007 msi_num = sparc64_get_msi(virt_irq);
1010 err = pci_sun4v_msi_getmsiq(pbm->devhandle, msi_num, &msiqid); 1008 err = pci_sun4v_msi_getmsiq(pbm->devhandle, msi_num, &msiqid);
1011 if (err) { 1009 if (err) {
1012 printk(KERN_ERR "%s: getmsiq gives error %lu\n", 1010 printk(KERN_ERR "%s: getmsiq gives error %lu\n",
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
index eaba9b70b184..6cfab2e4d340 100644
--- a/arch/sparc64/mm/hugetlbpage.c
+++ b/arch/sparc64/mm/hugetlbpage.c
@@ -175,7 +175,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
175 return -ENOMEM; 175 return -ENOMEM;
176 176
177 if (flags & MAP_FIXED) { 177 if (flags & MAP_FIXED) {
178 if (prepare_hugepage_range(addr, len, pgoff)) 178 if (prepare_hugepage_range(addr, len))
179 return -EINVAL; 179 return -EINVAL;
180 return addr; 180 return addr;
181 } 181 }
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 24547741b205..41850906116e 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -71,11 +71,13 @@ SECTIONS
71 *(.gnu.warning) 71 *(.gnu.warning)
72 72
73 . = ALIGN(4096); 73 . = ALIGN(4096);
74 __syscall_stub_start = .;
75 *(.__syscall_stub*)
76 __syscall_stub_end = .;
77 . = ALIGN(4096);
78 } =0x90909090 74 } =0x90909090
75 . = ALIGN(4096);
76 .syscall_stub : {
77 __syscall_stub_start = .;
78 *(.__syscall_stub*)
79 __syscall_stub_end = .;
80 }
79 .fini : { 81 .fini : {
80 KEEP (*(.fini)) 82 KEEP (*(.fini))
81 } =0x90909090 83 } =0x90909090
@@ -138,8 +140,8 @@ SECTIONS
138 .got : { *(.got.plt) *(.got) } 140 .got : { *(.got.plt) *(.got) }
139 _edata = .; 141 _edata = .;
140 PROVIDE (edata = .); 142 PROVIDE (edata = .);
141 __bss_start = .;
142 .bss : { 143 .bss : {
144 __bss_start = .;
143 *(.dynbss) 145 *(.dynbss)
144 *(.bss .bss.* .gnu.linkonce.b.*) 146 *(.bss .bss.* .gnu.linkonce.b.*)
145 *(COMMON) 147 *(COMMON)
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 307b9373676b..81acdc24348e 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -44,12 +44,13 @@ SECTIONS
44 /* .gnu.warning sections are handled specially by elf32.em. */ 44 /* .gnu.warning sections are handled specially by elf32.em. */
45 *(.gnu.warning) 45 *(.gnu.warning)
46 *(.gnu.linkonce.t*) 46 *(.gnu.linkonce.t*)
47 }
47 48
48 . = ALIGN(4096); 49 . = ALIGN(4096);
49 __syscall_stub_start = .; 50 .syscall_stub : {
50 *(.__syscall_stub*) 51 __syscall_stub_start = .;
51 __syscall_stub_end = .; 52 *(.__syscall_stub*)
52 . = ALIGN(4096); 53 __syscall_stub_end = .;
53 } 54 }
54 55
55 #include "asm/common.lds.S" 56 #include "asm/common.lds.S"
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c
index e6fc2179d1bc..9467315b8059 100644
--- a/arch/um/os-Linux/sys-x86_64/registers.c
+++ b/arch/um/os-Linux/sys-x86_64/registers.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <errno.h> 6#include <errno.h>
7#include <sys/ptrace.h>
7#include <string.h> 8#include <string.h>
8#include "ptrace_user.h" 9#include "ptrace_user.h"
9#include "uml-config.h" 10#include "uml-config.h"
@@ -17,6 +18,20 @@
17static unsigned long exec_regs[MAX_REG_NR]; 18static unsigned long exec_regs[MAX_REG_NR];
18static unsigned long exec_fp_regs[HOST_FP_SIZE]; 19static unsigned long exec_fp_regs[HOST_FP_SIZE];
19 20
21int save_fp_registers(int pid, unsigned long *fp_regs)
22{
23 if(ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0)
24 return -errno;
25 return 0;
26}
27
28int restore_fp_registers(int pid, unsigned long *fp_regs)
29{
30 if(ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0)
31 return -errno;
32 return 0;
33}
34
20void init_thread_registers(union uml_pt_regs *to) 35void init_thread_registers(union uml_pt_regs *to)
21{ 36{
22 memcpy(to->skas.regs, exec_regs, sizeof(to->skas.regs)); 37 memcpy(to->skas.regs, exec_regs, sizeof(to->skas.regs));
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c
index 55b66e09a98c..1970d78aa528 100644
--- a/arch/um/sys-x86_64/ptrace.c
+++ b/arch/um/sys-x86_64/ptrace.c
@@ -156,12 +156,6 @@ int is_syscall(unsigned long addr)
156 return(instr == 0x050f); 156 return(instr == 0x050f);
157} 157}
158 158
159int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu )
160{
161 panic("dump_fpu");
162 return(1);
163}
164
165int get_fpregs(unsigned long buf, struct task_struct *child) 159int get_fpregs(unsigned long buf, struct task_struct *child)
166{ 160{
167 panic("get_fpregs"); 161 panic("get_fpregs");
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index e64f65c9d901..b091c5e35558 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -201,7 +201,6 @@ CONFIG_PM=y
201# CONFIG_PM_DEBUG is not set 201# CONFIG_PM_DEBUG is not set
202CONFIG_HIBERNATION=y 202CONFIG_HIBERNATION=y
203CONFIG_PM_STD_PARTITION="" 203CONFIG_PM_STD_PARTITION=""
204CONFIG_SUSPEND_SMP=y
205 204
206# 205#
207# ACPI (Advanced Configuration and Power Interface) Support 206# ACPI (Advanced Configuration and Power Interface) Support
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 1842f523c23d..9f3a4cd0b07f 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -208,6 +208,7 @@ config I2C_PIIX4
208 ATI IXP400 208 ATI IXP400
209 ATI SB600 209 ATI SB600
210 ATI SB700 210 ATI SB700
211 ATI SB800
211 Serverworks OSB4 212 Serverworks OSB4
212 Serverworks CSB5 213 Serverworks CSB5
213 Serverworks CSB6 214 Serverworks CSB6
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index debc76cd2161..167e4137ee21 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -23,7 +23,7 @@
23 Supports: 23 Supports:
24 Intel PIIX4, 440MX 24 Intel PIIX4, 440MX
25 Serverworks OSB4, CSB5, CSB6, HT-1000 25 Serverworks OSB4, CSB5, CSB6, HT-1000
26 ATI IXP200, IXP300, IXP400, SB600, SB700 26 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800
27 SMSC Victory66 27 SMSC Victory66
28 28
29 Note: we assume there can only be one device, with one SMBus interface. 29 Note: we assume there can only be one device, with one SMBus interface.
@@ -397,9 +397,7 @@ static struct pci_device_id piix4_ids[] = {
397 .driver_data = 0 }, 397 .driver_data = 0 },
398 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS), 398 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS),
399 .driver_data = 0 }, 399 .driver_data = 0 },
400 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SMBUS), 400 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS),
401 .driver_data = 0 },
402 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SMBUS),
403 .driver_data = 0 }, 401 .driver_data = 0 },
404 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4), 402 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4),
405 .driver_data = 0 }, 403 .driver_data = 0 },
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 24e7f9ab3f5a..854d80c330ec 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3934,11 +3934,13 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code)
3934 /* Chip reset. */ 3934 /* Chip reset. */
3935 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val); 3935 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
3936 3936
3937 /* Reading back any register after chip reset will hang the
3938 * bus on 5706 A0 and A1. The msleep below provides plenty
3939 * of margin for write posting.
3940 */
3937 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) || 3941 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||
3938 (CHIP_ID(bp) == CHIP_ID_5706_A1)) { 3942 (CHIP_ID(bp) == CHIP_ID_5706_A1))
3939 current->state = TASK_UNINTERRUPTIBLE; 3943 msleep(20);
3940 schedule_timeout(HZ / 50);
3941 }
3942 3944
3943 /* Reset takes approximate 30 usec */ 3945 /* Reset takes approximate 30 usec */
3944 for (i = 0; i < 10; i++) { 3946 for (i = 0; i < 10; i++) {
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index bd66339f7a3f..1ea1ed82c352 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -610,7 +610,7 @@ static int pci_netmos_init(struct pci_dev *dev)
610/* enable IO_Space bit */ 610/* enable IO_Space bit */
611#define ITE_887x_POSIO_ENABLE (1 << 31) 611#define ITE_887x_POSIO_ENABLE (1 << 31)
612 612
613static int __devinit pci_ite887x_init(struct pci_dev *dev) 613static int pci_ite887x_init(struct pci_dev *dev)
614{ 614{
615 /* inta_addr are the configuration addresses of the ITE */ 615 /* inta_addr are the configuration addresses of the ITE */
616 static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0, 616 static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index ad144054da30..b0469749310a 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -251,7 +251,7 @@ atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer)
251 xfer->rx_dma = dma_map_single(dev, 251 xfer->rx_dma = dma_map_single(dev,
252 xfer->rx_buf, xfer->len, 252 xfer->rx_buf, xfer->len,
253 DMA_FROM_DEVICE); 253 DMA_FROM_DEVICE);
254 if (dma_mapping_error(xfer->tx_dma)) { 254 if (dma_mapping_error(xfer->rx_dma)) {
255 if (xfer->tx_buf) 255 if (xfer->tx_buf)
256 dma_unmap_single(dev, 256 dma_unmap_single(dev,
257 xfer->tx_dma, xfer->len, 257 xfer->tx_dma, xfer->len,
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index 48587c27050d..f540ed77a102 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -1303,8 +1303,9 @@ static int bfin5xx_spi_resume(struct platform_device *pdev)
1303#define bfin5xx_spi_resume NULL 1303#define bfin5xx_spi_resume NULL
1304#endif /* CONFIG_PM */ 1304#endif /* CONFIG_PM */
1305 1305
1306MODULE_ALIAS("bfin-spi-master"); /* for platform bus hotplug */
1306static struct platform_driver bfin5xx_spi_driver = { 1307static struct platform_driver bfin5xx_spi_driver = {
1307 .driver = { 1308 .driver = {
1308 .name = "bfin-spi-master", 1309 .name = "bfin-spi-master",
1309 .owner = THIS_MODULE, 1310 .owner = THIS_MODULE,
1310 }, 1311 },
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index aee9ad6f633c..bd9177f51de9 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -1735,7 +1735,7 @@ static int spi_imx_resume(struct platform_device *pdev)
1735 1735
1736static struct platform_driver driver = { 1736static struct platform_driver driver = {
1737 .driver = { 1737 .driver = {
1738 .name = "imx-spi", 1738 .name = "spi_imx",
1739 .bus = &platform_bus_type, 1739 .bus = &platform_bus_type,
1740 .owner = THIS_MODULE, 1740 .owner = THIS_MODULE,
1741 }, 1741 },
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 2adf856e44c2..fcbf1b8a5264 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -530,6 +530,7 @@ static int __devexit mpc83xx_spi_remove(struct platform_device *dev)
530 return 0; 530 return 0;
531} 531}
532 532
533MODULE_ALIAS("mpc83xx_spi"); /* for platform bus hotplug */
533static struct platform_driver mpc83xx_spi_driver = { 534static struct platform_driver mpc83xx_spi_driver = {
534 .probe = mpc83xx_spi_probe, 535 .probe = mpc83xx_spi_probe,
535 .remove = __devexit_p(mpc83xx_spi_remove), 536 .remove = __devexit_p(mpc83xx_spi_remove),
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 5cf48123e0ef..e9b683f7d7b3 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -427,6 +427,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
427#define s3c24xx_spi_resume NULL 427#define s3c24xx_spi_resume NULL
428#endif 428#endif
429 429
430MODULE_ALIAS("s3c2410_spi"); /* for platform bus hotplug */
430static struct platform_driver s3c24xx_spidrv = { 431static struct platform_driver s3c24xx_spidrv = {
431 .probe = s3c24xx_spi_probe, 432 .probe = s3c24xx_spi_probe,
432 .remove = s3c24xx_spi_remove, 433 .remove = s3c24xx_spi_remove,
diff --git a/drivers/spi/spi_s3c24xx_gpio.c b/drivers/spi/spi_s3c24xx_gpio.c
index 611ac22b7cdc..0fa25e2e80fe 100644
--- a/drivers/spi/spi_s3c24xx_gpio.c
+++ b/drivers/spi/spi_s3c24xx_gpio.c
@@ -180,7 +180,7 @@ static struct platform_driver s3c2410_spigpio_drv = {
180 .suspend = s3c2410_spigpio_suspend, 180 .suspend = s3c2410_spigpio_suspend,
181 .resume = s3c2410_spigpio_resume, 181 .resume = s3c2410_spigpio_resume,
182 .driver = { 182 .driver = {
183 .name = "s3c24xx-spi-gpio", 183 .name = "spi_s3c24xx_gpio",
184 .owner = THIS_MODULE, 184 .owner = THIS_MODULE,
185 }, 185 },
186}; 186};
diff --git a/drivers/spi/spi_txx9.c b/drivers/spi/spi_txx9.c
index 08e981c40646..b7f4bb239eaf 100644
--- a/drivers/spi/spi_txx9.c
+++ b/drivers/spi/spi_txx9.c
@@ -453,7 +453,7 @@ static int __exit txx9spi_remove(struct platform_device *dev)
453static struct platform_driver txx9spi_driver = { 453static struct platform_driver txx9spi_driver = {
454 .remove = __exit_p(txx9spi_remove), 454 .remove = __exit_p(txx9spi_remove),
455 .driver = { 455 .driver = {
456 .name = "txx9spi", 456 .name = "spi_txx9",
457 .owner = THIS_MODULE, 457 .owner = THIS_MODULE,
458 }, 458 },
459}; 459};
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index f0bf9a68e96b..5d04f520c123 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -21,7 +21,7 @@
21 21
22#include <syslib/virtex_devices.h> 22#include <syslib/virtex_devices.h>
23 23
24#define XILINX_SPI_NAME "xspi" 24#define XILINX_SPI_NAME "xilinx_spi"
25 25
26/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) 26/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
27 * Product Specification", DS464 27 * Product Specification", DS464
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 5db6b1e489b0..a22ccf9485a4 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -182,7 +182,7 @@ config FONT_8x8
182 182
183config FONT_8x16 183config FONT_8x16
184 bool "VGA 8x16 font" if FONTS 184 bool "VGA 8x16 font" if FONTS
185 depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y || STI_CONSOLE || USB_SISUSBVGA_CON 185 depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON
186 default y if !SPARC && !FONTS 186 default y if !SPARC && !FONTS
187 help 187 help
188 This is the "high resolution" font for the VGA frame buffer (the one 188 This is the "high resolution" font for the VGA frame buffer (the one
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 5d40ad13ab5c..131954b3fb98 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -357,10 +357,6 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
357 ecryptfs_printk(KERN_DEBUG, "Is a special file; returning\n"); 357 ecryptfs_printk(KERN_DEBUG, "Is a special file; returning\n");
358 goto out; 358 goto out;
359 } 359 }
360 if (special_file(lower_inode->i_mode)) {
361 ecryptfs_printk(KERN_DEBUG, "Is a special file; returning\n");
362 goto out;
363 }
364 if (!nd) { 360 if (!nd) {
365 ecryptfs_printk(KERN_DEBUG, "We have a NULL nd, just leave" 361 ecryptfs_printk(KERN_DEBUG, "We have a NULL nd, just leave"
366 "as we *think* we are about to unlink\n"); 362 "as we *think* we are about to unlink\n");
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index e4ab7bc14efe..fd3f94d4a668 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -834,7 +834,8 @@ static void ecryptfs_sync_page(struct page *page)
834 ecryptfs_printk(KERN_DEBUG, "find_lock_page failed\n"); 834 ecryptfs_printk(KERN_DEBUG, "find_lock_page failed\n");
835 return; 835 return;
836 } 836 }
837 lower_page->mapping->a_ops->sync_page(lower_page); 837 if (lower_page->mapping->a_ops->sync_page)
838 lower_page->mapping->a_ops->sync_page(lower_page);
838 ecryptfs_printk(KERN_DEBUG, "Unlocking page with index = [0x%.16x]\n", 839 ecryptfs_printk(KERN_DEBUG, "Unlocking page with index = [0x%.16x]\n",
839 lower_page->index); 840 lower_page->index);
840 unlock_page(lower_page); 841 unlock_page(lower_page);
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index c848a191525d..950c2fbb815b 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -82,14 +82,19 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
82 int ret; 82 int ret;
83 83
84 /* 84 /*
85 * vma alignment has already been checked by prepare_hugepage_range. 85 * vma address alignment (but not the pgoff alignment) has
86 * If you add any error returns here, do so after setting VM_HUGETLB, 86 * already been checked by prepare_hugepage_range. If you add
87 * so is_vm_hugetlb_page tests below unmap_region go the right way 87 * any error returns here, do so after setting VM_HUGETLB, so
88 * when do_mmap_pgoff unwinds (may be important on powerpc and ia64). 88 * is_vm_hugetlb_page tests below unmap_region go the right
89 * way when do_mmap_pgoff unwinds (may be important on powerpc
90 * and ia64).
89 */ 91 */
90 vma->vm_flags |= VM_HUGETLB | VM_RESERVED; 92 vma->vm_flags |= VM_HUGETLB | VM_RESERVED;
91 vma->vm_ops = &hugetlb_vm_ops; 93 vma->vm_ops = &hugetlb_vm_ops;
92 94
95 if (vma->vm_pgoff & ~(HPAGE_MASK >> PAGE_SHIFT))
96 return -EINVAL;
97
93 vma_len = (loff_t)(vma->vm_end - vma->vm_start); 98 vma_len = (loff_t)(vma->vm_end - vma->vm_start);
94 99
95 mutex_lock(&inode->i_mutex); 100 mutex_lock(&inode->i_mutex);
@@ -132,7 +137,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
132 return -ENOMEM; 137 return -ENOMEM;
133 138
134 if (flags & MAP_FIXED) { 139 if (flags & MAP_FIXED) {
135 if (prepare_hugepage_range(addr, len, pgoff)) 140 if (prepare_hugepage_range(addr, len))
136 return -EINVAL; 141 return -EINVAL;
137 return addr; 142 return addr;
138 } 143 }
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index 276f7207a564..87e87dcd3f9c 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -540,26 +540,24 @@ static void udf_table_free_blocks(struct super_block *sb,
540 if (epos.offset + adsize > sb->s_blocksize) { 540 if (epos.offset + adsize > sb->s_blocksize) {
541 loffset = epos.offset; 541 loffset = epos.offset;
542 aed->lengthAllocDescs = cpu_to_le32(adsize); 542 aed->lengthAllocDescs = cpu_to_le32(adsize);
543 sptr = UDF_I_DATA(inode) + epos.offset - 543 sptr = UDF_I_DATA(table) + epos.offset - adsize;
544 udf_file_entry_alloc_offset(inode) +
545 UDF_I_LENEATTR(inode) - adsize;
546 dptr = epos.bh->b_data + sizeof(struct allocExtDesc); 544 dptr = epos.bh->b_data + sizeof(struct allocExtDesc);
547 memcpy(dptr, sptr, adsize); 545 memcpy(dptr, sptr, adsize);
548 epos.offset = sizeof(struct allocExtDesc) + adsize; 546 epos.offset = sizeof(struct allocExtDesc) + adsize;
549 } else { 547 } else {
550 loffset = epos.offset + adsize; 548 loffset = epos.offset + adsize;
551 aed->lengthAllocDescs = cpu_to_le32(0); 549 aed->lengthAllocDescs = cpu_to_le32(0);
552 sptr = oepos.bh->b_data + epos.offset;
553 epos.offset = sizeof(struct allocExtDesc);
554
555 if (oepos.bh) { 550 if (oepos.bh) {
551 sptr = oepos.bh->b_data + epos.offset;
556 aed = (struct allocExtDesc *)oepos.bh->b_data; 552 aed = (struct allocExtDesc *)oepos.bh->b_data;
557 aed->lengthAllocDescs = 553 aed->lengthAllocDescs =
558 cpu_to_le32(le32_to_cpu(aed->lengthAllocDescs) + adsize); 554 cpu_to_le32(le32_to_cpu(aed->lengthAllocDescs) + adsize);
559 } else { 555 } else {
556 sptr = UDF_I_DATA(table) + epos.offset;
560 UDF_I_LENALLOC(table) += adsize; 557 UDF_I_LENALLOC(table) += adsize;
561 mark_inode_dirty(table); 558 mark_inode_dirty(table);
562 } 559 }
560 epos.offset = sizeof(struct allocExtDesc);
563 } 561 }
564 if (UDF_SB_UDFREV(sb) >= 0x0200) 562 if (UDF_SB_UDFREV(sb) >= 0x0200)
565 udf_new_tag(epos.bh->b_data, TAG_IDENT_AED, 3, 1, 563 udf_new_tag(epos.bh->b_data, TAG_IDENT_AED, 3, 1,
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 382be7be5ae3..c68a6e730b97 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -89,7 +89,7 @@ static int udf_find_fileset(struct super_block *, kernel_lb_addr *,
89static void udf_load_pvoldesc(struct super_block *, struct buffer_head *); 89static void udf_load_pvoldesc(struct super_block *, struct buffer_head *);
90static void udf_load_fileset(struct super_block *, struct buffer_head *, 90static void udf_load_fileset(struct super_block *, struct buffer_head *,
91 kernel_lb_addr *); 91 kernel_lb_addr *);
92static void udf_load_partdesc(struct super_block *, struct buffer_head *); 92static int udf_load_partdesc(struct super_block *, struct buffer_head *);
93static void udf_open_lvid(struct super_block *); 93static void udf_open_lvid(struct super_block *);
94static void udf_close_lvid(struct super_block *); 94static void udf_close_lvid(struct super_block *);
95static unsigned int udf_count_free(struct super_block *); 95static unsigned int udf_count_free(struct super_block *);
@@ -877,7 +877,7 @@ static void udf_load_fileset(struct super_block *sb, struct buffer_head *bh,
877 root->logicalBlockNum, root->partitionReferenceNum); 877 root->logicalBlockNum, root->partitionReferenceNum);
878} 878}
879 879
880static void udf_load_partdesc(struct super_block *sb, struct buffer_head *bh) 880static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
881{ 881{
882 struct partitionDesc *p; 882 struct partitionDesc *p;
883 int i; 883 int i;
@@ -912,6 +912,11 @@ static void udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
912 912
913 UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table = 913 UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table =
914 udf_iget(sb, loc); 914 udf_iget(sb, loc);
915 if (!UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table) {
916 udf_debug("cannot load unallocSpaceTable (part %d)\n",
917 i);
918 return 1;
919 }
915 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_UNALLOC_TABLE; 920 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_UNALLOC_TABLE;
916 udf_debug("unallocSpaceTable (part %d) @ %ld\n", 921 udf_debug("unallocSpaceTable (part %d) @ %ld\n",
917 i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table->i_ino); 922 i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table->i_ino);
@@ -938,6 +943,11 @@ static void udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
938 943
939 UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table = 944 UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table =
940 udf_iget(sb, loc); 945 udf_iget(sb, loc);
946 if (!UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table) {
947 udf_debug("cannot load freedSpaceTable (part %d)\n",
948 i);
949 return 1;
950 }
941 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_FREED_TABLE; 951 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_FREED_TABLE;
942 udf_debug("freedSpaceTable (part %d) @ %ld\n", 952 udf_debug("freedSpaceTable (part %d) @ %ld\n",
943 i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table->i_ino); 953 i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table->i_ino);
@@ -966,6 +976,7 @@ static void udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
966 le16_to_cpu(p->partitionNumber), i, UDF_SB_PARTTYPE(sb,i), 976 le16_to_cpu(p->partitionNumber), i, UDF_SB_PARTTYPE(sb,i),
967 UDF_SB_PARTROOT(sb,i), UDF_SB_PARTLEN(sb,i)); 977 UDF_SB_PARTROOT(sb,i), UDF_SB_PARTLEN(sb,i));
968 } 978 }
979 return 0;
969} 980}
970 981
971static int udf_load_logicalvol(struct super_block *sb, struct buffer_head *bh, 982static int udf_load_logicalvol(struct super_block *sb, struct buffer_head *bh,
@@ -1177,12 +1188,19 @@ static int udf_process_sequence(struct super_block *sb, long block, long lastblo
1177 udf_load_logicalvol(sb, bh, fileset); 1188 udf_load_logicalvol(sb, bh, fileset);
1178 } else if (i == VDS_POS_PARTITION_DESC) { 1189 } else if (i == VDS_POS_PARTITION_DESC) {
1179 struct buffer_head *bh2 = NULL; 1190 struct buffer_head *bh2 = NULL;
1180 udf_load_partdesc(sb, bh); 1191 if (udf_load_partdesc(sb, bh)) {
1192 brelse(bh);
1193 return 1;
1194 }
1181 for (j = vds[i].block + 1; j < vds[VDS_POS_TERMINATING_DESC].block; j++) { 1195 for (j = vds[i].block + 1; j < vds[VDS_POS_TERMINATING_DESC].block; j++) {
1182 bh2 = udf_read_tagged(sb, j, j, &ident); 1196 bh2 = udf_read_tagged(sb, j, j, &ident);
1183 gd = (struct generic_desc *)bh2->b_data; 1197 gd = (struct generic_desc *)bh2->b_data;
1184 if (ident == TAG_IDENT_PD) 1198 if (ident == TAG_IDENT_PD)
1185 udf_load_partdesc(sb, bh2); 1199 if (udf_load_partdesc(sb, bh2)) {
1200 brelse(bh);
1201 brelse(bh2);
1202 return 1;
1203 }
1186 brelse(bh2); 1204 brelse(bh2);
1187 } 1205 }
1188 } 1206 }
diff --git a/include/asm-sparc64/device.h b/include/asm-sparc64/device.h
index d5a4559b9555..5111e8717be3 100644
--- a/include/asm-sparc64/device.h
+++ b/include/asm-sparc64/device.h
@@ -16,8 +16,6 @@ struct dev_archdata {
16 16
17 struct device_node *prom_node; 17 struct device_node *prom_node;
18 struct of_device *op; 18 struct of_device *op;
19
20 unsigned int msi_num;
21}; 19};
22 20
23#endif /* _ASM_SPARC64_DEVICE_H */ 21#endif /* _ASM_SPARC64_DEVICE_H */
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index e6c436ef9356..c00ad152771b 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -16,21 +16,21 @@
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17 17
18/* IMAP/ICLR register defines */ 18/* IMAP/ICLR register defines */
19#define IMAP_VALID 0x80000000 /* IRQ Enabled */ 19#define IMAP_VALID 0x80000000UL /* IRQ Enabled */
20#define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ 20#define IMAP_TID_UPA 0x7c000000UL /* UPA TargetID */
21#define IMAP_TID_JBUS 0x7c000000 /* JBUS TargetID */ 21#define IMAP_TID_JBUS 0x7c000000UL /* JBUS TargetID */
22#define IMAP_TID_SHIFT 26 22#define IMAP_TID_SHIFT 26
23#define IMAP_AID_SAFARI 0x7c000000 /* Safari AgentID */ 23#define IMAP_AID_SAFARI 0x7c000000UL /* Safari AgentID */
24#define IMAP_AID_SHIFT 26 24#define IMAP_AID_SHIFT 26
25#define IMAP_NID_SAFARI 0x03e00000 /* Safari NodeID */ 25#define IMAP_NID_SAFARI 0x03e00000UL /* Safari NodeID */
26#define IMAP_NID_SHIFT 21 26#define IMAP_NID_SHIFT 21
27#define IMAP_IGN 0x000007c0 /* IRQ Group Number */ 27#define IMAP_IGN 0x000007c0UL /* IRQ Group Number */
28#define IMAP_INO 0x0000003f /* IRQ Number */ 28#define IMAP_INO 0x0000003fUL /* IRQ Number */
29#define IMAP_INR 0x000007ff /* Full interrupt number*/ 29#define IMAP_INR 0x000007ffUL /* Full interrupt number*/
30 30
31#define ICLR_IDLE 0x00000000 /* Idle state */ 31#define ICLR_IDLE 0x00000000UL /* Idle state */
32#define ICLR_TRANSMIT 0x00000001 /* Transmit state */ 32#define ICLR_TRANSMIT 0x00000001UL /* Transmit state */
33#define ICLR_PENDING 0x00000003 /* Pending state */ 33#define ICLR_PENDING 0x00000003UL /* Pending state */
34 34
35/* The largest number of unique interrupt sources we support. 35/* The largest number of unique interrupt sources we support.
36 * If this needs to ever be larger than 255, you need to change 36 * If this needs to ever be larger than 255, you need to change
@@ -53,6 +53,9 @@ extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p,
53extern void sun4v_destroy_msi(unsigned int virt_irq); 53extern void sun4v_destroy_msi(unsigned int virt_irq);
54extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 54extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
55 55
56extern void sparc64_set_msi(unsigned int virt_irq, u32 msi);
57extern u32 sparc64_get_msi(unsigned int virt_irq);
58
56extern void fixup_irqs(void); 59extern void fixup_irqs(void);
57 60
58static __inline__ void set_softint(unsigned long bits) 61static __inline__ void set_softint(unsigned long bits)
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index e3f010bd12b3..cb0248616d49 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -16,82 +16,112 @@
16 16
17 . = ALIGN(4096); 17 . = ALIGN(4096);
18 .note : { *(.note.*) } 18 .note : { *(.note.*) }
19 __start___ex_table = .; 19 __ex_table : {
20 __ex_table : { *(__ex_table) } 20 __start___ex_table = .;
21 __stop___ex_table = .; 21 *(__ex_table)
22 __stop___ex_table = .;
23 }
22 24
23 BUG_TABLE 25 BUG_TABLE
24 26
25 __uml_setup_start = .; 27 .uml.setup.init : {
26 .uml.setup.init : { *(.uml.setup.init) } 28 __uml_setup_start = .;
27 __uml_setup_end = .; 29 *(.uml.setup.init)
30 __uml_setup_end = .;
31 }
28 32
29 __uml_help_start = .; 33 .uml.help.init : {
30 .uml.help.init : { *(.uml.help.init) } 34 __uml_help_start = .;
31 __uml_help_end = .; 35 *(.uml.help.init)
36 __uml_help_end = .;
37 }
32 38
33 __uml_postsetup_start = .; 39 .uml.postsetup.init : {
34 .uml.postsetup.init : { *(.uml.postsetup.init) } 40 __uml_postsetup_start = .;
35 __uml_postsetup_end = .; 41 *(.uml.postsetup.init)
42 __uml_postsetup_end = .;
43 }
36 44
37 __setup_start = .; 45 .init.setup : {
38 .init.setup : { *(.init.setup) } 46 __setup_start = .;
39 __setup_end = .; 47 *(.init.setup)
48 __setup_end = .;
49 }
40 50
41 . = ALIGN(32); 51 . = ALIGN(32);
42 __per_cpu_start = . ; 52 .data.percpu : {
43 .data.percpu : { *(.data.percpu) } 53 __per_cpu_start = . ;
44 __per_cpu_end = . ; 54 *(.data.percpu)
55 __per_cpu_end = . ;
56 }
45 57
46 __initcall_start = .;
47 .initcall.init : { 58 .initcall.init : {
59 __initcall_start = .;
48 INITCALLS 60 INITCALLS
61 __initcall_end = .;
49 } 62 }
50 __initcall_end = .;
51 63
52 __con_initcall_start = .; 64 .con_initcall.init : {
53 .con_initcall.init : { *(.con_initcall.init) } 65 __con_initcall_start = .;
54 __con_initcall_end = .; 66 *(.con_initcall.init)
67 __con_initcall_end = .;
68 }
55 69
56 __uml_initcall_start = .; 70 .uml.initcall.init : {
57 .uml.initcall.init : { *(.uml.initcall.init) } 71 __uml_initcall_start = .;
58 __uml_initcall_end = .; 72 *(.uml.initcall.init)
73 __uml_initcall_end = .;
74 }
59 __init_end = .; 75 __init_end = .;
60 76
61 SECURITY_INIT 77 SECURITY_INIT
62 78
63 __exitcall_begin = .; 79 .exitcall : {
64 .exitcall : { *(.exitcall.exit) } 80 __exitcall_begin = .;
65 __exitcall_end = .; 81 *(.exitcall.exit)
82 __exitcall_end = .;
83 }
66 84
67 __uml_exitcall_begin = .; 85 .uml.exitcall : {
68 .uml.exitcall : { *(.uml.exitcall.exit) } 86 __uml_exitcall_begin = .;
69 __uml_exitcall_end = .; 87 *(.uml.exitcall.exit)
88 __uml_exitcall_end = .;
89 }
70 90
71 . = ALIGN(4); 91 . = ALIGN(4);
72 __alt_instructions = .; 92 .altinstructions : {
73 .altinstructions : { *(.altinstructions) } 93 __alt_instructions = .;
74 __alt_instructions_end = .; 94 *(.altinstructions)
95 __alt_instructions_end = .;
96 }
75 .altinstr_replacement : { *(.altinstr_replacement) } 97 .altinstr_replacement : { *(.altinstr_replacement) }
76 /* .exit.text is discard at runtime, not link time, to deal with references 98 /* .exit.text is discard at runtime, not link time, to deal with references
77 from .altinstructions and .eh_frame */ 99 from .altinstructions and .eh_frame */
78 .exit.text : { *(.exit.text) } 100 .exit.text : { *(.exit.text) }
79 .exit.data : { *(.exit.data) } 101 .exit.data : { *(.exit.data) }
80 102
81 __preinit_array_start = .; 103 .preinit_array : {
82 .preinit_array : { *(.preinit_array) } 104 __preinit_array_start = .;
83 __preinit_array_end = .; 105 *(.preinit_array)
84 __init_array_start = .; 106 __preinit_array_end = .;
85 .init_array : { *(.init_array) } 107 }
86 __init_array_end = .; 108 .init_array : {
87 __fini_array_start = .; 109 __init_array_start = .;
88 .fini_array : { *(.fini_array) } 110 *(.init_array)
89 __fini_array_end = .; 111 __init_array_end = .;
112 }
113 .fini_array : {
114 __fini_array_start = .;
115 *(.fini_array)
116 __fini_array_end = .;
117 }
90 118
91 . = ALIGN(4096); 119 . = ALIGN(4096);
92 __initramfs_start = .; 120 .init.ramfs : {
93 .init.ramfs : { *(.init.ramfs) } 121 __initramfs_start = .;
94 __initramfs_end = .; 122 *(.init.ramfs)
123 __initramfs_end = .;
124 }
95 125
96 /* Sections to be discarded */ 126 /* Sections to be discarded */
97 /DISCARD/ : { 127 /DISCARD/ : {
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
index 8a8246d03936..bfe27aa2c9c4 100644
--- a/include/asm-um/elf-x86_64.h
+++ b/include/asm-um/elf-x86_64.h
@@ -6,7 +6,9 @@
6#ifndef __UM_ELF_X86_64_H 6#ifndef __UM_ELF_X86_64_H
7#define __UM_ELF_X86_64_H 7#define __UM_ELF_X86_64_H
8 8
9#include <linux/sched.h>
9#include <asm/user.h> 10#include <asm/user.h>
11#include "skas.h"
10 12
11/* x86-64 relocation types, taken from asm-x86_64/elf.h */ 13/* x86-64 relocation types, taken from asm-x86_64/elf.h */
12#define R_X86_64_NONE 0 /* No reloc */ 14#define R_X86_64_NONE 0 /* No reloc */
@@ -64,6 +66,44 @@ typedef struct { } elf_fpregset_t;
64 PT_REGS_R15(regs) = 0; \ 66 PT_REGS_R15(regs) = 0; \
65} while (0) 67} while (0)
66 68
69#define ELF_CORE_COPY_REGS(pr_reg, regs) \
70 (pr_reg)[0] = (regs)->regs.gp[0]; \
71 (pr_reg)[1] = (regs)->regs.gp[1]; \
72 (pr_reg)[2] = (regs)->regs.gp[2]; \
73 (pr_reg)[3] = (regs)->regs.gp[3]; \
74 (pr_reg)[4] = (regs)->regs.gp[4]; \
75 (pr_reg)[5] = (regs)->regs.gp[5]; \
76 (pr_reg)[6] = (regs)->regs.gp[6]; \
77 (pr_reg)[7] = (regs)->regs.gp[7]; \
78 (pr_reg)[8] = (regs)->regs.gp[8]; \
79 (pr_reg)[9] = (regs)->regs.gp[9]; \
80 (pr_reg)[10] = (regs)->regs.gp[10]; \
81 (pr_reg)[11] = (regs)->regs.gp[11]; \
82 (pr_reg)[12] = (regs)->regs.gp[12]; \
83 (pr_reg)[13] = (regs)->regs.gp[13]; \
84 (pr_reg)[14] = (regs)->regs.gp[14]; \
85 (pr_reg)[15] = (regs)->regs.gp[15]; \
86 (pr_reg)[16] = (regs)->regs.gp[16]; \
87 (pr_reg)[17] = (regs)->regs.gp[17]; \
88 (pr_reg)[18] = (regs)->regs.gp[18]; \
89 (pr_reg)[19] = (regs)->regs.gp[19]; \
90 (pr_reg)[20] = (regs)->regs.gp[20]; \
91 (pr_reg)[21] = current->thread.arch.fs; \
92 (pr_reg)[22] = 0; \
93 (pr_reg)[23] = 0; \
94 (pr_reg)[24] = 0; \
95 (pr_reg)[25] = 0; \
96 (pr_reg)[26] = 0;
97
98static inline int elf_core_copy_fpregs(struct task_struct *t,
99 elf_fpregset_t *fpu)
100{
101 int cpu = current_thread->cpu;
102 return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
103}
104
105#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
106
67#ifdef TIF_IA32 /* XXX */ 107#ifdef TIF_IA32 /* XXX */
68#error XXX, indeed 108#error XXX, indeed
69 clear_thread_flag(TIF_IA32); 109 clear_thread_flag(TIF_IA32);
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 1d5ded0836ee..0ad72c4cf312 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -126,16 +126,16 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
126static inline int cpu_is_offline(int cpu) { return 0; } 126static inline int cpu_is_offline(int cpu) { return 0; }
127#endif /* CONFIG_HOTPLUG_CPU */ 127#endif /* CONFIG_HOTPLUG_CPU */
128 128
129#ifdef CONFIG_SUSPEND_SMP 129#ifdef CONFIG_PM_SLEEP_SMP
130extern int suspend_cpu_hotplug; 130extern int suspend_cpu_hotplug;
131 131
132extern int disable_nonboot_cpus(void); 132extern int disable_nonboot_cpus(void);
133extern void enable_nonboot_cpus(void); 133extern void enable_nonboot_cpus(void);
134#else 134#else /* !CONFIG_PM_SLEEP_SMP */
135#define suspend_cpu_hotplug 0 135#define suspend_cpu_hotplug 0
136 136
137static inline int disable_nonboot_cpus(void) { return 0; } 137static inline int disable_nonboot_cpus(void) { return 0; }
138static inline void enable_nonboot_cpus(void) {} 138static inline void enable_nonboot_cpus(void) {}
139#endif 139#endif /* !CONFIG_PM_SLEEP_SMP */
140 140
141#endif /* _LINUX_CPU_H_ */ 141#endif /* _LINUX_CPU_H_ */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index e6a71c82d204..3a19b032c0eb 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -66,11 +66,8 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
66 * If the arch doesn't supply something else, assume that hugepage 66 * If the arch doesn't supply something else, assume that hugepage
67 * size aligned regions are ok without further preparation. 67 * size aligned regions are ok without further preparation.
68 */ 68 */
69static inline int prepare_hugepage_range(unsigned long addr, unsigned long len, 69static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
70 pgoff_t pgoff)
71{ 70{
72 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
73 return -EINVAL;
74 if (len & ~HPAGE_MASK) 71 if (len & ~HPAGE_MASK)
75 return -EINVAL; 72 return -EINVAL;
76 if (addr & ~HPAGE_MASK) 73 if (addr & ~HPAGE_MASK)
@@ -78,8 +75,7 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len,
78 return 0; 75 return 0;
79} 76}
80#else 77#else
81int prepare_hugepage_range(unsigned long addr, unsigned long len, 78int prepare_hugepage_range(unsigned long addr, unsigned long len);
82 pgoff_t pgoff);
83#endif 79#endif
84 80
85#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE 81#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
@@ -117,7 +113,7 @@ static inline unsigned long hugetlb_total_pages(void)
117#define hugetlb_report_meminfo(buf) 0 113#define hugetlb_report_meminfo(buf) 0
118#define hugetlb_report_node_meminfo(n, buf) 0 114#define hugetlb_report_node_meminfo(n, buf) 0
119#define follow_huge_pmd(mm, addr, pmd, write) NULL 115#define follow_huge_pmd(mm, addr, pmd, write) NULL
120#define prepare_hugepage_range(addr,len,pgoff) (-EINVAL) 116#define prepare_hugepage_range(addr,len) (-EINVAL)
121#define pmd_huge(x) 0 117#define pmd_huge(x) 0
122#define is_hugepage_only_range(mm, addr, len) 0 118#define is_hugepage_only_range(mm, addr, len) 0
123#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 119#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 06d23e10a16d..17168f3cc73f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -374,10 +374,9 @@
374#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 374#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
375#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a 375#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
376#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380 376#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380
377#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 377#define PCI_DEVICE_ID_ATI_SBX00_SMBUS 0x4385
378#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c 378#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
379#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 379#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390
380#define PCI_DEVICE_ID_ATI_IXP700_SMBUS 0x4395
381#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c 380#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c
382 381
383#define PCI_VENDOR_ID_VLSI 0x1004 382#define PCI_VENDOR_ID_VLSI 0x1004
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index c91476ce314a..dff3192374f8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -351,6 +351,8 @@ enum
351#define RTAX_INITCWND RTAX_INITCWND 351#define RTAX_INITCWND RTAX_INITCWND
352 RTAX_FEATURES, 352 RTAX_FEATURES,
353#define RTAX_FEATURES RTAX_FEATURES 353#define RTAX_FEATURES RTAX_FEATURES
354 RTAX_RTO_MIN,
355#define RTAX_RTO_MIN RTAX_RTO_MIN
354 __RTAX_MAX 356 __RTAX_MAX
355}; 357};
356 358
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 124270df8734..74962077f632 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -78,7 +78,7 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
78 * Sorry that the following has to be that ugly but some versions of GCC 78 * Sorry that the following has to be that ugly but some versions of GCC
79 * have trouble with constant propagation and loops. 79 * have trouble with constant propagation and loops.
80 */ 80 */
81static inline int kmalloc_index(size_t size) 81static __always_inline int kmalloc_index(size_t size)
82{ 82{
83 if (!size) 83 if (!size)
84 return 0; 84 return 0;
@@ -133,7 +133,7 @@ static inline int kmalloc_index(size_t size)
133 * This ought to end up with a global pointer to the right cache 133 * This ought to end up with a global pointer to the right cache
134 * in kmalloc_caches. 134 * in kmalloc_caches.
135 */ 135 */
136static inline struct kmem_cache *kmalloc_slab(size_t size) 136static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
137{ 137{
138 int index = kmalloc_index(size); 138 int index = kmalloc_index(size);
139 139
@@ -166,7 +166,7 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
166void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 166void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
167void *__kmalloc(size_t size, gfp_t flags); 167void *__kmalloc(size_t size, gfp_t flags);
168 168
169static inline void *kmalloc(size_t size, gfp_t flags) 169static __always_inline void *kmalloc(size_t size, gfp_t flags)
170{ 170{
171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
172 struct kmem_cache *s = kmalloc_slab(size); 172 struct kmem_cache *s = kmalloc_slab(size);
@@ -183,7 +183,7 @@ static inline void *kmalloc(size_t size, gfp_t flags)
183void *__kmalloc_node(size_t size, gfp_t flags, int node); 183void *__kmalloc_node(size_t size, gfp_t flags, int node);
184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
185 185
186static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 186static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
187{ 187{
188 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 188 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
189 struct kmem_cache *s = kmalloc_slab(size); 189 struct kmem_cache *s = kmalloc_slab(size);
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 73cb9943c8a8..991c85bb9e36 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -214,7 +214,7 @@ struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc,
214 const struct sctp_chunk *); 214 const struct sctp_chunk *);
215struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *, 215struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *,
216 const struct sctp_chunk *); 216 const struct sctp_chunk *);
217void sctp_init_cause(struct sctp_chunk *, __be16 cause, const void *, size_t); 217void sctp_init_cause(struct sctp_chunk *, __be16 cause, size_t);
218struct sctp_chunk *sctp_make_abort(const struct sctp_association *, 218struct sctp_chunk *sctp_make_abort(const struct sctp_association *,
219 const struct sctp_chunk *, 219 const struct sctp_chunk *,
220 const size_t hint); 220 const size_t hint);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index ee4559b11302..c0d5848c33dc 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -726,6 +726,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
726 struct iovec *data); 726 struct iovec *data);
727void sctp_chunk_free(struct sctp_chunk *); 727void sctp_chunk_free(struct sctp_chunk *);
728void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 728void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
729void *sctp_addto_param(struct sctp_chunk *, int len, const void *data);
729struct sctp_chunk *sctp_chunkify(struct sk_buff *, 730struct sctp_chunk *sctp_chunkify(struct sk_buff *,
730 const struct sctp_association *, 731 const struct sctp_association *,
731 struct sock *); 732 struct sock *);
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 39ea3f442b47..cd33270e86dd 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -83,6 +83,7 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc);
83/* Skip over an SSN. */ 83/* Skip over an SSN. */
84void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn); 84void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn);
85 85
86void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32);
86#endif /* __sctp_ulpqueue_h__ */ 87#endif /* __sctp_ulpqueue_h__ */
87 88
88 89
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 181ae7086029..38033db8d8ec 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
273 return err; 273 return err;
274} 274}
275 275
276#ifdef CONFIG_SUSPEND_SMP 276#ifdef CONFIG_PM_SLEEP_SMP
277static cpumask_t frozen_cpus; 277static cpumask_t frozen_cpus;
278 278
279int disable_nonboot_cpus(void) 279int disable_nonboot_cpus(void)
@@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
334out: 334out:
335 mutex_unlock(&cpu_add_remove_lock); 335 mutex_unlock(&cpu_add_remove_lock);
336} 336}
337#endif 337#endif /* CONFIG_PM_SLEEP_SMP */
diff --git a/kernel/exit.c b/kernel/exit.c
index 9578c1ae19ca..06b24b3aa370 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -975,6 +975,7 @@ fastcall NORET_TYPE void do_exit(long code)
975 if (unlikely(tsk->audit_context)) 975 if (unlikely(tsk->audit_context))
976 audit_free(tsk); 976 audit_free(tsk);
977 977
978 tsk->exit_code = code;
978 taskstats_exit(tsk, group_dead); 979 taskstats_exit(tsk, group_dead);
979 980
980 exit_mm(tsk); 981 exit_mm(tsk);
@@ -996,7 +997,6 @@ fastcall NORET_TYPE void do_exit(long code)
996 if (tsk->binfmt) 997 if (tsk->binfmt)
997 module_put(tsk->binfmt->module); 998 module_put(tsk->binfmt->module);
998 999
999 tsk->exit_code = code;
1000 proc_exit_connector(tsk); 1000 proc_exit_connector(tsk);
1001 exit_task_namespaces(tsk); 1001 exit_task_namespaces(tsk);
1002 exit_notify(tsk); 1002 exit_notify(tsk);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 853aefbd184b..7230d914eaa2 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -547,14 +547,11 @@ int request_irq(unsigned int irq, irq_handler_t handler,
547 * We do this before actually registering it, to make sure that 547 * We do this before actually registering it, to make sure that
548 * a 'real' IRQ doesn't run in parallel with our fake 548 * a 'real' IRQ doesn't run in parallel with our fake
549 */ 549 */
550 if (irqflags & IRQF_DISABLED) { 550 unsigned long flags;
551 unsigned long flags;
552 551
553 local_irq_save(flags); 552 local_irq_save(flags);
554 handler(irq, dev_id); 553 handler(irq, dev_id);
555 local_irq_restore(flags); 554 local_irq_restore(flags);
556 } else
557 handler(irq, dev_id);
558 } 555 }
559#endif 556#endif
560 557
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 412859f8d94a..c8580a1e6873 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -72,15 +72,10 @@ config PM_TRACE
72 CAUTION: this option will cause your machine's real-time clock to be 72 CAUTION: this option will cause your machine's real-time clock to be
73 set to an invalid time after a resume. 73 set to an invalid time after a resume.
74 74
75config SUSPEND_SMP_POSSIBLE 75config PM_SLEEP_SMP
76 bool
77 depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC))
78 depends on SMP
79 default y
80
81config SUSPEND_SMP
82 bool 76 bool
83 depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP 77 depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
78 depends on PM_SLEEP
84 select HOTPLUG_CPU 79 select HOTPLUG_CPU
85 default y 80 default y
86 81
@@ -89,20 +84,46 @@ config PM_SLEEP
89 depends on SUSPEND || HIBERNATION 84 depends on SUSPEND || HIBERNATION
90 default y 85 default y
91 86
87config SUSPEND_UP_POSSIBLE
88 bool
89 depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
90 || SUPERH || FRV
91 depends on !SMP
92 default y
93
94config SUSPEND_SMP_POSSIBLE
95 bool
96 depends on (X86 && !X86_VOYAGER) \
97 || (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
98 depends on SMP
99 default y
100
92config SUSPEND 101config SUSPEND
93 bool "Suspend to RAM and standby" 102 bool "Suspend to RAM and standby"
94 depends on PM 103 depends on PM
95 depends on !SMP || SUSPEND_SMP_POSSIBLE 104 depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
96 default y 105 default y
97 ---help--- 106 ---help---
98 Allow the system to enter sleep states in which main memory is 107 Allow the system to enter sleep states in which main memory is
99 powered and thus its contents are preserved, such as the 108 powered and thus its contents are preserved, such as the
100 suspend-to-RAM state (i.e. the ACPI S3 state). 109 suspend-to-RAM state (i.e. the ACPI S3 state).
101 110
111config HIBERNATION_UP_POSSIBLE
112 bool
113 depends on X86 || PPC64_SWSUSP || FRV || PPC32
114 depends on !SMP
115 default y
116
117config HIBERNATION_SMP_POSSIBLE
118 bool
119 depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP
120 depends on SMP
121 default y
122
102config HIBERNATION 123config HIBERNATION
103 bool "Hibernation (aka 'suspend to disk')" 124 bool "Hibernation (aka 'suspend to disk')"
104 depends on PM && SWAP 125 depends on PM && SWAP
105 depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE 126 depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
106 ---help--- 127 ---help---
107 Enable the suspend to disk (STD) functionality, which is usually 128 Enable the suspend to disk (STD) functionality, which is usually
108 called "hibernation" in user interfaces. STD checkpoints the 129 called "hibernation" in user interfaces. STD checkpoints the
diff --git a/kernel/signal.c b/kernel/signal.c
index ad63109e413c..3169bed0b4d0 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1300,20 +1300,19 @@ struct sigqueue *sigqueue_alloc(void)
1300void sigqueue_free(struct sigqueue *q) 1300void sigqueue_free(struct sigqueue *q)
1301{ 1301{
1302 unsigned long flags; 1302 unsigned long flags;
1303 spinlock_t *lock = &current->sighand->siglock;
1304
1303 BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); 1305 BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));
1304 /* 1306 /*
1305 * If the signal is still pending remove it from the 1307 * If the signal is still pending remove it from the
1306 * pending queue. 1308 * pending queue. We must hold ->siglock while testing
1309 * q->list to serialize with collect_signal().
1307 */ 1310 */
1308 if (unlikely(!list_empty(&q->list))) { 1311 spin_lock_irqsave(lock, flags);
1309 spinlock_t *lock = &current->sighand->siglock; 1312 if (!list_empty(&q->list))
1310 read_lock(&tasklist_lock); 1313 list_del_init(&q->list);
1311 spin_lock_irqsave(lock, flags); 1314 spin_unlock_irqrestore(lock, flags);
1312 if (!list_empty(&q->list)) 1315
1313 list_del_init(&q->list);
1314 spin_unlock_irqrestore(lock, flags);
1315 read_unlock(&tasklist_lock);
1316 }
1317 q->flags &= ~SIGQUEUE_PREALLOC; 1316 q->flags &= ~SIGQUEUE_PREALLOC;
1318 __sigqueue_free(q); 1317 __sigqueue_free(q);
1319} 1318}
diff --git a/kernel/sys.c b/kernel/sys.c
index 449b81b98b3d..1b33b05d346b 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1442,7 +1442,6 @@ asmlinkage long sys_times(struct tms __user * tbuf)
1442 * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. 1442 * Auch. Had to add the 'did_exec' flag to conform completely to POSIX.
1443 * LBT 04.03.94 1443 * LBT 04.03.94
1444 */ 1444 */
1445
1446asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) 1445asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
1447{ 1446{
1448 struct task_struct *p; 1447 struct task_struct *p;
@@ -1470,7 +1469,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
1470 if (!thread_group_leader(p)) 1469 if (!thread_group_leader(p))
1471 goto out; 1470 goto out;
1472 1471
1473 if (p->real_parent == group_leader) { 1472 if (p->real_parent->tgid == group_leader->tgid) {
1474 err = -EPERM; 1473 err = -EPERM;
1475 if (task_session(p) != task_session(group_leader)) 1474 if (task_session(p) != task_session(group_leader))
1476 goto out; 1475 goto out;
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index d055d987850c..85af9422ea6e 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -81,6 +81,7 @@ void free_user_ns(struct kref *kref)
81 struct user_namespace *ns; 81 struct user_namespace *ns;
82 82
83 ns = container_of(kref, struct user_namespace, kref); 83 ns = container_of(kref, struct user_namespace, kref);
84 free_uid(ns->root_user);
84 kfree(ns); 85 kfree(ns);
85} 86}
86 87
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 172abffeb2e3..bb54b88c3d5a 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -955,6 +955,11 @@ asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
955 goto out; 955 goto out;
956 } 956 }
957 957
958 if (!nodes_subset(new, node_online_map)) {
959 err = -EINVAL;
960 goto out;
961 }
962
958 err = security_task_movememory(task); 963 err = security_task_movememory(task);
959 if (err) 964 if (err)
960 goto out; 965 goto out;
diff --git a/mm/migrate.c b/mm/migrate.c
index 37c73b902008..e2fdbce1874b 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -611,6 +611,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
611 int rc = 0; 611 int rc = 0;
612 int *result = NULL; 612 int *result = NULL;
613 struct page *newpage = get_new_page(page, private, &result); 613 struct page *newpage = get_new_page(page, private, &result);
614 int rcu_locked = 0;
614 615
615 if (!newpage) 616 if (!newpage)
616 return -ENOMEM; 617 return -ENOMEM;
@@ -636,8 +637,13 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
636 * we cannot notice that anon_vma is freed while we migrates a page. 637 * we cannot notice that anon_vma is freed while we migrates a page.
637 * This rcu_read_lock() delays freeing anon_vma pointer until the end 638 * This rcu_read_lock() delays freeing anon_vma pointer until the end
638 * of migration. File cache pages are no problem because of page_lock() 639 * of migration. File cache pages are no problem because of page_lock()
640 * File Caches may use write_page() or lock_page() in migration, then,
641 * just care Anon page here.
639 */ 642 */
640 rcu_read_lock(); 643 if (PageAnon(page)) {
644 rcu_read_lock();
645 rcu_locked = 1;
646 }
641 /* 647 /*
642 * This is a corner case handling. 648 * This is a corner case handling.
643 * When a new swap-cache is read into, it is linked to LRU 649 * When a new swap-cache is read into, it is linked to LRU
@@ -656,7 +662,8 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
656 if (rc) 662 if (rc)
657 remove_migration_ptes(page, page); 663 remove_migration_ptes(page, page);
658rcu_unlock: 664rcu_unlock:
659 rcu_read_unlock(); 665 if (rcu_locked)
666 rcu_read_unlock();
660 667
661unlock: 668unlock:
662 669
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6427653023aa..1a8c59571cb7 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2345,6 +2345,8 @@ static int __cpuinit process_zones(int cpu)
2345 return 0; 2345 return 0;
2346bad: 2346bad:
2347 for_each_zone(dzone) { 2347 for_each_zone(dzone) {
2348 if (!populated_zone(dzone))
2349 continue;
2348 if (dzone == zone) 2350 if (dzone == zone)
2349 break; 2351 break;
2350 kfree(zone_pcp(dzone, cpu)); 2352 kfree(zone_pcp(dzone, cpu));
diff --git a/mm/slub.c b/mm/slub.c
index 04151da399c6..7defe84e6bd0 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3813,7 +3813,9 @@ static int __init slab_sysfs_init(void)
3813 3813
3814 list_for_each_entry(s, &slab_caches, list) { 3814 list_for_each_entry(s, &slab_caches, list) {
3815 err = sysfs_slab_add(s); 3815 err = sysfs_slab_add(s);
3816 BUG_ON(err); 3816 if (err)
3817 printk(KERN_ERR "SLUB: Unable to add boot slab %s"
3818 " to sysfs\n", s->name);
3817 } 3819 }
3818 3820
3819 while (alias_list) { 3821 while (alias_list) {
@@ -3821,7 +3823,9 @@ static int __init slab_sysfs_init(void)
3821 3823
3822 alias_list = alias_list->next; 3824 alias_list = alias_list->next;
3823 err = sysfs_slab_alias(al->s, al->name); 3825 err = sysfs_slab_alias(al->s, al->name);
3824 BUG_ON(err); 3826 if (err)
3827 printk(KERN_ERR "SLUB: Unable to add boot slab alias"
3828 " %s to sysfs\n", s->name);
3825 kfree(al); 3829 kfree(al);
3826 } 3830 }
3827 3831
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 69b70977f000..eb57502bb264 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -384,6 +384,11 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
384 if (hold_time(br) == 0) 384 if (hold_time(br) == 0)
385 return; 385 return;
386 386
387 /* ignore packets unless we are using this port */
388 if (!(source->state == BR_STATE_LEARNING ||
389 source->state == BR_STATE_FORWARDING))
390 return;
391
387 fdb = fdb_find(head, addr); 392 fdb = fdb_find(head, addr);
388 if (likely(fdb)) { 393 if (likely(fdb)) {
389 /* attempt to update an entry for a local interface */ 394 /* attempt to update an entry for a local interface */
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 749f0e8f541d..9272f12f664c 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -33,17 +33,17 @@
33 */ 33 */
34static int port_cost(struct net_device *dev) 34static int port_cost(struct net_device *dev)
35{ 35{
36 if (dev->ethtool_ops->get_settings) { 36 if (dev->ethtool_ops && dev->ethtool_ops->get_settings) {
37 struct ethtool_cmd ecmd = { ETHTOOL_GSET }; 37 struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET, };
38 int err = dev->ethtool_ops->get_settings(dev, &ecmd); 38
39 if (!err) { 39 if (!dev->ethtool_ops->get_settings(dev, &ecmd)) {
40 switch(ecmd.speed) { 40 switch(ecmd.speed) {
41 case SPEED_100:
42 return 19;
43 case SPEED_1000:
44 return 4;
45 case SPEED_10000: 41 case SPEED_10000:
46 return 2; 42 return 2;
43 case SPEED_1000:
44 return 4;
45 case SPEED_100:
46 return 19;
47 case SPEED_10: 47 case SPEED_10:
48 return 100; 48 return 100;
49 } 49 }
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 5c18595b7616..6f468fc3357a 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -101,9 +101,8 @@ static int br_handle_local_finish(struct sk_buff *skb)
101{ 101{
102 struct net_bridge_port *p = rcu_dereference(skb->dev->br_port); 102 struct net_bridge_port *p = rcu_dereference(skb->dev->br_port);
103 103
104 if (p && p->state != BR_STATE_DISABLED) 104 if (p)
105 br_fdb_update(p->br, p, eth_hdr(skb)->h_source); 105 br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
106
107 return 0; /* process further */ 106 return 0; /* process further */
108} 107}
109 108
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 7bae576ac115..36fdea71d742 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -380,7 +380,6 @@ struct pktgen_thread {
380 /* Field for thread to receive "posted" events terminate, stop ifs etc. */ 380 /* Field for thread to receive "posted" events terminate, stop ifs etc. */
381 381
382 u32 control; 382 u32 control;
383 int pid;
384 int cpu; 383 int cpu;
385 384
386 wait_queue_head_t queue; 385 wait_queue_head_t queue;
@@ -3331,8 +3330,9 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
3331 } 3330 }
3332 3331
3333 if ((netif_queue_stopped(odev) || 3332 if ((netif_queue_stopped(odev) ||
3334 netif_subqueue_stopped(odev, pkt_dev->skb->queue_mapping)) || 3333 (pkt_dev->skb &&
3335 need_resched()) { 3334 netif_subqueue_stopped(odev, pkt_dev->skb->queue_mapping))) ||
3335 need_resched()) {
3336 idle_start = getCurUs(); 3336 idle_start = getCurUs();
3337 3337
3338 if (!netif_running(odev)) { 3338 if (!netif_running(odev)) {
@@ -3462,8 +3462,6 @@ static int pktgen_thread_worker(void *arg)
3462 3462
3463 init_waitqueue_head(&t->queue); 3463 init_waitqueue_head(&t->queue);
3464 3464
3465 t->pid = current->pid;
3466
3467 pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid); 3465 pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid);
3468 3466
3469 max_before_softirq = t->max_before_softirq; 3467 max_before_softirq = t->max_before_softirq;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9785df37a65f..1ee72127462b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -555,6 +555,16 @@ static void tcp_event_data_recv(struct sock *sk, struct sk_buff *skb)
555 tcp_grow_window(sk, skb); 555 tcp_grow_window(sk, skb);
556} 556}
557 557
558static u32 tcp_rto_min(struct sock *sk)
559{
560 struct dst_entry *dst = __sk_dst_get(sk);
561 u32 rto_min = TCP_RTO_MIN;
562
563 if (dst_metric_locked(dst, RTAX_RTO_MIN))
564 rto_min = dst->metrics[RTAX_RTO_MIN-1];
565 return rto_min;
566}
567
558/* Called to compute a smoothed rtt estimate. The data fed to this 568/* Called to compute a smoothed rtt estimate. The data fed to this
559 * routine either comes from timestamps, or from segments that were 569 * routine either comes from timestamps, or from segments that were
560 * known _not_ to have been retransmitted [see Karn/Partridge 570 * known _not_ to have been retransmitted [see Karn/Partridge
@@ -616,13 +626,13 @@ static void tcp_rtt_estimator(struct sock *sk, const __u32 mrtt)
616 if (tp->mdev_max < tp->rttvar) 626 if (tp->mdev_max < tp->rttvar)
617 tp->rttvar -= (tp->rttvar-tp->mdev_max)>>2; 627 tp->rttvar -= (tp->rttvar-tp->mdev_max)>>2;
618 tp->rtt_seq = tp->snd_nxt; 628 tp->rtt_seq = tp->snd_nxt;
619 tp->mdev_max = TCP_RTO_MIN; 629 tp->mdev_max = tcp_rto_min(sk);
620 } 630 }
621 } else { 631 } else {
622 /* no previous measure. */ 632 /* no previous measure. */
623 tp->srtt = m<<3; /* take the measured time to be rtt */ 633 tp->srtt = m<<3; /* take the measured time to be rtt */
624 tp->mdev = m<<1; /* make sure rto = 3*rtt */ 634 tp->mdev = m<<1; /* make sure rto = 3*rtt */
625 tp->mdev_max = tp->rttvar = max(tp->mdev, TCP_RTO_MIN); 635 tp->mdev_max = tp->rttvar = max(tp->mdev, tcp_rto_min(sk));
626 tp->rtt_seq = tp->snd_nxt; 636 tp->rtt_seq = tp->snd_nxt;
627 } 637 }
628} 638}
diff --git a/net/netfilter/xt_tcpudp.c b/net/netfilter/xt_tcpudp.c
index ab7d845224fc..223f9bded672 100644
--- a/net/netfilter/xt_tcpudp.c
+++ b/net/netfilter/xt_tcpudp.c
@@ -188,7 +188,7 @@ udp_checkentry(const char *tablename,
188 void *matchinfo, 188 void *matchinfo,
189 unsigned int hook_mask) 189 unsigned int hook_mask)
190{ 190{
191 const struct xt_tcp *udpinfo = matchinfo; 191 const struct xt_udp *udpinfo = matchinfo;
192 192
193 /* Must specify no unknown invflags */ 193 /* Must specify no unknown invflags */
194 return !(udpinfo->invflags & ~XT_UDP_INV_MASK); 194 return !(udpinfo->invflags & ~XT_UDP_INV_MASK);
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 4a49db65772e..abd82fc3ec60 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -44,7 +44,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
44 if (TC_H_MAJ(skb->priority) != sch->handle) { 44 if (TC_H_MAJ(skb->priority) != sch->handle) {
45 err = tc_classify(skb, q->filter_list, &res); 45 err = tc_classify(skb, q->filter_list, &res);
46#ifdef CONFIG_NET_CLS_ACT 46#ifdef CONFIG_NET_CLS_ACT
47 switch (tc_classify(skb, q->filter_list, &res)) { 47 switch (err) {
48 case TC_ACT_STOLEN: 48 case TC_ACT_STOLEN:
49 case TC_ACT_QUEUED: 49 case TC_ACT_QUEUED:
50 *qerr = NET_XMIT_SUCCESS; 50 *qerr = NET_XMIT_SUCCESS;
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 498edb0cd4e5..2ad1caf1ea42 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -727,7 +727,12 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
727 break; 727 break;
728 728
729 case SCTP_TRANSPORT_DOWN: 729 case SCTP_TRANSPORT_DOWN:
730 transport->state = SCTP_INACTIVE; 730 /* if the transort was never confirmed, do not transition it
731 * to inactive state.
732 */
733 if (transport->state != SCTP_UNCONFIRMED)
734 transport->state = SCTP_INACTIVE;
735
731 spc_state = SCTP_ADDR_UNREACHABLE; 736 spc_state = SCTP_ADDR_UNREACHABLE;
732 break; 737 break;
733 738
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 992f361084b7..28f4fe77ceee 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -421,6 +421,13 @@ void sctp_retransmit_mark(struct sctp_outq *q,
421 */ 421 */
422 if ((fast_retransmit && (chunk->fast_retransmit > 0)) || 422 if ((fast_retransmit && (chunk->fast_retransmit > 0)) ||
423 (!fast_retransmit && !chunk->tsn_gap_acked)) { 423 (!fast_retransmit && !chunk->tsn_gap_acked)) {
424 /* If this chunk was sent less then 1 rto ago, do not
425 * retransmit this chunk, but give the peer time
426 * to acknowlege it.
427 */
428 if ((jiffies - chunk->sent_at) < transport->rto)
429 continue;
430
424 /* RFC 2960 6.2.1 Processing a Received SACK 431 /* RFC 2960 6.2.1 Processing a Received SACK
425 * 432 *
426 * C) Any time a DATA chunk is marked for 433 * C) Any time a DATA chunk is marked for
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 51c4d7fef1d2..79856c924525 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -110,7 +110,7 @@ static const struct sctp_paramhdr prsctp_param = {
110 * abort chunk. 110 * abort chunk.
111 */ 111 */
112void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code, 112void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
113 const void *payload, size_t paylen) 113 size_t paylen)
114{ 114{
115 sctp_errhdr_t err; 115 sctp_errhdr_t err;
116 __u16 len; 116 __u16 len;
@@ -120,7 +120,6 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
120 len = sizeof(sctp_errhdr_t) + paylen; 120 len = sizeof(sctp_errhdr_t) + paylen;
121 err.length = htons(len); 121 err.length = htons(len);
122 chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); 122 chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err);
123 sctp_addto_chunk(chunk, paylen, payload);
124} 123}
125 124
126/* 3.3.2 Initiation (INIT) (1) 125/* 3.3.2 Initiation (INIT) (1)
@@ -780,8 +779,8 @@ struct sctp_chunk *sctp_make_abort_no_data(
780 779
781 /* Put the tsn back into network byte order. */ 780 /* Put the tsn back into network byte order. */
782 payload = htonl(tsn); 781 payload = htonl(tsn);
783 sctp_init_cause(retval, SCTP_ERROR_NO_DATA, (const void *)&payload, 782 sctp_init_cause(retval, SCTP_ERROR_NO_DATA, sizeof(payload));
784 sizeof(payload)); 783 sctp_addto_chunk(retval, sizeof(payload), (const void *)&payload);
785 784
786 /* RFC 2960 6.4 Multi-homed SCTP Endpoints 785 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
787 * 786 *
@@ -823,7 +822,8 @@ struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc,
823 goto err_copy; 822 goto err_copy;
824 } 823 }
825 824
826 sctp_init_cause(retval, SCTP_ERROR_USER_ABORT, payload, paylen); 825 sctp_init_cause(retval, SCTP_ERROR_USER_ABORT, paylen);
826 sctp_addto_chunk(retval, paylen, payload);
827 827
828 if (paylen) 828 if (paylen)
829 kfree(payload); 829 kfree(payload);
@@ -850,15 +850,17 @@ struct sctp_chunk *sctp_make_abort_violation(
850 struct sctp_paramhdr phdr; 850 struct sctp_paramhdr phdr;
851 851
852 retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t) + paylen 852 retval = sctp_make_abort(asoc, chunk, sizeof(sctp_errhdr_t) + paylen
853 + sizeof(sctp_chunkhdr_t)); 853 + sizeof(sctp_paramhdr_t));
854 if (!retval) 854 if (!retval)
855 goto end; 855 goto end;
856 856
857 sctp_init_cause(retval, SCTP_ERROR_PROTO_VIOLATION, payload, paylen); 857 sctp_init_cause(retval, SCTP_ERROR_PROTO_VIOLATION, paylen
858 + sizeof(sctp_paramhdr_t));
858 859
859 phdr.type = htons(chunk->chunk_hdr->type); 860 phdr.type = htons(chunk->chunk_hdr->type);
860 phdr.length = chunk->chunk_hdr->length; 861 phdr.length = chunk->chunk_hdr->length;
861 sctp_addto_chunk(retval, sizeof(sctp_paramhdr_t), &phdr); 862 sctp_addto_chunk(retval, paylen, payload);
863 sctp_addto_param(retval, sizeof(sctp_paramhdr_t), &phdr);
862 864
863end: 865end:
864 return retval; 866 return retval;
@@ -955,7 +957,8 @@ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc,
955 if (!retval) 957 if (!retval)
956 goto nodata; 958 goto nodata;
957 959
958 sctp_init_cause(retval, cause_code, payload, paylen); 960 sctp_init_cause(retval, cause_code, paylen);
961 sctp_addto_chunk(retval, paylen, payload);
959 962
960nodata: 963nodata:
961 return retval; 964 return retval;
@@ -1128,7 +1131,7 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
1128 void *target; 1131 void *target;
1129 void *padding; 1132 void *padding;
1130 int chunklen = ntohs(chunk->chunk_hdr->length); 1133 int chunklen = ntohs(chunk->chunk_hdr->length);
1131 int padlen = chunklen % 4; 1134 int padlen = WORD_ROUND(chunklen) - chunklen;
1132 1135
1133 padding = skb_put(chunk->skb, padlen); 1136 padding = skb_put(chunk->skb, padlen);
1134 target = skb_put(chunk->skb, len); 1137 target = skb_put(chunk->skb, len);
@@ -1143,6 +1146,25 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
1143 return target; 1146 return target;
1144} 1147}
1145 1148
1149/* Append bytes to the end of a parameter. Will panic if chunk is not big
1150 * enough.
1151 */
1152void *sctp_addto_param(struct sctp_chunk *chunk, int len, const void *data)
1153{
1154 void *target;
1155 int chunklen = ntohs(chunk->chunk_hdr->length);
1156
1157 target = skb_put(chunk->skb, len);
1158
1159 memcpy(target, data, len);
1160
1161 /* Adjust the chunk length field. */
1162 chunk->chunk_hdr->length = htons(chunklen + len);
1163 chunk->chunk_end = skb_tail_pointer(chunk->skb);
1164
1165 return target;
1166}
1167
1146/* Append bytes from user space to the end of a chunk. Will panic if 1168/* Append bytes from user space to the end of a chunk. Will panic if
1147 * chunk is not big enough. 1169 * chunk is not big enough.
1148 * Returns a kernel err value. 1170 * Returns a kernel err value.
@@ -1174,25 +1196,36 @@ out:
1174 */ 1196 */
1175void sctp_chunk_assign_ssn(struct sctp_chunk *chunk) 1197void sctp_chunk_assign_ssn(struct sctp_chunk *chunk)
1176{ 1198{
1199 struct sctp_datamsg *msg;
1200 struct sctp_chunk *lchunk;
1201 struct sctp_stream *stream;
1177 __u16 ssn; 1202 __u16 ssn;
1178 __u16 sid; 1203 __u16 sid;
1179 1204
1180 if (chunk->has_ssn) 1205 if (chunk->has_ssn)
1181 return; 1206 return;
1182 1207
1183 /* This is the last possible instant to assign a SSN. */ 1208 /* All fragments will be on the same stream */
1184 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) { 1209 sid = ntohs(chunk->subh.data_hdr->stream);
1185 ssn = 0; 1210 stream = &chunk->asoc->ssnmap->out;
1186 } else {
1187 sid = ntohs(chunk->subh.data_hdr->stream);
1188 if (chunk->chunk_hdr->flags & SCTP_DATA_LAST_FRAG)
1189 ssn = sctp_ssn_next(&chunk->asoc->ssnmap->out, sid);
1190 else
1191 ssn = sctp_ssn_peek(&chunk->asoc->ssnmap->out, sid);
1192 }
1193 1211
1194 chunk->subh.data_hdr->ssn = htons(ssn); 1212 /* Now assign the sequence number to the entire message.
1195 chunk->has_ssn = 1; 1213 * All fragments must have the same stream sequence number.
1214 */
1215 msg = chunk->msg;
1216 list_for_each_entry(lchunk, &msg->chunks, frag_list) {
1217 if (lchunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) {
1218 ssn = 0;
1219 } else {
1220 if (lchunk->chunk_hdr->flags & SCTP_DATA_LAST_FRAG)
1221 ssn = sctp_ssn_next(stream, sid);
1222 else
1223 ssn = sctp_ssn_peek(stream, sid);
1224 }
1225
1226 lchunk->subh.data_hdr->ssn = htons(ssn);
1227 lchunk->has_ssn = 1;
1228 }
1196} 1229}
1197 1230
1198/* Helper function to assign a TSN if needed. This assumes that both 1231/* Helper function to assign a TSN if needed. This assumes that both
@@ -1466,7 +1499,8 @@ no_hmac:
1466 __be32 n = htonl(usecs); 1499 __be32 n = htonl(usecs);
1467 1500
1468 sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE, 1501 sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE,
1469 &n, sizeof(n)); 1502 sizeof(n));
1503 sctp_addto_chunk(*errp, sizeof(n), &n);
1470 *error = -SCTP_IERROR_STALE_COOKIE; 1504 *error = -SCTP_IERROR_STALE_COOKIE;
1471 } else 1505 } else
1472 *error = -SCTP_IERROR_NOMEM; 1506 *error = -SCTP_IERROR_NOMEM;
@@ -1556,7 +1590,8 @@ static int sctp_process_missing_param(const struct sctp_association *asoc,
1556 report.num_missing = htonl(1); 1590 report.num_missing = htonl(1);
1557 report.type = paramtype; 1591 report.type = paramtype;
1558 sctp_init_cause(*errp, SCTP_ERROR_MISS_PARAM, 1592 sctp_init_cause(*errp, SCTP_ERROR_MISS_PARAM,
1559 &report, sizeof(report)); 1593 sizeof(report));
1594 sctp_addto_chunk(*errp, sizeof(report), &report);
1560 } 1595 }
1561 1596
1562 /* Stop processing this chunk. */ 1597 /* Stop processing this chunk. */
@@ -1574,7 +1609,7 @@ static int sctp_process_inv_mandatory(const struct sctp_association *asoc,
1574 *errp = sctp_make_op_error_space(asoc, chunk, 0); 1609 *errp = sctp_make_op_error_space(asoc, chunk, 0);
1575 1610
1576 if (*errp) 1611 if (*errp)
1577 sctp_init_cause(*errp, SCTP_ERROR_INV_PARAM, NULL, 0); 1612 sctp_init_cause(*errp, SCTP_ERROR_INV_PARAM, 0);
1578 1613
1579 /* Stop processing this chunk. */ 1614 /* Stop processing this chunk. */
1580 return 0; 1615 return 0;
@@ -1595,9 +1630,10 @@ static int sctp_process_inv_paramlength(const struct sctp_association *asoc,
1595 *errp = sctp_make_op_error_space(asoc, chunk, payload_len); 1630 *errp = sctp_make_op_error_space(asoc, chunk, payload_len);
1596 1631
1597 if (*errp) { 1632 if (*errp) {
1598 sctp_init_cause(*errp, SCTP_ERROR_PROTO_VIOLATION, error, 1633 sctp_init_cause(*errp, SCTP_ERROR_PROTO_VIOLATION,
1599 sizeof(error)); 1634 sizeof(error) + sizeof(sctp_paramhdr_t));
1600 sctp_addto_chunk(*errp, sizeof(sctp_paramhdr_t), param); 1635 sctp_addto_chunk(*errp, sizeof(error), error);
1636 sctp_addto_param(*errp, sizeof(sctp_paramhdr_t), param);
1601 } 1637 }
1602 1638
1603 return 0; 1639 return 0;
@@ -1618,9 +1654,10 @@ static int sctp_process_hn_param(const struct sctp_association *asoc,
1618 if (!*errp) 1654 if (!*errp)
1619 *errp = sctp_make_op_error_space(asoc, chunk, len); 1655 *errp = sctp_make_op_error_space(asoc, chunk, len);
1620 1656
1621 if (*errp) 1657 if (*errp) {
1622 sctp_init_cause(*errp, SCTP_ERROR_DNS_FAILED, 1658 sctp_init_cause(*errp, SCTP_ERROR_DNS_FAILED, len);
1623 param.v, len); 1659 sctp_addto_chunk(*errp, len, param.v);
1660 }
1624 1661
1625 /* Stop processing this chunk. */ 1662 /* Stop processing this chunk. */
1626 return 0; 1663 return 0;
@@ -1672,10 +1709,13 @@ static int sctp_process_unk_param(const struct sctp_association *asoc,
1672 *errp = sctp_make_op_error_space(asoc, chunk, 1709 *errp = sctp_make_op_error_space(asoc, chunk,
1673 ntohs(chunk->chunk_hdr->length)); 1710 ntohs(chunk->chunk_hdr->length));
1674 1711
1675 if (*errp) 1712 if (*errp) {
1676 sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM, 1713 sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM,
1677 param.v,
1678 WORD_ROUND(ntohs(param.p->length))); 1714 WORD_ROUND(ntohs(param.p->length)));
1715 sctp_addto_chunk(*errp,
1716 WORD_ROUND(ntohs(param.p->length)),
1717 param.v);
1718 }
1679 1719
1680 break; 1720 break;
1681 case SCTP_PARAM_ACTION_SKIP: 1721 case SCTP_PARAM_ACTION_SKIP:
@@ -1690,8 +1730,10 @@ static int sctp_process_unk_param(const struct sctp_association *asoc,
1690 1730
1691 if (*errp) { 1731 if (*errp) {
1692 sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM, 1732 sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM,
1693 param.v,
1694 WORD_ROUND(ntohs(param.p->length))); 1733 WORD_ROUND(ntohs(param.p->length)));
1734 sctp_addto_chunk(*errp,
1735 WORD_ROUND(ntohs(param.p->length)),
1736 param.v);
1695 } else { 1737 } else {
1696 /* If there is no memory for generating the ERROR 1738 /* If there is no memory for generating the ERROR
1697 * report as specified, an ABORT will be triggered 1739 * report as specified, an ABORT will be triggered
@@ -1791,7 +1833,7 @@ int sctp_verify_init(const struct sctp_association *asoc,
1791 * VIOLATION error. We build the ERROR chunk here and let the normal 1833 * VIOLATION error. We build the ERROR chunk here and let the normal
1792 * error handling code build and send the packet. 1834 * error handling code build and send the packet.
1793 */ 1835 */
1794 if (param.v < (void*)chunk->chunk_end - sizeof(sctp_paramhdr_t)) { 1836 if (param.v != (void*)chunk->chunk_end) {
1795 sctp_process_inv_paramlength(asoc, param.p, chunk, errp); 1837 sctp_process_inv_paramlength(asoc, param.p, chunk, errp);
1796 return 0; 1838 return 0;
1797 } 1839 }
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index d9fad4f6ffc3..8d7890083493 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1013,8 +1013,9 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
1013 break; 1013 break;
1014 1014
1015 case SCTP_DISPOSITION_VIOLATION: 1015 case SCTP_DISPOSITION_VIOLATION:
1016 printk(KERN_ERR "sctp protocol violation state %d " 1016 if (net_ratelimit())
1017 "chunkid %d\n", state, subtype.chunk); 1017 printk(KERN_ERR "sctp protocol violation state %d "
1018 "chunkid %d\n", state, subtype.chunk);
1018 break; 1019 break;
1019 1020
1020 case SCTP_DISPOSITION_NOT_IMPL: 1021 case SCTP_DISPOSITION_NOT_IMPL:
@@ -1130,6 +1131,9 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1130 /* Move the Cumulattive TSN Ack ahead. */ 1131 /* Move the Cumulattive TSN Ack ahead. */
1131 sctp_tsnmap_skip(&asoc->peer.tsn_map, cmd->obj.u32); 1132 sctp_tsnmap_skip(&asoc->peer.tsn_map, cmd->obj.u32);
1132 1133
1134 /* purge the fragmentation queue */
1135 sctp_ulpq_reasm_flushtsn(&asoc->ulpq, cmd->obj.u32);
1136
1133 /* Abort any in progress partial delivery. */ 1137 /* Abort any in progress partial delivery. */
1134 sctp_ulpq_abort_pd(&asoc->ulpq, GFP_ATOMIC); 1138 sctp_ulpq_abort_pd(&asoc->ulpq, GFP_ATOMIC);
1135 break; 1139 break;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 71cad56dd73f..177528ed3e1b 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -264,7 +264,6 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
264 struct sctp_chunk *err_chunk; 264 struct sctp_chunk *err_chunk;
265 struct sctp_packet *packet; 265 struct sctp_packet *packet;
266 sctp_unrecognized_param_t *unk_param; 266 sctp_unrecognized_param_t *unk_param;
267 struct sock *sk;
268 int len; 267 int len;
269 268
270 /* 6.10 Bundling 269 /* 6.10 Bundling
@@ -285,16 +284,6 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
285 if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) 284 if (ep == sctp_sk((sctp_get_ctl_sock()))->ep)
286 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); 285 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
287 286
288 sk = ep->base.sk;
289 /* If the endpoint is not listening or if the number of associations
290 * on the TCP-style socket exceed the max backlog, respond with an
291 * ABORT.
292 */
293 if (!sctp_sstate(sk, LISTENING) ||
294 (sctp_style(sk, TCP) &&
295 sk_acceptq_is_full(sk)))
296 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
297
298 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification 287 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification
299 * Tag. 288 * Tag.
300 */ 289 */
@@ -590,6 +579,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
590 struct sctp_ulpevent *ev, *ai_ev = NULL; 579 struct sctp_ulpevent *ev, *ai_ev = NULL;
591 int error = 0; 580 int error = 0;
592 struct sctp_chunk *err_chk_p; 581 struct sctp_chunk *err_chk_p;
582 struct sock *sk;
593 583
594 /* If the packet is an OOTB packet which is temporarily on the 584 /* If the packet is an OOTB packet which is temporarily on the
595 * control endpoint, respond with an ABORT. 585 * control endpoint, respond with an ABORT.
@@ -605,6 +595,15 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
605 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) 595 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
606 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 596 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
607 597
598 /* If the endpoint is not listening or if the number of associations
599 * on the TCP-style socket exceed the max backlog, respond with an
600 * ABORT.
601 */
602 sk = ep->base.sk;
603 if (!sctp_sstate(sk, LISTENING) ||
604 (sctp_style(sk, TCP) && sk_acceptq_is_full(sk)))
605 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
606
608 /* "Decode" the chunk. We have no optional parameters so we 607 /* "Decode" the chunk. We have no optional parameters so we
609 * are in good shape. 608 * are in good shape.
610 */ 609 */
@@ -1032,19 +1031,21 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1032 /* This should never happen, but lets log it if so. */ 1031 /* This should never happen, but lets log it if so. */
1033 if (unlikely(!link)) { 1032 if (unlikely(!link)) {
1034 if (from_addr.sa.sa_family == AF_INET6) { 1033 if (from_addr.sa.sa_family == AF_INET6) {
1035 printk(KERN_WARNING 1034 if (net_ratelimit())
1036 "%s association %p could not find address " 1035 printk(KERN_WARNING
1037 NIP6_FMT "\n", 1036 "%s association %p could not find address "
1038 __FUNCTION__, 1037 NIP6_FMT "\n",
1039 asoc, 1038 __FUNCTION__,
1040 NIP6(from_addr.v6.sin6_addr)); 1039 asoc,
1040 NIP6(from_addr.v6.sin6_addr));
1041 } else { 1041 } else {
1042 printk(KERN_WARNING 1042 if (net_ratelimit())
1043 "%s association %p could not find address " 1043 printk(KERN_WARNING
1044 NIPQUAD_FMT "\n", 1044 "%s association %p could not find address "
1045 __FUNCTION__, 1045 NIPQUAD_FMT "\n",
1046 asoc, 1046 __FUNCTION__,
1047 NIPQUAD(from_addr.v4.sin_addr.s_addr)); 1047 asoc,
1048 NIPQUAD(from_addr.v4.sin_addr.s_addr));
1048 } 1049 }
1049 return SCTP_DISPOSITION_DISCARD; 1050 return SCTP_DISPOSITION_DISCARD;
1050 } 1051 }
@@ -3362,7 +3363,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3362 abort = sctp_make_abort(asoc, asconf_ack, 3363 abort = sctp_make_abort(asoc, asconf_ack,
3363 sizeof(sctp_errhdr_t)); 3364 sizeof(sctp_errhdr_t));
3364 if (abort) { 3365 if (abort) {
3365 sctp_init_cause(abort, SCTP_ERROR_ASCONF_ACK, NULL, 0); 3366 sctp_init_cause(abort, SCTP_ERROR_ASCONF_ACK, 0);
3366 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, 3367 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
3367 SCTP_CHUNK(abort)); 3368 SCTP_CHUNK(abort));
3368 } 3369 }
@@ -3392,7 +3393,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3392 abort = sctp_make_abort(asoc, asconf_ack, 3393 abort = sctp_make_abort(asoc, asconf_ack,
3393 sizeof(sctp_errhdr_t)); 3394 sizeof(sctp_errhdr_t));
3394 if (abort) { 3395 if (abort) {
3395 sctp_init_cause(abort, SCTP_ERROR_RSRC_LOW, NULL, 0); 3396 sctp_init_cause(abort, SCTP_ERROR_RSRC_LOW, 0);
3396 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, 3397 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
3397 SCTP_CHUNK(abort)); 3398 SCTP_CHUNK(abort));
3398 } 3399 }
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 01c6364245b7..33354602ae86 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -353,6 +353,7 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
353 * The function sctp_get_port_local() does duplicate address 353 * The function sctp_get_port_local() does duplicate address
354 * detection. 354 * detection.
355 */ 355 */
356 addr->v4.sin_port = htons(snum);
356 if ((ret = sctp_get_port_local(sk, addr))) { 357 if ((ret = sctp_get_port_local(sk, addr))) {
357 if (ret == (long) sk) { 358 if (ret == (long) sk) {
358 /* This endpoint has a conflicting address. */ 359 /* This endpoint has a conflicting address. */
@@ -5202,6 +5203,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
5202 5203
5203 sctp_unhash_endpoint(ep); 5204 sctp_unhash_endpoint(ep);
5204 sk->sk_state = SCTP_SS_CLOSED; 5205 sk->sk_state = SCTP_SS_CLOSED;
5206 return 0;
5205 } 5207 }
5206 5208
5207 /* Return if we are already listening. */ 5209 /* Return if we are already listening. */
@@ -5249,6 +5251,7 @@ SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog)
5249 5251
5250 sctp_unhash_endpoint(ep); 5252 sctp_unhash_endpoint(ep);
5251 sk->sk_state = SCTP_SS_CLOSED; 5253 sk->sk_state = SCTP_SS_CLOSED;
5254 return 0;
5252 } 5255 }
5253 5256
5254 if (sctp_sstate(sk, LISTENING)) 5257 if (sctp_sstate(sk, LISTENING))
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 34eb977a204d..fa0ba2a5564e 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -659,6 +659,46 @@ done:
659 return retval; 659 return retval;
660} 660}
661 661
662/*
663 * Flush out stale fragments from the reassembly queue when processing
664 * a Forward TSN.
665 *
666 * RFC 3758, Section 3.6
667 *
668 * After receiving and processing a FORWARD TSN, the data receiver MUST
669 * take cautions in updating its re-assembly queue. The receiver MUST
670 * remove any partially reassembled message, which is still missing one
671 * or more TSNs earlier than or equal to the new cumulative TSN point.
672 * In the event that the receiver has invoked the partial delivery API,
673 * a notification SHOULD also be generated to inform the upper layer API
674 * that the message being partially delivered will NOT be completed.
675 */
676void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *ulpq, __u32 fwd_tsn)
677{
678 struct sk_buff *pos, *tmp;
679 struct sctp_ulpevent *event;
680 __u32 tsn;
681
682 if (skb_queue_empty(&ulpq->reasm))
683 return;
684
685 skb_queue_walk_safe(&ulpq->reasm, pos, tmp) {
686 event = sctp_skb2event(pos);
687 tsn = event->tsn;
688
689 /* Since the entire message must be abandoned by the
690 * sender (item A3 in Section 3.5, RFC 3758), we can
691 * free all fragments on the list that are less then
692 * or equal to ctsn_point
693 */
694 if (TSN_lte(tsn, fwd_tsn)) {
695 __skb_unlink(pos, &ulpq->reasm);
696 sctp_ulpevent_free(event);
697 } else
698 break;
699 }
700}
701
662/* Helper function to gather skbs that have possibly become 702/* Helper function to gather skbs that have possibly become
663 * ordered by an an incoming chunk. 703 * ordered by an an incoming chunk.
664 */ 704 */
@@ -794,7 +834,7 @@ static struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq,
794/* Helper function to gather skbs that have possibly become 834/* Helper function to gather skbs that have possibly become
795 * ordered by forward tsn skipping their dependencies. 835 * ordered by forward tsn skipping their dependencies.
796 */ 836 */
797static inline void sctp_ulpq_reap_ordered(struct sctp_ulpq *ulpq) 837static inline void sctp_ulpq_reap_ordered(struct sctp_ulpq *ulpq, __u16 sid)
798{ 838{
799 struct sk_buff *pos, *tmp; 839 struct sk_buff *pos, *tmp;
800 struct sctp_ulpevent *cevent; 840 struct sctp_ulpevent *cevent;
@@ -813,31 +853,40 @@ static inline void sctp_ulpq_reap_ordered(struct sctp_ulpq *ulpq)
813 csid = cevent->stream; 853 csid = cevent->stream;
814 cssn = cevent->ssn; 854 cssn = cevent->ssn;
815 855
816 if (cssn != sctp_ssn_peek(in, csid)) 856 /* Have we gone too far? */
857 if (csid > sid)
817 break; 858 break;
818 859
819 /* Found it, so mark in the ssnmap. */ 860 /* Have we not gone far enough? */
820 sctp_ssn_next(in, csid); 861 if (csid < sid)
862 continue;
863
864 /* see if this ssn has been marked by skipping */
865 if (!SSN_lt(cssn, sctp_ssn_peek(in, csid)))
866 break;
821 867
822 __skb_unlink(pos, &ulpq->lobby); 868 __skb_unlink(pos, &ulpq->lobby);
823 if (!event) { 869 if (!event)
824 /* Create a temporary list to collect chunks on. */ 870 /* Create a temporary list to collect chunks on. */
825 event = sctp_skb2event(pos); 871 event = sctp_skb2event(pos);
826 __skb_queue_tail(&temp, sctp_event2skb(event)); 872
827 } else { 873 /* Attach all gathered skbs to the event. */
828 /* Attach all gathered skbs to the event. */ 874 __skb_queue_tail(&temp, pos);
829 __skb_queue_tail(&temp, pos);
830 }
831 } 875 }
832 876
833 /* Send event to the ULP. 'event' is the sctp_ulpevent for 877 /* Send event to the ULP. 'event' is the sctp_ulpevent for
834 * very first SKB on the 'temp' list. 878 * very first SKB on the 'temp' list.
835 */ 879 */
836 if (event) 880 if (event) {
881 /* see if we have more ordered that we can deliver */
882 sctp_ulpq_retrieve_ordered(ulpq, event);
837 sctp_ulpq_tail_event(ulpq, event); 883 sctp_ulpq_tail_event(ulpq, event);
884 }
838} 885}
839 886
840/* Skip over an SSN. */ 887/* Skip over an SSN. This is used during the processing of
888 * Forwared TSN chunk to skip over the abandoned ordered data
889 */
841void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn) 890void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn)
842{ 891{
843 struct sctp_stream *in; 892 struct sctp_stream *in;
@@ -855,7 +904,7 @@ void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn)
855 /* Go find any other chunks that were waiting for 904 /* Go find any other chunks that were waiting for
856 * ordering and deliver them if needed. 905 * ordering and deliver them if needed.
857 */ 906 */
858 sctp_ulpq_reap_ordered(ulpq); 907 sctp_ulpq_reap_ordered(ulpq, sid);
859 return; 908 return;
860} 909}
861 910