diff options
43 files changed, 455 insertions, 561 deletions
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index 54e5f9b1536d..d02c64953dcd 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -44,7 +44,6 @@ | |||
44 | compiler and the textural representation of | 44 | compiler and the textural representation of |
45 | the tree that can be "compiled" by dtc. | 45 | the tree that can be "compiled" by dtc. |
46 | 46 | ||
47 | |||
48 | November 21, 2005: Rev 0.5 | 47 | November 21, 2005: Rev 0.5 |
49 | - Additions/generalizations for 32-bit | 48 | - Additions/generalizations for 32-bit |
50 | - Changed to reflect the new arch/powerpc | 49 | - Changed to reflect the new arch/powerpc |
@@ -1307,6 +1306,65 @@ platforms are moved over to use the flattened-device-tree model. | |||
1307 | }; | 1306 | }; |
1308 | 1307 | ||
1309 | 1308 | ||
1309 | f) Freescale SOC USB controllers | ||
1310 | |||
1311 | The device node for a USB controller that is part of a Freescale | ||
1312 | SOC is as described in the document "Open Firmware Recommended | ||
1313 | Practice : Universal Serial Bus" with the following modifications | ||
1314 | and additions : | ||
1315 | |||
1316 | Required properties : | ||
1317 | - compatible : Should be "fsl-usb2-mph" for multi port host usb | ||
1318 | controllers, or "fsl-usb2-dr" for dual role usb controllers | ||
1319 | - phy_type : For multi port host usb controllers, should be one of | ||
1320 | "ulpi", or "serial". For dual role usb controllers, should be | ||
1321 | one of "ulpi", "utmi", "utmi_wide", or "serial". | ||
1322 | - reg : Offset and length of the register set for the device | ||
1323 | - port0 : boolean; if defined, indicates port0 is connected for | ||
1324 | fsl-usb2-mph compatible controllers. Either this property or | ||
1325 | "port1" (or both) must be defined for "fsl-usb2-mph" compatible | ||
1326 | controllers. | ||
1327 | - port1 : boolean; if defined, indicates port1 is connected for | ||
1328 | fsl-usb2-mph compatible controllers. Either this property or | ||
1329 | "port0" (or both) must be defined for "fsl-usb2-mph" compatible | ||
1330 | controllers. | ||
1331 | |||
1332 | Recommended properties : | ||
1333 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1334 | field that represents an encoding of the sense and level | ||
1335 | information for the interrupt. This should be encoded based on | ||
1336 | the information in section 2) depending on the type of interrupt | ||
1337 | controller you have. | ||
1338 | - interrupt-parent : the phandle for the interrupt controller that | ||
1339 | services interrupts for this device. | ||
1340 | |||
1341 | Example multi port host usb controller device node : | ||
1342 | usb@22000 { | ||
1343 | device_type = "usb"; | ||
1344 | compatible = "fsl-usb2-mph"; | ||
1345 | reg = <22000 1000>; | ||
1346 | #address-cells = <1>; | ||
1347 | #size-cells = <0>; | ||
1348 | interrupt-parent = <700>; | ||
1349 | interrupts = <27 1>; | ||
1350 | phy_type = "ulpi"; | ||
1351 | port0; | ||
1352 | port1; | ||
1353 | }; | ||
1354 | |||
1355 | Example dual role usb controller device node : | ||
1356 | usb@23000 { | ||
1357 | device_type = "usb"; | ||
1358 | compatible = "fsl-usb2-dr"; | ||
1359 | reg = <23000 1000>; | ||
1360 | #address-cells = <1>; | ||
1361 | #size-cells = <0>; | ||
1362 | interrupt-parent = <700>; | ||
1363 | interrupts = <26 1>; | ||
1364 | phy = "ulpi"; | ||
1365 | }; | ||
1366 | |||
1367 | |||
1310 | More devices will be defined as this spec matures. | 1368 | More devices will be defined as this spec matures. |
1311 | 1369 | ||
1312 | 1370 | ||
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 1c316f14ed94..646a3a5d33a5 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
@@ -46,10 +46,11 @@ | |||
46 | #include <asm/irq.h> | 46 | #include <asm/irq.h> |
47 | #include <asm/mach-types.h> | 47 | #include <asm/mach-types.h> |
48 | 48 | ||
49 | //#include <asm/debug-ll.h> | 49 | |
50 | #include <asm/arch/regs-serial.h> | 50 | #include <asm/arch/regs-serial.h> |
51 | #include <asm/arch/regs-lcd.h> | 51 | #include <asm/arch/regs-lcd.h> |
52 | 52 | ||
53 | #include <asm/arch/h1940-latch.h> | ||
53 | #include <asm/arch/fb.h> | 54 | #include <asm/arch/fb.h> |
54 | 55 | ||
55 | #include <linux/serial_core.h> | 56 | #include <linux/serial_core.h> |
@@ -59,7 +60,12 @@ | |||
59 | #include "cpu.h" | 60 | #include "cpu.h" |
60 | 61 | ||
61 | static struct map_desc h1940_iodesc[] __initdata = { | 62 | static struct map_desc h1940_iodesc[] __initdata = { |
62 | /* nothing here yet */ | 63 | [0] = { |
64 | .virtual = (unsigned long)H1940_LATCH, | ||
65 | .pfn = __phys_to_pfn(H1940_PA_LATCH), | ||
66 | .length = SZ_16K, | ||
67 | .type = MT_DEVICE | ||
68 | }, | ||
63 | }; | 69 | }; |
64 | 70 | ||
65 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK | 71 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK |
@@ -92,6 +98,25 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { | |||
92 | } | 98 | } |
93 | }; | 99 | }; |
94 | 100 | ||
101 | /* Board control latch control */ | ||
102 | |||
103 | static unsigned int latch_state = H1940_LATCH_DEFAULT; | ||
104 | |||
105 | void h1940_latch_control(unsigned int clear, unsigned int set) | ||
106 | { | ||
107 | unsigned long flags; | ||
108 | |||
109 | local_irq_save(flags); | ||
110 | |||
111 | latch_state &= ~clear; | ||
112 | latch_state |= set; | ||
113 | |||
114 | __raw_writel(latch_state, H1940_LATCH); | ||
115 | |||
116 | local_irq_restore(flags); | ||
117 | } | ||
118 | |||
119 | EXPORT_SYMBOL_GPL(h1940_latch_control); | ||
95 | 120 | ||
96 | 121 | ||
97 | /** | 122 | /** |
diff --git a/arch/arm/mach-s3c2410/s3c2400.h b/arch/arm/mach-s3c2410/s3c2400.h new file mode 100644 index 000000000000..8b2394e1ed40 --- /dev/null +++ b/arch/arm/mach-s3c2410/s3c2400.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* arch/arm/mach-s3c2410/s3c2400.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for S3C2400 cpu support | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * Modifications: | ||
13 | * 09-Fev-2006 LCVR First version, based on s3c2410.h | ||
14 | */ | ||
15 | |||
16 | #ifdef CONFIG_CPU_S3C2400 | ||
17 | |||
18 | extern int s3c2400_init(void); | ||
19 | |||
20 | extern void s3c2400_map_io(struct map_desc *mach_desc, int size); | ||
21 | |||
22 | extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
23 | |||
24 | extern void s3c2400_init_clocks(int xtal); | ||
25 | |||
26 | #else | ||
27 | #define s3c2400_init_clocks NULL | ||
28 | #define s3c2400_init_uarts NULL | ||
29 | #define s3c2400_map_io NULL | ||
30 | #define s3c2400_init NULL | ||
31 | #endif | ||
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 255adb498268..fb00ab7b7612 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -87,11 +87,7 @@ EXPORT_SYMBOL(cpu_online_map); | |||
87 | cpumask_t cpu_callin_map; | 87 | cpumask_t cpu_callin_map; |
88 | cpumask_t cpu_callout_map; | 88 | cpumask_t cpu_callout_map; |
89 | EXPORT_SYMBOL(cpu_callout_map); | 89 | EXPORT_SYMBOL(cpu_callout_map); |
90 | #ifdef CONFIG_HOTPLUG_CPU | ||
91 | cpumask_t cpu_possible_map = CPU_MASK_ALL; | ||
92 | #else | ||
93 | cpumask_t cpu_possible_map; | 90 | cpumask_t cpu_possible_map; |
94 | #endif | ||
95 | EXPORT_SYMBOL(cpu_possible_map); | 91 | EXPORT_SYMBOL(cpu_possible_map); |
96 | static cpumask_t smp_commenced_mask; | 92 | static cpumask_t smp_commenced_mask; |
97 | 93 | ||
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c index 72a1b9cae2e4..6e4c3baef6cc 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/i386/mach-voyager/voyager_smp.c | |||
@@ -240,7 +240,7 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE; | |||
240 | cpumask_t cpu_callin_map = CPU_MASK_NONE; | 240 | cpumask_t cpu_callin_map = CPU_MASK_NONE; |
241 | cpumask_t cpu_callout_map = CPU_MASK_NONE; | 241 | cpumask_t cpu_callout_map = CPU_MASK_NONE; |
242 | EXPORT_SYMBOL(cpu_callout_map); | 242 | EXPORT_SYMBOL(cpu_callout_map); |
243 | cpumask_t cpu_possible_map = CPU_MASK_ALL; | 243 | cpumask_t cpu_possible_map = CPU_MASK_NONE; |
244 | EXPORT_SYMBOL(cpu_possible_map); | 244 | EXPORT_SYMBOL(cpu_possible_map); |
245 | 245 | ||
246 | /* The per processor IRQ masks (these are usually kept in sync) */ | 246 | /* The per processor IRQ masks (these are usually kept in sync) */ |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index df338c5cc910..80d114a3a837 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -83,6 +83,12 @@ config GENERIC_TBSYNC | |||
83 | default y if PPC32 && SMP | 83 | default y if PPC32 && SMP |
84 | default n | 84 | default n |
85 | 85 | ||
86 | config DEFAULT_UIMAGE | ||
87 | bool | ||
88 | help | ||
89 | Used to allow a board to specify it wants a uImage built by default | ||
90 | default n | ||
91 | |||
86 | menu "Processor support" | 92 | menu "Processor support" |
87 | choice | 93 | choice |
88 | prompt "Processor Type" | 94 | prompt "Processor Type" |
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 44dd82b791d1..5500ab55d042 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -142,6 +142,7 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ | |||
142 | # Default to zImage, override when needed | 142 | # Default to zImage, override when needed |
143 | defaultimage-y := zImage | 143 | defaultimage-y := zImage |
144 | defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux | 144 | defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux |
145 | defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage | ||
145 | KBUILD_IMAGE := $(defaultimage-y) | 146 | KBUILD_IMAGE := $(defaultimage-y) |
146 | all: $(KBUILD_IMAGE) | 147 | all: $(KBUILD_IMAGE) |
147 | 148 | ||
@@ -167,6 +168,8 @@ endef | |||
167 | 168 | ||
168 | archclean: | 169 | archclean: |
169 | $(Q)$(MAKE) $(clean)=$(boot) | 170 | $(Q)$(MAKE) $(clean)=$(boot) |
171 | |||
172 | archmrproper: | ||
170 | $(Q)rm -rf arch/$(ARCH)/include | 173 | $(Q)rm -rf arch/$(ARCH)/include |
171 | 174 | ||
172 | archprepare: checkbin | 175 | archprepare: checkbin |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index c287980b7e65..80e9fe2632b8 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -12,10 +12,10 @@ endif | |||
12 | 12 | ||
13 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ | 13 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ |
14 | irq.o align.o signal_32.o pmc.o vdso.o \ | 14 | irq.o align.o signal_32.o pmc.o vdso.o \ |
15 | init_task.o process.o | 15 | init_task.o process.o systbl.o |
16 | obj-y += vdso32/ | 16 | obj-y += vdso32/ |
17 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ | 17 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ |
18 | signal_64.o ptrace32.o systbl.o \ | 18 | signal_64.o ptrace32.o \ |
19 | paca.o cpu_setup_power4.o \ | 19 | paca.o cpu_setup_power4.o \ |
20 | firmware.o sysfs.o idle_64.o | 20 | firmware.o sysfs.o idle_64.o |
21 | obj-$(CONFIG_PPC64) += vdso64/ | 21 | obj-$(CONFIG_PPC64) += vdso64/ |
@@ -46,7 +46,7 @@ extra-$(CONFIG_8xx) := head_8xx.o | |||
46 | extra-y += vmlinux.lds | 46 | extra-y += vmlinux.lds |
47 | 47 | ||
48 | obj-y += time.o prom.o traps.o setup-common.o udbg.o | 48 | obj-y += time.o prom.o traps.o setup-common.o udbg.o |
49 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o | 49 | obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o |
50 | obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o | 50 | obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o |
51 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o | 51 | obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o |
52 | obj-$(CONFIG_MODULES) += ppc_ksyms.o | 52 | obj-$(CONFIG_MODULES) += ppc_ksyms.o |
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S index 007b15ee36d2..8a9f994ed917 100644 --- a/arch/powerpc/kernel/systbl.S +++ b/arch/powerpc/kernel/systbl.S | |||
@@ -36,8 +36,6 @@ | |||
36 | #ifdef CONFIG_PPC64 | 36 | #ifdef CONFIG_PPC64 |
37 | #define sys_sigpending sys_ni_syscall | 37 | #define sys_sigpending sys_ni_syscall |
38 | #define sys_old_getrlimit sys_ni_syscall | 38 | #define sys_old_getrlimit sys_ni_syscall |
39 | #else | ||
40 | #define ppc_rtas sys_ni_syscall | ||
41 | #endif | 39 | #endif |
42 | 40 | ||
43 | _GLOBAL(sys_call_table) | 41 | _GLOBAL(sys_call_table) |
@@ -323,3 +321,4 @@ SYSCALL(spu_run) | |||
323 | SYSCALL(spu_create) | 321 | SYSCALL(spu_create) |
324 | COMPAT_SYS(pselect6) | 322 | COMPAT_SYS(pselect6) |
325 | COMPAT_SYS(ppoll) | 323 | COMPAT_SYS(ppoll) |
324 | SYSCALL(unshare) | ||
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S index c3427eed8345..5a936566fd61 100644 --- a/arch/ppc/kernel/misc.S +++ b/arch/ppc/kernel/misc.S | |||
@@ -1048,286 +1048,3 @@ _GLOBAL(name) \ | |||
1048 | blr | 1048 | blr |
1049 | 1049 | ||
1050 | SYSCALL(execve) | 1050 | SYSCALL(execve) |
1051 | |||
1052 | /* Why isn't this a) automatic, b) written in 'C'? */ | ||
1053 | .data | ||
1054 | .align 4 | ||
1055 | _GLOBAL(sys_call_table) | ||
1056 | .long sys_restart_syscall /* 0 */ | ||
1057 | .long sys_exit | ||
1058 | .long ppc_fork | ||
1059 | .long sys_read | ||
1060 | .long sys_write | ||
1061 | .long sys_open /* 5 */ | ||
1062 | .long sys_close | ||
1063 | .long sys_waitpid | ||
1064 | .long sys_creat | ||
1065 | .long sys_link | ||
1066 | .long sys_unlink /* 10 */ | ||
1067 | .long sys_execve | ||
1068 | .long sys_chdir | ||
1069 | .long sys_time | ||
1070 | .long sys_mknod | ||
1071 | .long sys_chmod /* 15 */ | ||
1072 | .long sys_lchown | ||
1073 | .long sys_ni_syscall /* old break syscall holder */ | ||
1074 | .long sys_stat | ||
1075 | .long sys_lseek | ||
1076 | .long sys_getpid /* 20 */ | ||
1077 | .long sys_mount | ||
1078 | .long sys_oldumount | ||
1079 | .long sys_setuid | ||
1080 | .long sys_getuid | ||
1081 | .long sys_stime /* 25 */ | ||
1082 | .long sys_ptrace | ||
1083 | .long sys_alarm | ||
1084 | .long sys_fstat | ||
1085 | .long sys_pause | ||
1086 | .long sys_utime /* 30 */ | ||
1087 | .long sys_ni_syscall /* old stty syscall holder */ | ||
1088 | .long sys_ni_syscall /* old gtty syscall holder */ | ||
1089 | .long sys_access | ||
1090 | .long sys_nice | ||
1091 | .long sys_ni_syscall /* 35 */ /* old ftime syscall holder */ | ||
1092 | .long sys_sync | ||
1093 | .long sys_kill | ||
1094 | .long sys_rename | ||
1095 | .long sys_mkdir | ||
1096 | .long sys_rmdir /* 40 */ | ||
1097 | .long sys_dup | ||
1098 | .long sys_pipe | ||
1099 | .long sys_times | ||
1100 | .long sys_ni_syscall /* old prof syscall holder */ | ||
1101 | .long sys_brk /* 45 */ | ||
1102 | .long sys_setgid | ||
1103 | .long sys_getgid | ||
1104 | .long sys_signal | ||
1105 | .long sys_geteuid | ||
1106 | .long sys_getegid /* 50 */ | ||
1107 | .long sys_acct | ||
1108 | .long sys_umount /* recycled never used phys() */ | ||
1109 | .long sys_ni_syscall /* old lock syscall holder */ | ||
1110 | .long sys_ioctl | ||
1111 | .long sys_fcntl /* 55 */ | ||
1112 | .long sys_ni_syscall /* old mpx syscall holder */ | ||
1113 | .long sys_setpgid | ||
1114 | .long sys_ni_syscall /* old ulimit syscall holder */ | ||
1115 | .long sys_olduname | ||
1116 | .long sys_umask /* 60 */ | ||
1117 | .long sys_chroot | ||
1118 | .long sys_ustat | ||
1119 | .long sys_dup2 | ||
1120 | .long sys_getppid | ||
1121 | .long sys_getpgrp /* 65 */ | ||
1122 | .long sys_setsid | ||
1123 | .long sys_sigaction | ||
1124 | .long sys_sgetmask | ||
1125 | .long sys_ssetmask | ||
1126 | .long sys_setreuid /* 70 */ | ||
1127 | .long sys_setregid | ||
1128 | .long sys_sigsuspend | ||
1129 | .long sys_sigpending | ||
1130 | .long sys_sethostname | ||
1131 | .long sys_setrlimit /* 75 */ | ||
1132 | .long sys_old_getrlimit | ||
1133 | .long sys_getrusage | ||
1134 | .long sys_gettimeofday | ||
1135 | .long sys_settimeofday | ||
1136 | .long sys_getgroups /* 80 */ | ||
1137 | .long sys_setgroups | ||
1138 | .long ppc_select | ||
1139 | .long sys_symlink | ||
1140 | .long sys_lstat | ||
1141 | .long sys_readlink /* 85 */ | ||
1142 | .long sys_uselib | ||
1143 | .long sys_swapon | ||
1144 | .long sys_reboot | ||
1145 | .long old_readdir | ||
1146 | .long sys_mmap /* 90 */ | ||
1147 | .long sys_munmap | ||
1148 | .long sys_truncate | ||
1149 | .long sys_ftruncate | ||
1150 | .long sys_fchmod | ||
1151 | .long sys_fchown /* 95 */ | ||
1152 | .long sys_getpriority | ||
1153 | .long sys_setpriority | ||
1154 | .long sys_ni_syscall /* old profil syscall holder */ | ||
1155 | .long sys_statfs | ||
1156 | .long sys_fstatfs /* 100 */ | ||
1157 | .long sys_ni_syscall | ||
1158 | .long sys_socketcall | ||
1159 | .long sys_syslog | ||
1160 | .long sys_setitimer | ||
1161 | .long sys_getitimer /* 105 */ | ||
1162 | .long sys_newstat | ||
1163 | .long sys_newlstat | ||
1164 | .long sys_newfstat | ||
1165 | .long sys_uname | ||
1166 | .long sys_ni_syscall /* 110 */ | ||
1167 | .long sys_vhangup | ||
1168 | .long sys_ni_syscall /* old 'idle' syscall */ | ||
1169 | .long sys_ni_syscall | ||
1170 | .long sys_wait4 | ||
1171 | .long sys_swapoff /* 115 */ | ||
1172 | .long sys_sysinfo | ||
1173 | .long sys_ipc | ||
1174 | .long sys_fsync | ||
1175 | .long sys_sigreturn | ||
1176 | .long ppc_clone /* 120 */ | ||
1177 | .long sys_setdomainname | ||
1178 | .long sys_newuname | ||
1179 | .long sys_ni_syscall | ||
1180 | .long sys_adjtimex | ||
1181 | .long sys_mprotect /* 125 */ | ||
1182 | .long sys_sigprocmask | ||
1183 | .long sys_ni_syscall /* old sys_create_module */ | ||
1184 | .long sys_init_module | ||
1185 | .long sys_delete_module | ||
1186 | .long sys_ni_syscall /* old sys_get_kernel_syms */ /* 130 */ | ||
1187 | .long sys_quotactl | ||
1188 | .long sys_getpgid | ||
1189 | .long sys_fchdir | ||
1190 | .long sys_bdflush | ||
1191 | .long sys_sysfs /* 135 */ | ||
1192 | .long sys_personality | ||
1193 | .long sys_ni_syscall /* for afs_syscall */ | ||
1194 | .long sys_setfsuid | ||
1195 | .long sys_setfsgid | ||
1196 | .long sys_llseek /* 140 */ | ||
1197 | .long sys_getdents | ||
1198 | .long ppc_select | ||
1199 | .long sys_flock | ||
1200 | .long sys_msync | ||
1201 | .long sys_readv /* 145 */ | ||
1202 | .long sys_writev | ||
1203 | .long sys_getsid | ||
1204 | .long sys_fdatasync | ||
1205 | .long sys_sysctl | ||
1206 | .long sys_mlock /* 150 */ | ||
1207 | .long sys_munlock | ||
1208 | .long sys_mlockall | ||
1209 | .long sys_munlockall | ||
1210 | .long sys_sched_setparam | ||
1211 | .long sys_sched_getparam /* 155 */ | ||
1212 | .long sys_sched_setscheduler | ||
1213 | .long sys_sched_getscheduler | ||
1214 | .long sys_sched_yield | ||
1215 | .long sys_sched_get_priority_max | ||
1216 | .long sys_sched_get_priority_min /* 160 */ | ||
1217 | .long sys_sched_rr_get_interval | ||
1218 | .long sys_nanosleep | ||
1219 | .long sys_mremap | ||
1220 | .long sys_setresuid | ||
1221 | .long sys_getresuid /* 165 */ | ||
1222 | .long sys_ni_syscall /* old sys_query_module */ | ||
1223 | .long sys_poll | ||
1224 | .long sys_nfsservctl | ||
1225 | .long sys_setresgid | ||
1226 | .long sys_getresgid /* 170 */ | ||
1227 | .long sys_prctl | ||
1228 | .long sys_rt_sigreturn | ||
1229 | .long sys_rt_sigaction | ||
1230 | .long sys_rt_sigprocmask | ||
1231 | .long sys_rt_sigpending /* 175 */ | ||
1232 | .long sys_rt_sigtimedwait | ||
1233 | .long sys_rt_sigqueueinfo | ||
1234 | .long sys_rt_sigsuspend | ||
1235 | .long sys_pread64 | ||
1236 | .long sys_pwrite64 /* 180 */ | ||
1237 | .long sys_chown | ||
1238 | .long sys_getcwd | ||
1239 | .long sys_capget | ||
1240 | .long sys_capset | ||
1241 | .long sys_sigaltstack /* 185 */ | ||
1242 | .long sys_sendfile | ||
1243 | .long sys_ni_syscall /* streams1 */ | ||
1244 | .long sys_ni_syscall /* streams2 */ | ||
1245 | .long ppc_vfork | ||
1246 | .long sys_getrlimit /* 190 */ | ||
1247 | .long sys_readahead | ||
1248 | .long sys_mmap2 | ||
1249 | .long sys_truncate64 | ||
1250 | .long sys_ftruncate64 | ||
1251 | .long sys_stat64 /* 195 */ | ||
1252 | .long sys_lstat64 | ||
1253 | .long sys_fstat64 | ||
1254 | .long sys_pciconfig_read | ||
1255 | .long sys_pciconfig_write | ||
1256 | .long sys_pciconfig_iobase /* 200 */ | ||
1257 | .long sys_ni_syscall /* 201 - reserved - MacOnLinux - new */ | ||
1258 | .long sys_getdents64 | ||
1259 | .long sys_pivot_root | ||
1260 | .long sys_fcntl64 | ||
1261 | .long sys_madvise /* 205 */ | ||
1262 | .long sys_mincore | ||
1263 | .long sys_gettid | ||
1264 | .long sys_tkill | ||
1265 | .long sys_setxattr | ||
1266 | .long sys_lsetxattr /* 210 */ | ||
1267 | .long sys_fsetxattr | ||
1268 | .long sys_getxattr | ||
1269 | .long sys_lgetxattr | ||
1270 | .long sys_fgetxattr | ||
1271 | .long sys_listxattr /* 215 */ | ||
1272 | .long sys_llistxattr | ||
1273 | .long sys_flistxattr | ||
1274 | .long sys_removexattr | ||
1275 | .long sys_lremovexattr | ||
1276 | .long sys_fremovexattr /* 220 */ | ||
1277 | .long sys_futex | ||
1278 | .long sys_sched_setaffinity | ||
1279 | .long sys_sched_getaffinity | ||
1280 | .long sys_ni_syscall | ||
1281 | .long sys_ni_syscall /* 225 - reserved for Tux */ | ||
1282 | .long sys_sendfile64 | ||
1283 | .long sys_io_setup | ||
1284 | .long sys_io_destroy | ||
1285 | .long sys_io_getevents | ||
1286 | .long sys_io_submit /* 230 */ | ||
1287 | .long sys_io_cancel | ||
1288 | .long sys_set_tid_address | ||
1289 | .long sys_fadvise64 | ||
1290 | .long sys_exit_group | ||
1291 | .long sys_lookup_dcookie /* 235 */ | ||
1292 | .long sys_epoll_create | ||
1293 | .long sys_epoll_ctl | ||
1294 | .long sys_epoll_wait | ||
1295 | .long sys_remap_file_pages | ||
1296 | .long sys_timer_create /* 240 */ | ||
1297 | .long sys_timer_settime | ||
1298 | .long sys_timer_gettime | ||
1299 | .long sys_timer_getoverrun | ||
1300 | .long sys_timer_delete | ||
1301 | .long sys_clock_settime /* 245 */ | ||
1302 | .long sys_clock_gettime | ||
1303 | .long sys_clock_getres | ||
1304 | .long sys_clock_nanosleep | ||
1305 | .long sys_swapcontext | ||
1306 | .long sys_tgkill /* 250 */ | ||
1307 | .long sys_utimes | ||
1308 | .long sys_statfs64 | ||
1309 | .long sys_fstatfs64 | ||
1310 | .long ppc_fadvise64_64 | ||
1311 | .long sys_ni_syscall /* 255 - rtas (used on ppc64) */ | ||
1312 | .long sys_debug_setcontext | ||
1313 | .long sys_ni_syscall /* 257 reserved for vserver */ | ||
1314 | .long sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */ | ||
1315 | .long sys_ni_syscall /* 259 reserved for new sys_mbind */ | ||
1316 | .long sys_ni_syscall /* 260 reserved for new sys_get_mempolicy */ | ||
1317 | .long sys_ni_syscall /* 261 reserved for new sys_set_mempolicy */ | ||
1318 | .long sys_mq_open | ||
1319 | .long sys_mq_unlink | ||
1320 | .long sys_mq_timedsend | ||
1321 | .long sys_mq_timedreceive /* 265 */ | ||
1322 | .long sys_mq_notify | ||
1323 | .long sys_mq_getsetattr | ||
1324 | .long sys_kexec_load | ||
1325 | .long sys_add_key | ||
1326 | .long sys_request_key /* 270 */ | ||
1327 | .long sys_keyctl | ||
1328 | .long sys_waitid | ||
1329 | .long sys_ioprio_set | ||
1330 | .long sys_ioprio_get | ||
1331 | .long sys_inotify_init /* 275 */ | ||
1332 | .long sys_inotify_add_watch | ||
1333 | .long sys_inotify_rm_watch | ||
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index ef706694a0c1..5291b5f8788d 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -195,9 +195,6 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act, | |||
195 | return ret; | 195 | return ret; |
196 | } | 196 | } |
197 | 197 | ||
198 | int | ||
199 | do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact); | ||
200 | |||
201 | asmlinkage long | 198 | asmlinkage long |
202 | sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, | 199 | sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, |
203 | struct sigaction32 __user *oact, size_t sigsetsize) | 200 | struct sigaction32 __user *oact, size_t sigsetsize) |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 076e07c1da38..a23816d3e9a1 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -268,6 +268,8 @@ static struct tty_buffer *tty_buffer_alloc(size_t size) | |||
268 | p->size = size; | 268 | p->size = size; |
269 | p->next = NULL; | 269 | p->next = NULL; |
270 | p->active = 0; | 270 | p->active = 0; |
271 | p->commit = 0; | ||
272 | p->read = 0; | ||
271 | p->char_buf_ptr = (char *)(p->data); | 273 | p->char_buf_ptr = (char *)(p->data); |
272 | p->flag_buf_ptr = (unsigned char *)p->char_buf_ptr + size; | 274 | p->flag_buf_ptr = (unsigned char *)p->char_buf_ptr + size; |
273 | /* printk("Flip create %p\n", p); */ | 275 | /* printk("Flip create %p\n", p); */ |
@@ -298,6 +300,8 @@ static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size) | |||
298 | *tbh = t->next; | 300 | *tbh = t->next; |
299 | t->next = NULL; | 301 | t->next = NULL; |
300 | t->used = 0; | 302 | t->used = 0; |
303 | t->commit = 0; | ||
304 | t->read = 0; | ||
301 | /* DEBUG ONLY */ | 305 | /* DEBUG ONLY */ |
302 | memset(t->data, '*', size); | 306 | memset(t->data, '*', size); |
303 | /* printk("Flip recycle %p\n", t); */ | 307 | /* printk("Flip recycle %p\n", t); */ |
@@ -335,6 +339,7 @@ int tty_buffer_request_room(struct tty_struct *tty, size_t size) | |||
335 | if (b != NULL) { | 339 | if (b != NULL) { |
336 | b->next = n; | 340 | b->next = n; |
337 | b->active = 0; | 341 | b->active = 0; |
342 | b->commit = b->used; | ||
338 | } else | 343 | } else |
339 | tty->buf.head = n; | 344 | tty->buf.head = n; |
340 | tty->buf.tail = n; | 345 | tty->buf.tail = n; |
@@ -2752,6 +2757,9 @@ static void flush_to_ldisc(void *private_) | |||
2752 | unsigned long flags; | 2757 | unsigned long flags; |
2753 | struct tty_ldisc *disc; | 2758 | struct tty_ldisc *disc; |
2754 | struct tty_buffer *tbuf; | 2759 | struct tty_buffer *tbuf; |
2760 | int count; | ||
2761 | char *char_buf; | ||
2762 | unsigned char *flag_buf; | ||
2755 | 2763 | ||
2756 | disc = tty_ldisc_ref(tty); | 2764 | disc = tty_ldisc_ref(tty); |
2757 | if (disc == NULL) /* !TTY_LDISC */ | 2765 | if (disc == NULL) /* !TTY_LDISC */ |
@@ -2765,16 +2773,20 @@ static void flush_to_ldisc(void *private_) | |||
2765 | goto out; | 2773 | goto out; |
2766 | } | 2774 | } |
2767 | spin_lock_irqsave(&tty->buf.lock, flags); | 2775 | spin_lock_irqsave(&tty->buf.lock, flags); |
2768 | while((tbuf = tty->buf.head) != NULL && !tbuf->active) { | 2776 | while((tbuf = tty->buf.head) != NULL) { |
2777 | while ((count = tbuf->commit - tbuf->read) != 0) { | ||
2778 | char_buf = tbuf->char_buf_ptr + tbuf->read; | ||
2779 | flag_buf = tbuf->flag_buf_ptr + tbuf->read; | ||
2780 | tbuf->read += count; | ||
2781 | spin_unlock_irqrestore(&tty->buf.lock, flags); | ||
2782 | disc->receive_buf(tty, char_buf, flag_buf, count); | ||
2783 | spin_lock_irqsave(&tty->buf.lock, flags); | ||
2784 | } | ||
2785 | if (tbuf->active) | ||
2786 | break; | ||
2769 | tty->buf.head = tbuf->next; | 2787 | tty->buf.head = tbuf->next; |
2770 | if (tty->buf.head == NULL) | 2788 | if (tty->buf.head == NULL) |
2771 | tty->buf.tail = NULL; | 2789 | tty->buf.tail = NULL; |
2772 | spin_unlock_irqrestore(&tty->buf.lock, flags); | ||
2773 | /* printk("Process buffer %p for %d\n", tbuf, tbuf->used); */ | ||
2774 | disc->receive_buf(tty, tbuf->char_buf_ptr, | ||
2775 | tbuf->flag_buf_ptr, | ||
2776 | tbuf->used); | ||
2777 | spin_lock_irqsave(&tty->buf.lock, flags); | ||
2778 | tty_buffer_free(tty, tbuf); | 2790 | tty_buffer_free(tty, tbuf); |
2779 | } | 2791 | } |
2780 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 2792 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
@@ -2871,8 +2883,10 @@ void tty_flip_buffer_push(struct tty_struct *tty) | |||
2871 | { | 2883 | { |
2872 | unsigned long flags; | 2884 | unsigned long flags; |
2873 | spin_lock_irqsave(&tty->buf.lock, flags); | 2885 | spin_lock_irqsave(&tty->buf.lock, flags); |
2874 | if (tty->buf.tail != NULL) | 2886 | if (tty->buf.tail != NULL) { |
2875 | tty->buf.tail->active = 0; | 2887 | tty->buf.tail->active = 0; |
2888 | tty->buf.tail->commit = tty->buf.tail->used; | ||
2889 | } | ||
2876 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 2890 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
2877 | 2891 | ||
2878 | if (tty->low_latency) | 2892 | if (tty->low_latency) |
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 233a4f608084..ef85d76575a2 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -148,7 +148,7 @@ config IPW2100 | |||
148 | In order to use this driver, you will need a firmware image for it. | 148 | In order to use this driver, you will need a firmware image for it. |
149 | You can obtain the firmware from | 149 | You can obtain the firmware from |
150 | <http://ipw2100.sf.net/>. Once you have the firmware image, you | 150 | <http://ipw2100.sf.net/>. Once you have the firmware image, you |
151 | will need to place it in /etc/firmware. | 151 | will need to place it in /lib/firmware. |
152 | 152 | ||
153 | You will also very likely need the Wireless Tools in order to | 153 | You will also very likely need the Wireless Tools in order to |
154 | configure your card: | 154 | configure your card: |
diff --git a/include/asm-arm/arch-s3c2410/h1940-latch.h b/include/asm-arm/arch-s3c2410/h1940-latch.h new file mode 100644 index 000000000000..c5802411f43d --- /dev/null +++ b/include/asm-arm/arch-s3c2410/h1940-latch.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/h1940-latch.h | ||
2 | * | ||
3 | * (c) 2005 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * iPAQ H1940 series - latch definitions | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_H1940_LATCH_H | ||
15 | #define __ASM_ARCH_H1940_LATCH_H | ||
16 | |||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | #define H1940_LATCH ((void __iomem *)0xF8000000) | ||
20 | #else | ||
21 | #define H1940_LATCH 0xF8000000 | ||
22 | #endif | ||
23 | |||
24 | #define H1940_PA_LATCH (S3C2410_CS2) | ||
25 | |||
26 | /* SD layer latch */ | ||
27 | |||
28 | #define H1940_LATCH_SDQ1 (1<<16) | ||
29 | #define H1940_LATCH_LCD_P1 (1<<17) | ||
30 | #define H1940_LATCH_LCD_P2 (1<<18) | ||
31 | #define H1940_LATCH_LCD_P3 (1<<19) | ||
32 | #define H1940_LATCH_MAX1698_nSHUTDOWN (1<<20) /* LCD backlight */ | ||
33 | #define H1940_LATCH_LED_RED (1<<21) | ||
34 | #define H1940_LATCH_SDQ7 (1<<22) | ||
35 | #define H1940_LATCH_USB_DP (1<<23) | ||
36 | |||
37 | /* CPU layer latch */ | ||
38 | |||
39 | #define H1940_LATCH_UDA_POWER (1<<24) | ||
40 | #define H1940_LATCH_AUDIO_POWER (1<<25) | ||
41 | #define H1940_LATCH_SM803_ENABLE (1<<26) | ||
42 | #define H1940_LATCH_LCD_P4 (1<<27) | ||
43 | #define H1940_LATCH_CPUQ5 (1<<28) /* untraced */ | ||
44 | #define H1940_LATCH_BLUETOOTH_POWER (1<<29) /* active high */ | ||
45 | #define H1940_LATCH_LED_GREEN (1<<30) | ||
46 | #define H1940_LATCH_LED_FLASH (1<<31) | ||
47 | |||
48 | /* default settings */ | ||
49 | |||
50 | #define H1940_LATCH_DEFAULT \ | ||
51 | H1940_LATCH_LCD_P4 | \ | ||
52 | H1940_LATCH_SM803_ENABLE | \ | ||
53 | H1940_LATCH_SDQ1 | \ | ||
54 | H1940_LATCH_LCD_P1 | \ | ||
55 | H1940_LATCH_LCD_P2 | \ | ||
56 | H1940_LATCH_LCD_P3 | \ | ||
57 | H1940_LATCH_MAX1698_nSHUTDOWN | \ | ||
58 | H1940_LATCH_CPUQ5 | ||
59 | |||
60 | /* control functions */ | ||
61 | |||
62 | extern void h1940_latch_control(unsigned int clear, unsigned int set); | ||
63 | |||
64 | #endif /* __ASM_ARCH_H1940_LATCH_H */ | ||
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index a40cdff21a88..35556993f066 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -300,8 +300,9 @@ | |||
300 | #define __NR_spu_create 279 | 300 | #define __NR_spu_create 279 |
301 | #define __NR_pselect6 280 | 301 | #define __NR_pselect6 280 |
302 | #define __NR_ppoll 281 | 302 | #define __NR_ppoll 281 |
303 | #define __NR_unshare 282 | ||
303 | 304 | ||
304 | #define __NR_syscalls 282 | 305 | #define __NR_syscalls 283 |
305 | 306 | ||
306 | #ifdef __KERNEL__ | 307 | #ifdef __KERNEL__ |
307 | #define __NR__exit __NR_exit | 308 | #define __NR__exit __NR_exit |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 20b446f26ecd..60e56c6e03dd 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -328,7 +328,7 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | |||
328 | * bitmap of size NR_CPUS. | 328 | * bitmap of size NR_CPUS. |
329 | * | 329 | * |
330 | * #ifdef CONFIG_HOTPLUG_CPU | 330 | * #ifdef CONFIG_HOTPLUG_CPU |
331 | * cpu_possible_map - all NR_CPUS bits set | 331 | * cpu_possible_map - has bit 'cpu' set iff cpu is populatable |
332 | * cpu_present_map - has bit 'cpu' set iff cpu is populated | 332 | * cpu_present_map - has bit 'cpu' set iff cpu is populated |
333 | * cpu_online_map - has bit 'cpu' set iff cpu available to scheduler | 333 | * cpu_online_map - has bit 'cpu' set iff cpu available to scheduler |
334 | * #else | 334 | * #else |
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 3aed37314ab8..e87c32a5c86a 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -153,8 +153,10 @@ static inline void con_schedule_flip(struct tty_struct *t) | |||
153 | { | 153 | { |
154 | unsigned long flags; | 154 | unsigned long flags; |
155 | spin_lock_irqsave(&t->buf.lock, flags); | 155 | spin_lock_irqsave(&t->buf.lock, flags); |
156 | if (t->buf.tail != NULL) | 156 | if (t->buf.tail != NULL) { |
157 | t->buf.tail->active = 0; | 157 | t->buf.tail->active = 0; |
158 | t->buf.tail->commit = t->buf.tail->used; | ||
159 | } | ||
158 | spin_unlock_irqrestore(&t->buf.lock, flags); | 160 | spin_unlock_irqrestore(&t->buf.lock, flags); |
159 | schedule_work(&t->buf.work); | 161 | schedule_work(&t->buf.work); |
160 | } | 162 | } |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index a311f58c8a7c..cfb3410e32b1 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/list.h> | 6 | #include <linux/list.h> |
7 | #include <linux/linkage.h> | 7 | #include <linux/linkage.h> |
8 | #include <linux/compat.h> | 8 | #include <linux/compat.h> |
9 | #include <linux/ioport.h> | ||
9 | #include <asm/kexec.h> | 10 | #include <asm/kexec.h> |
10 | 11 | ||
11 | /* Verify architecture specific macros are defined */ | 12 | /* Verify architecture specific macros are defined */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 6a2ccf78a356..c256ebe2a7b4 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -160,7 +160,8 @@ extern int netlink_unregister_notifier(struct notifier_block *nb); | |||
160 | 160 | ||
161 | /* finegrained unicast helpers: */ | 161 | /* finegrained unicast helpers: */ |
162 | struct sock *netlink_getsockbyfilp(struct file *filp); | 162 | struct sock *netlink_getsockbyfilp(struct file *filp); |
163 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo); | 163 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, |
164 | long timeo, struct sock *ssk); | ||
164 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); | 165 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); |
165 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); | 166 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); |
166 | 167 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index a7bd3b4558d2..f45cd74e6f24 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -58,6 +58,8 @@ struct tty_buffer { | |||
58 | int used; | 58 | int used; |
59 | int size; | 59 | int size; |
60 | int active; | 60 | int active; |
61 | int commit; | ||
62 | int read; | ||
61 | /* Data points here */ | 63 | /* Data points here */ |
62 | unsigned long data[0]; | 64 | unsigned long data[0]; |
63 | }; | 65 | }; |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 82961eb19888..222faf97d5f9 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -29,8 +29,10 @@ _INLINE_ void tty_schedule_flip(struct tty_struct *tty) | |||
29 | { | 29 | { |
30 | unsigned long flags; | 30 | unsigned long flags; |
31 | spin_lock_irqsave(&tty->buf.lock, flags); | 31 | spin_lock_irqsave(&tty->buf.lock, flags); |
32 | if (tty->buf.tail != NULL) | 32 | if (tty->buf.tail != NULL) { |
33 | tty->buf.tail->active = 0; | 33 | tty->buf.tail->active = 0; |
34 | tty->buf.tail->commit = tty->buf.tail->used; | ||
35 | } | ||
34 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 36 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
35 | schedule_delayed_work(&tty->buf.work, 1); | 37 | schedule_delayed_work(&tty->buf.work, 1); |
36 | } | 38 | } |
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h index f55e86e75030..2127cae1e0a6 100644 --- a/include/net/irda/irlap.h +++ b/include/net/irda/irlap.h | |||
@@ -50,6 +50,9 @@ | |||
50 | /* May be different when we get VFIR */ | 50 | /* May be different when we get VFIR */ |
51 | #define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER) | 51 | #define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER) |
52 | 52 | ||
53 | /* Each IrDA device gets a random 32 bits IRLAP device address */ | ||
54 | #define LAP_ALEN 4 | ||
55 | |||
53 | #define BROADCAST 0xffffffff /* Broadcast device address */ | 56 | #define BROADCAST 0xffffffff /* Broadcast device address */ |
54 | #define CBROADCAST 0xfe /* Connection broadcast address */ | 57 | #define CBROADCAST 0xfe /* Connection broadcast address */ |
55 | #define XID_FORMAT 0x01 /* Discovery XID format */ | 58 | #define XID_FORMAT 0x01 /* Discovery XID format */ |
diff --git a/init/initramfs.c b/init/initramfs.c index 0c5d9a3f951b..637344b05981 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -466,10 +466,32 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) | |||
466 | extern char __initramfs_start[], __initramfs_end[]; | 466 | extern char __initramfs_start[], __initramfs_end[]; |
467 | #ifdef CONFIG_BLK_DEV_INITRD | 467 | #ifdef CONFIG_BLK_DEV_INITRD |
468 | #include <linux/initrd.h> | 468 | #include <linux/initrd.h> |
469 | #include <linux/kexec.h> | ||
469 | 470 | ||
470 | static void __init free_initrd(void) | 471 | static void __init free_initrd(void) |
471 | { | 472 | { |
472 | free_initrd_mem(initrd_start, initrd_end); | 473 | #ifdef CONFIG_KEXEC |
474 | unsigned long crashk_start = (unsigned long)__va(crashk_res.start); | ||
475 | unsigned long crashk_end = (unsigned long)__va(crashk_res.end); | ||
476 | |||
477 | /* | ||
478 | * If the initrd region is overlapped with crashkernel reserved region, | ||
479 | * free only memory that is not part of crashkernel region. | ||
480 | */ | ||
481 | if (initrd_start < crashk_end && initrd_end > crashk_start) { | ||
482 | /* | ||
483 | * Initialize initrd memory region since the kexec boot does | ||
484 | * not do. | ||
485 | */ | ||
486 | memset((void *)initrd_start, 0, initrd_end - initrd_start); | ||
487 | if (initrd_start < crashk_start) | ||
488 | free_initrd_mem(initrd_start, crashk_start); | ||
489 | if (initrd_end > crashk_end) | ||
490 | free_initrd_mem(crashk_end, initrd_end); | ||
491 | } else | ||
492 | #endif | ||
493 | free_initrd_mem(initrd_start, initrd_end); | ||
494 | |||
473 | initrd_start = 0; | 495 | initrd_start = 0; |
474 | initrd_end = 0; | 496 | initrd_end = 0; |
475 | } | 497 | } |
diff --git a/init/main.c b/init/main.c index 7c79da57d3a2..4c194c47395f 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -668,7 +668,6 @@ static int init(void * unused) | |||
668 | */ | 668 | */ |
669 | child_reaper = current; | 669 | child_reaper = current; |
670 | 670 | ||
671 | /* Sets up cpus_possible() */ | ||
672 | smp_prepare_cpus(max_cpus); | 671 | smp_prepare_cpus(max_cpus); |
673 | 672 | ||
674 | do_pre_smp_initcalls(); | 673 | do_pre_smp_initcalls(); |
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 59302fc3643b..fd2e26b6f966 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -1018,7 +1018,8 @@ retry: | |||
1018 | goto out; | 1018 | goto out; |
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | ret = netlink_attachskb(sock, nc, 0, MAX_SCHEDULE_TIMEOUT); | 1021 | ret = netlink_attachskb(sock, nc, 0, |
1022 | MAX_SCHEDULE_TIMEOUT, NULL); | ||
1022 | if (ret == 1) | 1023 | if (ret == 1) |
1023 | goto retry; | 1024 | goto retry; |
1024 | if (ret) { | 1025 | if (ret) { |
@@ -870,6 +870,7 @@ asmlinkage long sys_shmdt(char __user *shmaddr) | |||
870 | * could possibly have landed at. Also cast things to loff_t to | 870 | * could possibly have landed at. Also cast things to loff_t to |
871 | * prevent overflows and make comparisions vs. equal-width types. | 871 | * prevent overflows and make comparisions vs. equal-width types. |
872 | */ | 872 | */ |
873 | size = PAGE_ALIGN(size); | ||
873 | while (vma && (loff_t)(vma->vm_end - addr) <= size) { | 874 | while (vma && (loff_t)(vma->vm_end - addr) <= size) { |
874 | next = vma->vm_next; | 875 | next = vma->vm_next; |
875 | 876 | ||
diff --git a/kernel/panic.c b/kernel/panic.c index c5c4ab255834..126dc43f1c74 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -130,6 +130,7 @@ NORET_TYPE void panic(const char * fmt, ...) | |||
130 | #endif | 130 | #endif |
131 | local_irq_enable(); | 131 | local_irq_enable(); |
132 | for (i = 0;;) { | 132 | for (i = 0;;) { |
133 | touch_softlockup_watchdog(); | ||
133 | i += panic_blink(i); | 134 | i += panic_blink(i); |
134 | mdelay(1); | 135 | mdelay(1); |
135 | i++; | 136 | i++; |
diff --git a/kernel/sched.c b/kernel/sched.c index bc38804e40dd..87d93be336a1 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -215,7 +215,6 @@ struct runqueue { | |||
215 | */ | 215 | */ |
216 | unsigned long nr_running; | 216 | unsigned long nr_running; |
217 | #ifdef CONFIG_SMP | 217 | #ifdef CONFIG_SMP |
218 | unsigned long prio_bias; | ||
219 | unsigned long cpu_load[3]; | 218 | unsigned long cpu_load[3]; |
220 | #endif | 219 | #endif |
221 | unsigned long long nr_switches; | 220 | unsigned long long nr_switches; |
@@ -669,68 +668,13 @@ static int effective_prio(task_t *p) | |||
669 | return prio; | 668 | return prio; |
670 | } | 669 | } |
671 | 670 | ||
672 | #ifdef CONFIG_SMP | ||
673 | static inline void inc_prio_bias(runqueue_t *rq, int prio) | ||
674 | { | ||
675 | rq->prio_bias += MAX_PRIO - prio; | ||
676 | } | ||
677 | |||
678 | static inline void dec_prio_bias(runqueue_t *rq, int prio) | ||
679 | { | ||
680 | rq->prio_bias -= MAX_PRIO - prio; | ||
681 | } | ||
682 | |||
683 | static inline void inc_nr_running(task_t *p, runqueue_t *rq) | ||
684 | { | ||
685 | rq->nr_running++; | ||
686 | if (rt_task(p)) { | ||
687 | if (p != rq->migration_thread) | ||
688 | /* | ||
689 | * The migration thread does the actual balancing. Do | ||
690 | * not bias by its priority as the ultra high priority | ||
691 | * will skew balancing adversely. | ||
692 | */ | ||
693 | inc_prio_bias(rq, p->prio); | ||
694 | } else | ||
695 | inc_prio_bias(rq, p->static_prio); | ||
696 | } | ||
697 | |||
698 | static inline void dec_nr_running(task_t *p, runqueue_t *rq) | ||
699 | { | ||
700 | rq->nr_running--; | ||
701 | if (rt_task(p)) { | ||
702 | if (p != rq->migration_thread) | ||
703 | dec_prio_bias(rq, p->prio); | ||
704 | } else | ||
705 | dec_prio_bias(rq, p->static_prio); | ||
706 | } | ||
707 | #else | ||
708 | static inline void inc_prio_bias(runqueue_t *rq, int prio) | ||
709 | { | ||
710 | } | ||
711 | |||
712 | static inline void dec_prio_bias(runqueue_t *rq, int prio) | ||
713 | { | ||
714 | } | ||
715 | |||
716 | static inline void inc_nr_running(task_t *p, runqueue_t *rq) | ||
717 | { | ||
718 | rq->nr_running++; | ||
719 | } | ||
720 | |||
721 | static inline void dec_nr_running(task_t *p, runqueue_t *rq) | ||
722 | { | ||
723 | rq->nr_running--; | ||
724 | } | ||
725 | #endif | ||
726 | |||
727 | /* | 671 | /* |
728 | * __activate_task - move a task to the runqueue. | 672 | * __activate_task - move a task to the runqueue. |
729 | */ | 673 | */ |
730 | static inline void __activate_task(task_t *p, runqueue_t *rq) | 674 | static inline void __activate_task(task_t *p, runqueue_t *rq) |
731 | { | 675 | { |
732 | enqueue_task(p, rq->active); | 676 | enqueue_task(p, rq->active); |
733 | inc_nr_running(p, rq); | 677 | rq->nr_running++; |
734 | } | 678 | } |
735 | 679 | ||
736 | /* | 680 | /* |
@@ -739,7 +683,7 @@ static inline void __activate_task(task_t *p, runqueue_t *rq) | |||
739 | static inline void __activate_idle_task(task_t *p, runqueue_t *rq) | 683 | static inline void __activate_idle_task(task_t *p, runqueue_t *rq) |
740 | { | 684 | { |
741 | enqueue_task_head(p, rq->active); | 685 | enqueue_task_head(p, rq->active); |
742 | inc_nr_running(p, rq); | 686 | rq->nr_running++; |
743 | } | 687 | } |
744 | 688 | ||
745 | static int recalc_task_prio(task_t *p, unsigned long long now) | 689 | static int recalc_task_prio(task_t *p, unsigned long long now) |
@@ -863,7 +807,7 @@ static void activate_task(task_t *p, runqueue_t *rq, int local) | |||
863 | */ | 807 | */ |
864 | static void deactivate_task(struct task_struct *p, runqueue_t *rq) | 808 | static void deactivate_task(struct task_struct *p, runqueue_t *rq) |
865 | { | 809 | { |
866 | dec_nr_running(p, rq); | 810 | rq->nr_running--; |
867 | dequeue_task(p, p->array); | 811 | dequeue_task(p, p->array); |
868 | p->array = NULL; | 812 | p->array = NULL; |
869 | } | 813 | } |
@@ -1007,61 +951,27 @@ void kick_process(task_t *p) | |||
1007 | * We want to under-estimate the load of migration sources, to | 951 | * We want to under-estimate the load of migration sources, to |
1008 | * balance conservatively. | 952 | * balance conservatively. |
1009 | */ | 953 | */ |
1010 | static unsigned long __source_load(int cpu, int type, enum idle_type idle) | 954 | static inline unsigned long source_load(int cpu, int type) |
1011 | { | 955 | { |
1012 | runqueue_t *rq = cpu_rq(cpu); | 956 | runqueue_t *rq = cpu_rq(cpu); |
1013 | unsigned long running = rq->nr_running; | 957 | unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE; |
1014 | unsigned long source_load, cpu_load = rq->cpu_load[type-1], | ||
1015 | load_now = running * SCHED_LOAD_SCALE; | ||
1016 | |||
1017 | if (type == 0) | 958 | if (type == 0) |
1018 | source_load = load_now; | 959 | return load_now; |
1019 | else | ||
1020 | source_load = min(cpu_load, load_now); | ||
1021 | |||
1022 | if (running > 1 || (idle == NOT_IDLE && running)) | ||
1023 | /* | ||
1024 | * If we are busy rebalancing the load is biased by | ||
1025 | * priority to create 'nice' support across cpus. When | ||
1026 | * idle rebalancing we should only bias the source_load if | ||
1027 | * there is more than one task running on that queue to | ||
1028 | * prevent idle rebalance from trying to pull tasks from a | ||
1029 | * queue with only one running task. | ||
1030 | */ | ||
1031 | source_load = source_load * rq->prio_bias / running; | ||
1032 | 960 | ||
1033 | return source_load; | 961 | return min(rq->cpu_load[type-1], load_now); |
1034 | } | ||
1035 | |||
1036 | static inline unsigned long source_load(int cpu, int type) | ||
1037 | { | ||
1038 | return __source_load(cpu, type, NOT_IDLE); | ||
1039 | } | 962 | } |
1040 | 963 | ||
1041 | /* | 964 | /* |
1042 | * Return a high guess at the load of a migration-target cpu | 965 | * Return a high guess at the load of a migration-target cpu |
1043 | */ | 966 | */ |
1044 | static inline unsigned long __target_load(int cpu, int type, enum idle_type idle) | 967 | static inline unsigned long target_load(int cpu, int type) |
1045 | { | 968 | { |
1046 | runqueue_t *rq = cpu_rq(cpu); | 969 | runqueue_t *rq = cpu_rq(cpu); |
1047 | unsigned long running = rq->nr_running; | 970 | unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE; |
1048 | unsigned long target_load, cpu_load = rq->cpu_load[type-1], | ||
1049 | load_now = running * SCHED_LOAD_SCALE; | ||
1050 | |||
1051 | if (type == 0) | 971 | if (type == 0) |
1052 | target_load = load_now; | 972 | return load_now; |
1053 | else | ||
1054 | target_load = max(cpu_load, load_now); | ||
1055 | 973 | ||
1056 | if (running > 1 || (idle == NOT_IDLE && running)) | 974 | return max(rq->cpu_load[type-1], load_now); |
1057 | target_load = target_load * rq->prio_bias / running; | ||
1058 | |||
1059 | return target_load; | ||
1060 | } | ||
1061 | |||
1062 | static inline unsigned long target_load(int cpu, int type) | ||
1063 | { | ||
1064 | return __target_load(cpu, type, NOT_IDLE); | ||
1065 | } | 975 | } |
1066 | 976 | ||
1067 | /* | 977 | /* |
@@ -1530,7 +1440,7 @@ void fastcall wake_up_new_task(task_t *p, unsigned long clone_flags) | |||
1530 | list_add_tail(&p->run_list, ¤t->run_list); | 1440 | list_add_tail(&p->run_list, ¤t->run_list); |
1531 | p->array = current->array; | 1441 | p->array = current->array; |
1532 | p->array->nr_active++; | 1442 | p->array->nr_active++; |
1533 | inc_nr_running(p, rq); | 1443 | rq->nr_running++; |
1534 | } | 1444 | } |
1535 | set_need_resched(); | 1445 | set_need_resched(); |
1536 | } else | 1446 | } else |
@@ -1875,9 +1785,9 @@ void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p, | |||
1875 | runqueue_t *this_rq, prio_array_t *this_array, int this_cpu) | 1785 | runqueue_t *this_rq, prio_array_t *this_array, int this_cpu) |
1876 | { | 1786 | { |
1877 | dequeue_task(p, src_array); | 1787 | dequeue_task(p, src_array); |
1878 | dec_nr_running(p, src_rq); | 1788 | src_rq->nr_running--; |
1879 | set_task_cpu(p, this_cpu); | 1789 | set_task_cpu(p, this_cpu); |
1880 | inc_nr_running(p, this_rq); | 1790 | this_rq->nr_running++; |
1881 | enqueue_task(p, this_array); | 1791 | enqueue_task(p, this_array); |
1882 | p->timestamp = (p->timestamp - src_rq->timestamp_last_tick) | 1792 | p->timestamp = (p->timestamp - src_rq->timestamp_last_tick) |
1883 | + this_rq->timestamp_last_tick; | 1793 | + this_rq->timestamp_last_tick; |
@@ -2056,9 +1966,9 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, | |||
2056 | 1966 | ||
2057 | /* Bias balancing toward cpus of our domain */ | 1967 | /* Bias balancing toward cpus of our domain */ |
2058 | if (local_group) | 1968 | if (local_group) |
2059 | load = __target_load(i, load_idx, idle); | 1969 | load = target_load(i, load_idx); |
2060 | else | 1970 | else |
2061 | load = __source_load(i, load_idx, idle); | 1971 | load = source_load(i, load_idx); |
2062 | 1972 | ||
2063 | avg_load += load; | 1973 | avg_load += load; |
2064 | } | 1974 | } |
@@ -2171,7 +2081,7 @@ static runqueue_t *find_busiest_queue(struct sched_group *group, | |||
2171 | int i; | 2081 | int i; |
2172 | 2082 | ||
2173 | for_each_cpu_mask(i, group->cpumask) { | 2083 | for_each_cpu_mask(i, group->cpumask) { |
2174 | load = __source_load(i, 0, idle); | 2084 | load = source_load(i, 0); |
2175 | 2085 | ||
2176 | if (load > max_load) { | 2086 | if (load > max_load) { |
2177 | max_load = load; | 2087 | max_load = load; |
@@ -3571,10 +3481,8 @@ void set_user_nice(task_t *p, long nice) | |||
3571 | goto out_unlock; | 3481 | goto out_unlock; |
3572 | } | 3482 | } |
3573 | array = p->array; | 3483 | array = p->array; |
3574 | if (array) { | 3484 | if (array) |
3575 | dequeue_task(p, array); | 3485 | dequeue_task(p, array); |
3576 | dec_prio_bias(rq, p->static_prio); | ||
3577 | } | ||
3578 | 3486 | ||
3579 | old_prio = p->prio; | 3487 | old_prio = p->prio; |
3580 | new_prio = NICE_TO_PRIO(nice); | 3488 | new_prio = NICE_TO_PRIO(nice); |
@@ -3584,7 +3492,6 @@ void set_user_nice(task_t *p, long nice) | |||
3584 | 3492 | ||
3585 | if (array) { | 3493 | if (array) { |
3586 | enqueue_task(p, array); | 3494 | enqueue_task(p, array); |
3587 | inc_prio_bias(rq, p->static_prio); | ||
3588 | /* | 3495 | /* |
3589 | * If the task increased its priority or is running and | 3496 | * If the task increased its priority or is running and |
3590 | * lowered its priority, then reschedule its CPU: | 3497 | * lowered its priority, then reschedule its CPU: |
@@ -1717,6 +1717,12 @@ kmem_cache_create (const char *name, size_t size, size_t align, | |||
1717 | BUG(); | 1717 | BUG(); |
1718 | } | 1718 | } |
1719 | 1719 | ||
1720 | /* | ||
1721 | * Prevent CPUs from coming and going. | ||
1722 | * lock_cpu_hotplug() nests outside cache_chain_mutex | ||
1723 | */ | ||
1724 | lock_cpu_hotplug(); | ||
1725 | |||
1720 | mutex_lock(&cache_chain_mutex); | 1726 | mutex_lock(&cache_chain_mutex); |
1721 | 1727 | ||
1722 | list_for_each(p, &cache_chain) { | 1728 | list_for_each(p, &cache_chain) { |
@@ -1918,8 +1924,6 @@ kmem_cache_create (const char *name, size_t size, size_t align, | |||
1918 | cachep->dtor = dtor; | 1924 | cachep->dtor = dtor; |
1919 | cachep->name = name; | 1925 | cachep->name = name; |
1920 | 1926 | ||
1921 | /* Don't let CPUs to come and go */ | ||
1922 | lock_cpu_hotplug(); | ||
1923 | 1927 | ||
1924 | if (g_cpucache_up == FULL) { | 1928 | if (g_cpucache_up == FULL) { |
1925 | enable_cpucache(cachep); | 1929 | enable_cpucache(cachep); |
@@ -1978,12 +1982,12 @@ kmem_cache_create (const char *name, size_t size, size_t align, | |||
1978 | 1982 | ||
1979 | /* cache setup completed, link it into the list */ | 1983 | /* cache setup completed, link it into the list */ |
1980 | list_add(&cachep->next, &cache_chain); | 1984 | list_add(&cachep->next, &cache_chain); |
1981 | unlock_cpu_hotplug(); | ||
1982 | oops: | 1985 | oops: |
1983 | if (!cachep && (flags & SLAB_PANIC)) | 1986 | if (!cachep && (flags & SLAB_PANIC)) |
1984 | panic("kmem_cache_create(): failed to create slab `%s'\n", | 1987 | panic("kmem_cache_create(): failed to create slab `%s'\n", |
1985 | name); | 1988 | name); |
1986 | mutex_unlock(&cache_chain_mutex); | 1989 | mutex_unlock(&cache_chain_mutex); |
1990 | unlock_cpu_hotplug(); | ||
1987 | return cachep; | 1991 | return cachep; |
1988 | } | 1992 | } |
1989 | EXPORT_SYMBOL(kmem_cache_create); | 1993 | EXPORT_SYMBOL(kmem_cache_create); |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 5a610804cd06..5db32fdfaf39 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -632,7 +632,7 @@ static int swap_page(struct page *page) | |||
632 | struct address_space *mapping = page_mapping(page); | 632 | struct address_space *mapping = page_mapping(page); |
633 | 633 | ||
634 | if (page_mapped(page) && mapping) | 634 | if (page_mapped(page) && mapping) |
635 | if (try_to_unmap(page, 0) != SWAP_SUCCESS) | 635 | if (try_to_unmap(page, 1) != SWAP_SUCCESS) |
636 | goto unlock_retry; | 636 | goto unlock_retry; |
637 | 637 | ||
638 | if (PageDirty(page)) { | 638 | if (PageDirty(page)) { |
@@ -839,7 +839,7 @@ EXPORT_SYMBOL(migrate_page); | |||
839 | * pages are swapped out. | 839 | * pages are swapped out. |
840 | * | 840 | * |
841 | * The function returns after 10 attempts or if no pages | 841 | * The function returns after 10 attempts or if no pages |
842 | * are movable anymore because t has become empty | 842 | * are movable anymore because to has become empty |
843 | * or no retryable pages exist anymore. | 843 | * or no retryable pages exist anymore. |
844 | * | 844 | * |
845 | * Return: Number of pages not migrated when "to" ran empty. | 845 | * Return: Number of pages not migrated when "to" ran empty. |
@@ -928,12 +928,21 @@ redo: | |||
928 | goto unlock_both; | 928 | goto unlock_both; |
929 | 929 | ||
930 | if (mapping->a_ops->migratepage) { | 930 | if (mapping->a_ops->migratepage) { |
931 | /* | ||
932 | * Most pages have a mapping and most filesystems | ||
933 | * should provide a migration function. Anonymous | ||
934 | * pages are part of swap space which also has its | ||
935 | * own migration function. This is the most common | ||
936 | * path for page migration. | ||
937 | */ | ||
931 | rc = mapping->a_ops->migratepage(newpage, page); | 938 | rc = mapping->a_ops->migratepage(newpage, page); |
932 | goto unlock_both; | 939 | goto unlock_both; |
933 | } | 940 | } |
934 | 941 | ||
935 | /* | 942 | /* |
936 | * Trigger writeout if page is dirty | 943 | * Default handling if a filesystem does not provide |
944 | * a migration function. We can only migrate clean | ||
945 | * pages so try to write out any dirty pages first. | ||
937 | */ | 946 | */ |
938 | if (PageDirty(page)) { | 947 | if (PageDirty(page)) { |
939 | switch (pageout(page, mapping)) { | 948 | switch (pageout(page, mapping)) { |
@@ -949,9 +958,10 @@ redo: | |||
949 | ; /* try to migrate the page below */ | 958 | ; /* try to migrate the page below */ |
950 | } | 959 | } |
951 | } | 960 | } |
961 | |||
952 | /* | 962 | /* |
953 | * If we have no buffer or can release the buffer | 963 | * Buffers are managed in a filesystem specific way. |
954 | * then do a simple migration. | 964 | * We must have no buffers or drop them. |
955 | */ | 965 | */ |
956 | if (!page_has_buffers(page) || | 966 | if (!page_has_buffers(page) || |
957 | try_to_release_page(page, GFP_KERNEL)) { | 967 | try_to_release_page(page, GFP_KERNEL)) { |
@@ -966,6 +976,11 @@ redo: | |||
966 | * swap them out. | 976 | * swap them out. |
967 | */ | 977 | */ |
968 | if (pass > 4) { | 978 | if (pass > 4) { |
979 | /* | ||
980 | * Persistently unable to drop buffers..... As a | ||
981 | * measure of last resort we fall back to | ||
982 | * swap_page(). | ||
983 | */ | ||
969 | unlock_page(newpage); | 984 | unlock_page(newpage); |
970 | newpage = NULL; | 985 | newpage = NULL; |
971 | rc = swap_page(page); | 986 | rc = swap_page(page); |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index da687c8dc6ff..7fa3a5a9971f 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -79,9 +79,14 @@ static int port_cost(struct net_device *dev) | |||
79 | */ | 79 | */ |
80 | static void port_carrier_check(void *arg) | 80 | static void port_carrier_check(void *arg) |
81 | { | 81 | { |
82 | struct net_bridge_port *p = arg; | 82 | struct net_device *dev = arg; |
83 | struct net_bridge_port *p; | ||
83 | 84 | ||
84 | rtnl_lock(); | 85 | rtnl_lock(); |
86 | p = dev->br_port; | ||
87 | if (!p) | ||
88 | goto done; | ||
89 | |||
85 | if (netif_carrier_ok(p->dev)) { | 90 | if (netif_carrier_ok(p->dev)) { |
86 | u32 cost = port_cost(p->dev); | 91 | u32 cost = port_cost(p->dev); |
87 | 92 | ||
@@ -97,19 +102,33 @@ static void port_carrier_check(void *arg) | |||
97 | br_stp_disable_port(p); | 102 | br_stp_disable_port(p); |
98 | spin_unlock_bh(&p->br->lock); | 103 | spin_unlock_bh(&p->br->lock); |
99 | } | 104 | } |
105 | done: | ||
100 | rtnl_unlock(); | 106 | rtnl_unlock(); |
101 | } | 107 | } |
102 | 108 | ||
109 | static void release_nbp(struct kobject *kobj) | ||
110 | { | ||
111 | struct net_bridge_port *p | ||
112 | = container_of(kobj, struct net_bridge_port, kobj); | ||
113 | kfree(p); | ||
114 | } | ||
115 | |||
116 | static struct kobj_type brport_ktype = { | ||
117 | #ifdef CONFIG_SYSFS | ||
118 | .sysfs_ops = &brport_sysfs_ops, | ||
119 | #endif | ||
120 | .release = release_nbp, | ||
121 | }; | ||
122 | |||
103 | static void destroy_nbp(struct net_bridge_port *p) | 123 | static void destroy_nbp(struct net_bridge_port *p) |
104 | { | 124 | { |
105 | struct net_device *dev = p->dev; | 125 | struct net_device *dev = p->dev; |
106 | 126 | ||
107 | dev->br_port = NULL; | ||
108 | p->br = NULL; | 127 | p->br = NULL; |
109 | p->dev = NULL; | 128 | p->dev = NULL; |
110 | dev_put(dev); | 129 | dev_put(dev); |
111 | 130 | ||
112 | br_sysfs_freeif(p); | 131 | kobject_put(&p->kobj); |
113 | } | 132 | } |
114 | 133 | ||
115 | static void destroy_nbp_rcu(struct rcu_head *head) | 134 | static void destroy_nbp_rcu(struct rcu_head *head) |
@@ -133,24 +152,24 @@ static void del_nbp(struct net_bridge_port *p) | |||
133 | struct net_bridge *br = p->br; | 152 | struct net_bridge *br = p->br; |
134 | struct net_device *dev = p->dev; | 153 | struct net_device *dev = p->dev; |
135 | 154 | ||
136 | /* Race between RTNL notify and RCU callback */ | 155 | sysfs_remove_link(&br->ifobj, dev->name); |
137 | if (p->deleted) | ||
138 | return; | ||
139 | 156 | ||
140 | dev_set_promiscuity(dev, -1); | 157 | dev_set_promiscuity(dev, -1); |
141 | 158 | ||
142 | cancel_delayed_work(&p->carrier_check); | 159 | cancel_delayed_work(&p->carrier_check); |
143 | flush_scheduled_work(); | ||
144 | 160 | ||
145 | spin_lock_bh(&br->lock); | 161 | spin_lock_bh(&br->lock); |
146 | br_stp_disable_port(p); | 162 | br_stp_disable_port(p); |
147 | p->deleted = 1; | ||
148 | spin_unlock_bh(&br->lock); | 163 | spin_unlock_bh(&br->lock); |
149 | 164 | ||
150 | br_fdb_delete_by_port(br, p); | 165 | br_fdb_delete_by_port(br, p); |
151 | 166 | ||
152 | list_del_rcu(&p->list); | 167 | list_del_rcu(&p->list); |
153 | 168 | ||
169 | rcu_assign_pointer(dev->br_port, NULL); | ||
170 | |||
171 | kobject_del(&p->kobj); | ||
172 | |||
154 | call_rcu(&p->rcu, destroy_nbp_rcu); | 173 | call_rcu(&p->rcu, destroy_nbp_rcu); |
155 | } | 174 | } |
156 | 175 | ||
@@ -160,7 +179,6 @@ static void del_br(struct net_bridge *br) | |||
160 | struct net_bridge_port *p, *n; | 179 | struct net_bridge_port *p, *n; |
161 | 180 | ||
162 | list_for_each_entry_safe(p, n, &br->port_list, list) { | 181 | list_for_each_entry_safe(p, n, &br->port_list, list) { |
163 | br_sysfs_removeif(p); | ||
164 | del_nbp(p); | 182 | del_nbp(p); |
165 | } | 183 | } |
166 | 184 | ||
@@ -254,13 +272,17 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, | |||
254 | p->dev = dev; | 272 | p->dev = dev; |
255 | p->path_cost = port_cost(dev); | 273 | p->path_cost = port_cost(dev); |
256 | p->priority = 0x8000 >> BR_PORT_BITS; | 274 | p->priority = 0x8000 >> BR_PORT_BITS; |
257 | dev->br_port = p; | ||
258 | p->port_no = index; | 275 | p->port_no = index; |
259 | br_init_port(p); | 276 | br_init_port(p); |
260 | p->state = BR_STATE_DISABLED; | 277 | p->state = BR_STATE_DISABLED; |
261 | INIT_WORK(&p->carrier_check, port_carrier_check, p); | 278 | INIT_WORK(&p->carrier_check, port_carrier_check, dev); |
262 | kobject_init(&p->kobj); | 279 | kobject_init(&p->kobj); |
263 | 280 | ||
281 | kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR); | ||
282 | p->kobj.ktype = &brport_ktype; | ||
283 | p->kobj.parent = &(dev->class_dev.kobj); | ||
284 | p->kobj.kset = NULL; | ||
285 | |||
264 | return p; | 286 | return p; |
265 | } | 287 | } |
266 | 288 | ||
@@ -388,30 +410,43 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) | |||
388 | if (dev->br_port != NULL) | 410 | if (dev->br_port != NULL) |
389 | return -EBUSY; | 411 | return -EBUSY; |
390 | 412 | ||
391 | if (IS_ERR(p = new_nbp(br, dev))) | 413 | p = new_nbp(br, dev); |
414 | if (IS_ERR(p)) | ||
392 | return PTR_ERR(p); | 415 | return PTR_ERR(p); |
393 | 416 | ||
394 | if ((err = br_fdb_insert(br, p, dev->dev_addr))) | 417 | err = kobject_add(&p->kobj); |
395 | destroy_nbp(p); | 418 | if (err) |
396 | 419 | goto err0; | |
397 | else if ((err = br_sysfs_addif(p))) | ||
398 | del_nbp(p); | ||
399 | else { | ||
400 | dev_set_promiscuity(dev, 1); | ||
401 | 420 | ||
402 | list_add_rcu(&p->list, &br->port_list); | 421 | err = br_fdb_insert(br, p, dev->dev_addr); |
422 | if (err) | ||
423 | goto err1; | ||
403 | 424 | ||
404 | spin_lock_bh(&br->lock); | 425 | err = br_sysfs_addif(p); |
405 | br_stp_recalculate_bridge_id(br); | 426 | if (err) |
406 | br_features_recompute(br); | 427 | goto err2; |
407 | if ((br->dev->flags & IFF_UP) | ||
408 | && (dev->flags & IFF_UP) && netif_carrier_ok(dev)) | ||
409 | br_stp_enable_port(p); | ||
410 | spin_unlock_bh(&br->lock); | ||
411 | 428 | ||
412 | dev_set_mtu(br->dev, br_min_mtu(br)); | 429 | rcu_assign_pointer(dev->br_port, p); |
413 | } | 430 | dev_set_promiscuity(dev, 1); |
431 | |||
432 | list_add_rcu(&p->list, &br->port_list); | ||
414 | 433 | ||
434 | spin_lock_bh(&br->lock); | ||
435 | br_stp_recalculate_bridge_id(br); | ||
436 | br_features_recompute(br); | ||
437 | schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); | ||
438 | spin_unlock_bh(&br->lock); | ||
439 | |||
440 | dev_set_mtu(br->dev, br_min_mtu(br)); | ||
441 | kobject_uevent(&p->kobj, KOBJ_ADD); | ||
442 | |||
443 | return 0; | ||
444 | err2: | ||
445 | br_fdb_delete_by_port(br, p); | ||
446 | err1: | ||
447 | kobject_del(&p->kobj); | ||
448 | err0: | ||
449 | kobject_put(&p->kobj); | ||
415 | return err; | 450 | return err; |
416 | } | 451 | } |
417 | 452 | ||
@@ -423,7 +458,6 @@ int br_del_if(struct net_bridge *br, struct net_device *dev) | |||
423 | if (!p || p->br != br) | 458 | if (!p || p->br != br) |
424 | return -EINVAL; | 459 | return -EINVAL; |
425 | 460 | ||
426 | br_sysfs_removeif(p); | ||
427 | del_nbp(p); | 461 | del_nbp(p); |
428 | 462 | ||
429 | spin_lock_bh(&br->lock); | 463 | spin_lock_bh(&br->lock); |
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index e3a73cead6b6..4eef83755315 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
@@ -45,18 +45,20 @@ static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb) | |||
45 | int br_handle_frame_finish(struct sk_buff *skb) | 45 | int br_handle_frame_finish(struct sk_buff *skb) |
46 | { | 46 | { |
47 | const unsigned char *dest = eth_hdr(skb)->h_dest; | 47 | const unsigned char *dest = eth_hdr(skb)->h_dest; |
48 | struct net_bridge_port *p = skb->dev->br_port; | 48 | struct net_bridge_port *p = rcu_dereference(skb->dev->br_port); |
49 | struct net_bridge *br = p->br; | 49 | struct net_bridge *br; |
50 | struct net_bridge_fdb_entry *dst; | 50 | struct net_bridge_fdb_entry *dst; |
51 | int passedup = 0; | 51 | int passedup = 0; |
52 | 52 | ||
53 | if (!p || p->state == BR_STATE_DISABLED) | ||
54 | goto drop; | ||
55 | |||
53 | /* insert into forwarding database after filtering to avoid spoofing */ | 56 | /* insert into forwarding database after filtering to avoid spoofing */ |
54 | br_fdb_update(p->br, p, eth_hdr(skb)->h_source); | 57 | br = p->br; |
58 | br_fdb_update(br, p, eth_hdr(skb)->h_source); | ||
55 | 59 | ||
56 | if (p->state == BR_STATE_LEARNING) { | 60 | if (p->state == BR_STATE_LEARNING) |
57 | kfree_skb(skb); | 61 | goto drop; |
58 | goto out; | ||
59 | } | ||
60 | 62 | ||
61 | if (br->dev->flags & IFF_PROMISC) { | 63 | if (br->dev->flags & IFF_PROMISC) { |
62 | struct sk_buff *skb2; | 64 | struct sk_buff *skb2; |
@@ -93,6 +95,9 @@ int br_handle_frame_finish(struct sk_buff *skb) | |||
93 | 95 | ||
94 | out: | 96 | out: |
95 | return 0; | 97 | return 0; |
98 | drop: | ||
99 | kfree_skb(skb); | ||
100 | goto out; | ||
96 | } | 101 | } |
97 | 102 | ||
98 | /* | 103 | /* |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 7cac3fb9f809..b5018166b0e5 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -51,9 +51,6 @@ | |||
51 | #define store_orig_dstaddr(skb) (skb_origaddr(skb) = (skb)->nh.iph->daddr) | 51 | #define store_orig_dstaddr(skb) (skb_origaddr(skb) = (skb)->nh.iph->daddr) |
52 | #define dnat_took_place(skb) (skb_origaddr(skb) != (skb)->nh.iph->daddr) | 52 | #define dnat_took_place(skb) (skb_origaddr(skb) != (skb)->nh.iph->daddr) |
53 | 53 | ||
54 | #define has_bridge_parent(device) ((device)->br_port != NULL) | ||
55 | #define bridge_parent(device) ((device)->br_port->br->dev) | ||
56 | |||
57 | #ifdef CONFIG_SYSCTL | 54 | #ifdef CONFIG_SYSCTL |
58 | static struct ctl_table_header *brnf_sysctl_header; | 55 | static struct ctl_table_header *brnf_sysctl_header; |
59 | static int brnf_call_iptables = 1; | 56 | static int brnf_call_iptables = 1; |
@@ -98,6 +95,12 @@ static struct rtable __fake_rtable = { | |||
98 | .rt_flags = 0, | 95 | .rt_flags = 0, |
99 | }; | 96 | }; |
100 | 97 | ||
98 | static inline struct net_device *bridge_parent(const struct net_device *dev) | ||
99 | { | ||
100 | struct net_bridge_port *port = rcu_dereference(dev->br_port); | ||
101 | |||
102 | return port ? port->br->dev : NULL; | ||
103 | } | ||
101 | 104 | ||
102 | /* PF_BRIDGE/PRE_ROUTING *********************************************/ | 105 | /* PF_BRIDGE/PRE_ROUTING *********************************************/ |
103 | /* Undo the changes made for ip6tables PREROUTING and continue the | 106 | /* Undo the changes made for ip6tables PREROUTING and continue the |
@@ -189,11 +192,15 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) | |||
189 | skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; | 192 | skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; |
190 | 193 | ||
191 | skb->dev = bridge_parent(skb->dev); | 194 | skb->dev = bridge_parent(skb->dev); |
192 | if (skb->protocol == __constant_htons(ETH_P_8021Q)) { | 195 | if (!skb->dev) |
193 | skb_pull(skb, VLAN_HLEN); | 196 | kfree_skb(skb); |
194 | skb->nh.raw += VLAN_HLEN; | 197 | else { |
198 | if (skb->protocol == __constant_htons(ETH_P_8021Q)) { | ||
199 | skb_pull(skb, VLAN_HLEN); | ||
200 | skb->nh.raw += VLAN_HLEN; | ||
201 | } | ||
202 | skb->dst->output(skb); | ||
195 | } | 203 | } |
196 | skb->dst->output(skb); | ||
197 | return 0; | 204 | return 0; |
198 | } | 205 | } |
199 | 206 | ||
@@ -270,7 +277,7 @@ bridged_dnat: | |||
270 | } | 277 | } |
271 | 278 | ||
272 | /* Some common code for IPv4/IPv6 */ | 279 | /* Some common code for IPv4/IPv6 */ |
273 | static void setup_pre_routing(struct sk_buff *skb) | 280 | static struct net_device *setup_pre_routing(struct sk_buff *skb) |
274 | { | 281 | { |
275 | struct nf_bridge_info *nf_bridge = skb->nf_bridge; | 282 | struct nf_bridge_info *nf_bridge = skb->nf_bridge; |
276 | 283 | ||
@@ -282,6 +289,8 @@ static void setup_pre_routing(struct sk_buff *skb) | |||
282 | nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING; | 289 | nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING; |
283 | nf_bridge->physindev = skb->dev; | 290 | nf_bridge->physindev = skb->dev; |
284 | skb->dev = bridge_parent(skb->dev); | 291 | skb->dev = bridge_parent(skb->dev); |
292 | |||
293 | return skb->dev; | ||
285 | } | 294 | } |
286 | 295 | ||
287 | /* We only check the length. A bridge shouldn't do any hop-by-hop stuff anyway */ | 296 | /* We only check the length. A bridge shouldn't do any hop-by-hop stuff anyway */ |
@@ -376,7 +385,8 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook, | |||
376 | nf_bridge_put(skb->nf_bridge); | 385 | nf_bridge_put(skb->nf_bridge); |
377 | if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) | 386 | if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) |
378 | return NF_DROP; | 387 | return NF_DROP; |
379 | setup_pre_routing(skb); | 388 | if (!setup_pre_routing(skb)) |
389 | return NF_DROP; | ||
380 | 390 | ||
381 | NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL, | 391 | NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL, |
382 | br_nf_pre_routing_finish_ipv6); | 392 | br_nf_pre_routing_finish_ipv6); |
@@ -465,7 +475,8 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb, | |||
465 | nf_bridge_put(skb->nf_bridge); | 475 | nf_bridge_put(skb->nf_bridge); |
466 | if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) | 476 | if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) |
467 | return NF_DROP; | 477 | return NF_DROP; |
468 | setup_pre_routing(skb); | 478 | if (!setup_pre_routing(skb)) |
479 | return NF_DROP; | ||
469 | store_orig_dstaddr(skb); | 480 | store_orig_dstaddr(skb); |
470 | 481 | ||
471 | NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL, | 482 | NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL, |
@@ -539,11 +550,16 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb, | |||
539 | struct sk_buff *skb = *pskb; | 550 | struct sk_buff *skb = *pskb; |
540 | struct nf_bridge_info *nf_bridge; | 551 | struct nf_bridge_info *nf_bridge; |
541 | struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); | 552 | struct vlan_ethhdr *hdr = vlan_eth_hdr(skb); |
553 | struct net_device *parent; | ||
542 | int pf; | 554 | int pf; |
543 | 555 | ||
544 | if (!skb->nf_bridge) | 556 | if (!skb->nf_bridge) |
545 | return NF_ACCEPT; | 557 | return NF_ACCEPT; |
546 | 558 | ||
559 | parent = bridge_parent(out); | ||
560 | if (!parent) | ||
561 | return NF_DROP; | ||
562 | |||
547 | if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) | 563 | if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) |
548 | pf = PF_INET; | 564 | pf = PF_INET; |
549 | else | 565 | else |
@@ -564,8 +580,8 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb, | |||
564 | nf_bridge->mask |= BRNF_BRIDGED; | 580 | nf_bridge->mask |= BRNF_BRIDGED; |
565 | nf_bridge->physoutdev = skb->dev; | 581 | nf_bridge->physoutdev = skb->dev; |
566 | 582 | ||
567 | NF_HOOK(pf, NF_IP_FORWARD, skb, bridge_parent(in), | 583 | NF_HOOK(pf, NF_IP_FORWARD, skb, bridge_parent(in), parent, |
568 | bridge_parent(out), br_nf_forward_finish); | 584 | br_nf_forward_finish); |
569 | 585 | ||
570 | return NF_STOLEN; | 586 | return NF_STOLEN; |
571 | } | 587 | } |
@@ -688,6 +704,8 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb, | |||
688 | goto out; | 704 | goto out; |
689 | } | 705 | } |
690 | realoutdev = bridge_parent(skb->dev); | 706 | realoutdev = bridge_parent(skb->dev); |
707 | if (!realoutdev) | ||
708 | return NF_DROP; | ||
691 | 709 | ||
692 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 710 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
693 | /* iptables should match -o br0.x */ | 711 | /* iptables should match -o br0.x */ |
@@ -701,9 +719,11 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb, | |||
701 | /* IP forwarded traffic has a physindev, locally | 719 | /* IP forwarded traffic has a physindev, locally |
702 | * generated traffic hasn't. */ | 720 | * generated traffic hasn't. */ |
703 | if (realindev != NULL) { | 721 | if (realindev != NULL) { |
704 | if (!(nf_bridge->mask & BRNF_DONT_TAKE_PARENT) && | 722 | if (!(nf_bridge->mask & BRNF_DONT_TAKE_PARENT) ) { |
705 | has_bridge_parent(realindev)) | 723 | struct net_device *parent = bridge_parent(realindev); |
706 | realindev = bridge_parent(realindev); | 724 | if (parent) |
725 | realindev = parent; | ||
726 | } | ||
707 | 727 | ||
708 | NF_HOOK_THRESH(pf, NF_IP_FORWARD, skb, realindev, | 728 | NF_HOOK_THRESH(pf, NF_IP_FORWARD, skb, realindev, |
709 | realoutdev, br_nf_local_out_finish, | 729 | realoutdev, br_nf_local_out_finish, |
@@ -743,6 +763,9 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb, | |||
743 | if (!nf_bridge) | 763 | if (!nf_bridge) |
744 | return NF_ACCEPT; | 764 | return NF_ACCEPT; |
745 | 765 | ||
766 | if (!realoutdev) | ||
767 | return NF_DROP; | ||
768 | |||
746 | if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) | 769 | if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP) |
747 | pf = PF_INET; | 770 | pf = PF_INET; |
748 | else | 771 | else |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index e330b17b6d81..8f10e09f251b 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -68,7 +68,6 @@ struct net_bridge_port | |||
68 | /* STP */ | 68 | /* STP */ |
69 | u8 priority; | 69 | u8 priority; |
70 | u8 state; | 70 | u8 state; |
71 | u8 deleted; | ||
72 | u16 port_no; | 71 | u16 port_no; |
73 | unsigned char topology_change_ack; | 72 | unsigned char topology_change_ack; |
74 | unsigned char config_pending; | 73 | unsigned char config_pending; |
@@ -233,9 +232,8 @@ extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent); | |||
233 | 232 | ||
234 | #ifdef CONFIG_SYSFS | 233 | #ifdef CONFIG_SYSFS |
235 | /* br_sysfs_if.c */ | 234 | /* br_sysfs_if.c */ |
235 | extern struct sysfs_ops brport_sysfs_ops; | ||
236 | extern int br_sysfs_addif(struct net_bridge_port *p); | 236 | extern int br_sysfs_addif(struct net_bridge_port *p); |
237 | extern void br_sysfs_removeif(struct net_bridge_port *p); | ||
238 | extern void br_sysfs_freeif(struct net_bridge_port *p); | ||
239 | 237 | ||
240 | /* br_sysfs_br.c */ | 238 | /* br_sysfs_br.c */ |
241 | extern int br_sysfs_addbr(struct net_device *dev); | 239 | extern int br_sysfs_addbr(struct net_device *dev); |
@@ -244,8 +242,6 @@ extern void br_sysfs_delbr(struct net_device *dev); | |||
244 | #else | 242 | #else |
245 | 243 | ||
246 | #define br_sysfs_addif(p) (0) | 244 | #define br_sysfs_addif(p) (0) |
247 | #define br_sysfs_removeif(p) do { } while(0) | ||
248 | #define br_sysfs_freeif(p) kfree(p) | ||
249 | #define br_sysfs_addbr(dev) (0) | 245 | #define br_sysfs_addbr(dev) (0) |
250 | #define br_sysfs_delbr(dev) do { } while(0) | 246 | #define br_sysfs_delbr(dev) do { } while(0) |
251 | #endif /* CONFIG_SYSFS */ | 247 | #endif /* CONFIG_SYSFS */ |
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c index d071f1c9ad0b..296f6a487c52 100644 --- a/net/bridge/br_stp_bpdu.c +++ b/net/bridge/br_stp_bpdu.c | |||
@@ -133,29 +133,35 @@ void br_send_tcn_bpdu(struct net_bridge_port *p) | |||
133 | 133 | ||
134 | static const unsigned char header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00}; | 134 | static const unsigned char header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00}; |
135 | 135 | ||
136 | /* NO locks */ | 136 | /* NO locks, but rcu_read_lock (preempt_disabled) */ |
137 | int br_stp_handle_bpdu(struct sk_buff *skb) | 137 | int br_stp_handle_bpdu(struct sk_buff *skb) |
138 | { | 138 | { |
139 | struct net_bridge_port *p = skb->dev->br_port; | 139 | struct net_bridge_port *p = rcu_dereference(skb->dev->br_port); |
140 | struct net_bridge *br = p->br; | 140 | struct net_bridge *br; |
141 | unsigned char *buf; | 141 | unsigned char *buf; |
142 | 142 | ||
143 | if (!p) | ||
144 | goto err; | ||
145 | |||
146 | br = p->br; | ||
147 | spin_lock(&br->lock); | ||
148 | |||
149 | if (p->state == BR_STATE_DISABLED || !(br->dev->flags & IFF_UP)) | ||
150 | goto out; | ||
151 | |||
143 | /* insert into forwarding database after filtering to avoid spoofing */ | 152 | /* insert into forwarding database after filtering to avoid spoofing */ |
144 | br_fdb_update(p->br, p, eth_hdr(skb)->h_source); | 153 | br_fdb_update(br, p, eth_hdr(skb)->h_source); |
154 | |||
155 | if (!br->stp_enabled) | ||
156 | goto out; | ||
145 | 157 | ||
146 | /* need at least the 802 and STP headers */ | 158 | /* need at least the 802 and STP headers */ |
147 | if (!pskb_may_pull(skb, sizeof(header)+1) || | 159 | if (!pskb_may_pull(skb, sizeof(header)+1) || |
148 | memcmp(skb->data, header, sizeof(header))) | 160 | memcmp(skb->data, header, sizeof(header))) |
149 | goto err; | 161 | goto out; |
150 | 162 | ||
151 | buf = skb_pull(skb, sizeof(header)); | 163 | buf = skb_pull(skb, sizeof(header)); |
152 | 164 | ||
153 | spin_lock_bh(&br->lock); | ||
154 | if (p->state == BR_STATE_DISABLED | ||
155 | || !(br->dev->flags & IFF_UP) | ||
156 | || !br->stp_enabled) | ||
157 | goto out; | ||
158 | |||
159 | if (buf[0] == BPDU_TYPE_CONFIG) { | 165 | if (buf[0] == BPDU_TYPE_CONFIG) { |
160 | struct br_config_bpdu bpdu; | 166 | struct br_config_bpdu bpdu; |
161 | 167 | ||
@@ -201,7 +207,7 @@ int br_stp_handle_bpdu(struct sk_buff *skb) | |||
201 | br_received_tcn_bpdu(p); | 207 | br_received_tcn_bpdu(p); |
202 | } | 208 | } |
203 | out: | 209 | out: |
204 | spin_unlock_bh(&br->lock); | 210 | spin_unlock(&br->lock); |
205 | err: | 211 | err: |
206 | kfree_skb(skb); | 212 | kfree_skb(skb); |
207 | return 0; | 213 | return 0; |
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c index 0ac0355d16dd..c51c9e42aeb3 100644 --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c | |||
@@ -195,23 +195,11 @@ static ssize_t brport_store(struct kobject * kobj, | |||
195 | return ret; | 195 | return ret; |
196 | } | 196 | } |
197 | 197 | ||
198 | /* called from kobject_put when port ref count goes to zero. */ | 198 | struct sysfs_ops brport_sysfs_ops = { |
199 | static void brport_release(struct kobject *kobj) | ||
200 | { | ||
201 | kfree(container_of(kobj, struct net_bridge_port, kobj)); | ||
202 | } | ||
203 | |||
204 | static struct sysfs_ops brport_sysfs_ops = { | ||
205 | .show = brport_show, | 199 | .show = brport_show, |
206 | .store = brport_store, | 200 | .store = brport_store, |
207 | }; | 201 | }; |
208 | 202 | ||
209 | static struct kobj_type brport_ktype = { | ||
210 | .sysfs_ops = &brport_sysfs_ops, | ||
211 | .release = brport_release, | ||
212 | }; | ||
213 | |||
214 | |||
215 | /* | 203 | /* |
216 | * Add sysfs entries to ethernet device added to a bridge. | 204 | * Add sysfs entries to ethernet device added to a bridge. |
217 | * Creates a brport subdirectory with bridge attributes. | 205 | * Creates a brport subdirectory with bridge attributes. |
@@ -223,17 +211,6 @@ int br_sysfs_addif(struct net_bridge_port *p) | |||
223 | struct brport_attribute **a; | 211 | struct brport_attribute **a; |
224 | int err; | 212 | int err; |
225 | 213 | ||
226 | ASSERT_RTNL(); | ||
227 | |||
228 | kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR); | ||
229 | p->kobj.ktype = &brport_ktype; | ||
230 | p->kobj.parent = &(p->dev->class_dev.kobj); | ||
231 | p->kobj.kset = NULL; | ||
232 | |||
233 | err = kobject_add(&p->kobj); | ||
234 | if(err) | ||
235 | goto out1; | ||
236 | |||
237 | err = sysfs_create_link(&p->kobj, &br->dev->class_dev.kobj, | 214 | err = sysfs_create_link(&p->kobj, &br->dev->class_dev.kobj, |
238 | SYSFS_BRIDGE_PORT_LINK); | 215 | SYSFS_BRIDGE_PORT_LINK); |
239 | if (err) | 216 | if (err) |
@@ -245,28 +222,7 @@ int br_sysfs_addif(struct net_bridge_port *p) | |||
245 | goto out2; | 222 | goto out2; |
246 | } | 223 | } |
247 | 224 | ||
248 | err = sysfs_create_link(&br->ifobj, &p->kobj, p->dev->name); | 225 | err= sysfs_create_link(&br->ifobj, &p->kobj, p->dev->name); |
249 | if (err) | 226 | out2: |
250 | goto out2; | ||
251 | |||
252 | kobject_uevent(&p->kobj, KOBJ_ADD); | ||
253 | return 0; | ||
254 | out2: | ||
255 | kobject_del(&p->kobj); | ||
256 | out1: | ||
257 | return err; | 227 | return err; |
258 | } | 228 | } |
259 | |||
260 | void br_sysfs_removeif(struct net_bridge_port *p) | ||
261 | { | ||
262 | pr_debug("br_sysfs_removeif\n"); | ||
263 | sysfs_remove_link(&p->br->ifobj, p->dev->name); | ||
264 | kobject_uevent(&p->kobj, KOBJ_REMOVE); | ||
265 | kobject_del(&p->kobj); | ||
266 | } | ||
267 | |||
268 | void br_sysfs_freeif(struct net_bridge_port *p) | ||
269 | { | ||
270 | pr_debug("br_sysfs_freeif\n"); | ||
271 | kobject_put(&p->kobj); | ||
272 | } | ||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8700379685e0..eca2976abb25 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -455,7 +455,7 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) | |||
455 | if (!skb) | 455 | if (!skb) |
456 | return; | 456 | return; |
457 | 457 | ||
458 | if (rtnetlink_fill_ifinfo(skb, dev, type, current->pid, 0, change, 0) < 0) { | 458 | if (rtnetlink_fill_ifinfo(skb, dev, type, 0, 0, change, 0) < 0) { |
459 | kfree_skb(skb); | 459 | kfree_skb(skb); |
460 | return; | 460 | return; |
461 | } | 461 | } |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 95b9d81ac488..3ffa60dadc0c 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1135,7 +1135,7 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa) | |||
1135 | 1135 | ||
1136 | if (!skb) | 1136 | if (!skb) |
1137 | netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS); | 1137 | netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS); |
1138 | else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) { | 1138 | else if (inet_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) { |
1139 | kfree_skb(skb); | 1139 | kfree_skb(skb); |
1140 | netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL); | 1140 | netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL); |
1141 | } else { | 1141 | } else { |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index ef4724de7350..0f4145babb14 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -1045,7 +1045,7 @@ fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm, | |||
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | nl->nlmsg_flags = NLM_F_REQUEST; | 1047 | nl->nlmsg_flags = NLM_F_REQUEST; |
1048 | nl->nlmsg_pid = current->pid; | 1048 | nl->nlmsg_pid = 0; |
1049 | nl->nlmsg_seq = 0; | 1049 | nl->nlmsg_seq = 0; |
1050 | nl->nlmsg_len = NLMSG_LENGTH(sizeof(*rtm)); | 1050 | nl->nlmsg_len = NLMSG_LENGTH(sizeof(*rtm)); |
1051 | if (cmd == SIOCDELRT) { | 1051 | if (cmd == SIOCDELRT) { |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a97ed5416c28..e9a54ae7d690 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -456,7 +456,8 @@ void tcp_rcv_space_adjust(struct sock *sk) | |||
456 | 456 | ||
457 | tp->rcvq_space.space = space; | 457 | tp->rcvq_space.space = space; |
458 | 458 | ||
459 | if (sysctl_tcp_moderate_rcvbuf) { | 459 | if (sysctl_tcp_moderate_rcvbuf && |
460 | !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) { | ||
460 | int new_clamp = space; | 461 | int new_clamp = space; |
461 | 462 | ||
462 | /* Receive space grows, normalize in order to | 463 | /* Receive space grows, normalize in order to |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 890bac0d4a56..e3debbdb67f5 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
@@ -343,12 +343,12 @@ static void irda_task_timer_expired(void *data) | |||
343 | static void irda_device_setup(struct net_device *dev) | 343 | static void irda_device_setup(struct net_device *dev) |
344 | { | 344 | { |
345 | dev->hard_header_len = 0; | 345 | dev->hard_header_len = 0; |
346 | dev->addr_len = 0; | 346 | dev->addr_len = LAP_ALEN; |
347 | 347 | ||
348 | dev->type = ARPHRD_IRDA; | 348 | dev->type = ARPHRD_IRDA; |
349 | dev->tx_queue_len = 8; /* Window size + 1 s-frame */ | 349 | dev->tx_queue_len = 8; /* Window size + 1 s-frame */ |
350 | 350 | ||
351 | memset(dev->broadcast, 0xff, 4); | 351 | memset(dev->broadcast, 0xff, LAP_ALEN); |
352 | 352 | ||
353 | dev->mtu = 2048; | 353 | dev->mtu = 2048; |
354 | dev->flags = IFF_NOARP; | 354 | dev->flags = IFF_NOARP; |
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c index 07ec326c71f5..f65c7a83bc5c 100644 --- a/net/irda/irnet/irnet_irda.c +++ b/net/irda/irnet/irnet_irda.c | |||
@@ -696,7 +696,7 @@ irnet_daddr_to_dname(irnet_socket * self) | |||
696 | { | 696 | { |
697 | /* Yes !!! Get it.. */ | 697 | /* Yes !!! Get it.. */ |
698 | strlcpy(self->rname, discoveries[i].info, sizeof(self->rname)); | 698 | strlcpy(self->rname, discoveries[i].info, sizeof(self->rname)); |
699 | self->rname[NICKNAME_MAX_LEN + 1] = '\0'; | 699 | self->rname[sizeof(self->rname) - 1] = '\0'; |
700 | DEBUG(IRDA_SERV_INFO, "Device 0x%08x is in fact ``%s''.\n", | 700 | DEBUG(IRDA_SERV_INFO, "Device 0x%08x is in fact ``%s''.\n", |
701 | self->daddr, self->rname); | 701 | self->daddr, self->rname); |
702 | kfree(discoveries); | 702 | kfree(discoveries); |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 2101b45d2ec6..6b9772d95872 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -702,7 +702,8 @@ struct sock *netlink_getsockbyfilp(struct file *filp) | |||
702 | * 0: continue | 702 | * 0: continue |
703 | * 1: repeat lookup - reference dropped while waiting for socket memory. | 703 | * 1: repeat lookup - reference dropped while waiting for socket memory. |
704 | */ | 704 | */ |
705 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo) | 705 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, |
706 | long timeo, struct sock *ssk) | ||
706 | { | 707 | { |
707 | struct netlink_sock *nlk; | 708 | struct netlink_sock *nlk; |
708 | 709 | ||
@@ -712,7 +713,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long t | |||
712 | test_bit(0, &nlk->state)) { | 713 | test_bit(0, &nlk->state)) { |
713 | DECLARE_WAITQUEUE(wait, current); | 714 | DECLARE_WAITQUEUE(wait, current); |
714 | if (!timeo) { | 715 | if (!timeo) { |
715 | if (!nlk->pid) | 716 | if (!ssk || nlk_sk(ssk)->pid == 0) |
716 | netlink_overrun(sk); | 717 | netlink_overrun(sk); |
717 | sock_put(sk); | 718 | sock_put(sk); |
718 | kfree_skb(skb); | 719 | kfree_skb(skb); |
@@ -797,7 +798,7 @@ retry: | |||
797 | kfree_skb(skb); | 798 | kfree_skb(skb); |
798 | return PTR_ERR(sk); | 799 | return PTR_ERR(sk); |
799 | } | 800 | } |
800 | err = netlink_attachskb(sk, skb, nonblock, timeo); | 801 | err = netlink_attachskb(sk, skb, nonblock, timeo, ssk); |
801 | if (err == 1) | 802 | if (err == 1) |
802 | goto retry; | 803 | goto retry; |
803 | if (err) | 804 | if (err) |