direct-io.hg

changeset 6165:c31e1abf4df2

merge.
author kaf24@firebug.cl.cam.ac.uk
date Mon Aug 15 07:24:30 2005 +0000 (2005-08-15)
parents 01a7cde73390 b667f34d209f
children bf9351732ddf
files linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64 linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/interface.c linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h patches/linux-2.6.12/linux-2.6.12.4.patch tools/examples/Makefile tools/python/xen/lowlevel/xu/xu.c tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendRoot.py tools/python/xen/xend/server/netif.py xen/common/grant_table.c xen/include/public/io/domain_controller.h
line diff
    10.1 --- a/patches/linux-2.6.12/linux-2.6.12.3.patch	Sun Aug 14 23:42:11 2005 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,1047 +0,0 @@
    10.4 -diff --git a/Makefile b/Makefile
    10.5 ---- a/Makefile
    10.6 -+++ b/Makefile
    10.7 -@@ -1,7 +1,7 @@
    10.8 - VERSION = 2
    10.9 - PATCHLEVEL = 6
   10.10 - SUBLEVEL = 12
   10.11 --EXTRAVERSION =
   10.12 -+EXTRAVERSION = .3
   10.13 - NAME=Woozy Numbat
   10.14 - 
   10.15 - # *DOCUMENTATION*
   10.16 -diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
   10.17 ---- a/arch/ia64/kernel/ptrace.c
   10.18 -+++ b/arch/ia64/kernel/ptrace.c
   10.19 -@@ -945,6 +945,13 @@ access_uarea (struct task_struct *child,
   10.20 - 				*data = (pt->cr_ipsr & IPSR_MASK);
   10.21 - 			return 0;
   10.22 - 
   10.23 -+		      case PT_AR_RSC:
   10.24 -+			if (write_access)
   10.25 -+				pt->ar_rsc = *data | (3 << 2); /* force PL3 */
   10.26 -+			else
   10.27 -+				*data = pt->ar_rsc;
   10.28 -+			return 0;
   10.29 -+
   10.30 - 		      case PT_AR_RNAT:
   10.31 - 			urbs_end = ia64_get_user_rbs_end(child, pt, NULL);
   10.32 - 			rnat_addr = (long) ia64_rse_rnat_addr((long *)
   10.33 -@@ -996,9 +1003,6 @@ access_uarea (struct task_struct *child,
   10.34 - 		      case PT_AR_BSPSTORE:
   10.35 - 			ptr = pt_reg_addr(pt, ar_bspstore);
   10.36 - 			break;
   10.37 --		      case PT_AR_RSC:
   10.38 --			ptr = pt_reg_addr(pt, ar_rsc);
   10.39 --			break;
   10.40 - 		      case PT_AR_UNAT:
   10.41 - 			ptr = pt_reg_addr(pt, ar_unat);
   10.42 - 			break;
   10.43 -@@ -1234,7 +1238,7 @@ ptrace_getregs (struct task_struct *chil
   10.44 - static long
   10.45 - ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
   10.46 - {
   10.47 --	unsigned long psr, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;
   10.48 -+	unsigned long psr, rsc, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;
   10.49 - 	struct unw_frame_info info;
   10.50 - 	struct switch_stack *sw;
   10.51 - 	struct ia64_fpreg fpval;
   10.52 -@@ -1267,7 +1271,7 @@ ptrace_setregs (struct task_struct *chil
   10.53 - 	/* app regs */
   10.54 - 
   10.55 - 	retval |= __get_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]);
   10.56 --	retval |= __get_user(pt->ar_rsc, &ppr->ar[PT_AUR_RSC]);
   10.57 -+	retval |= __get_user(rsc, &ppr->ar[PT_AUR_RSC]);
   10.58 - 	retval |= __get_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]);
   10.59 - 	retval |= __get_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]);
   10.60 - 	retval |= __get_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]);
   10.61 -@@ -1365,6 +1369,7 @@ ptrace_setregs (struct task_struct *chil
   10.62 - 	retval |= __get_user(nat_bits, &ppr->nat);
   10.63 - 
   10.64 - 	retval |= access_uarea(child, PT_CR_IPSR, &psr, 1);
   10.65 -+	retval |= access_uarea(child, PT_AR_RSC, &rsc, 1);
   10.66 - 	retval |= access_uarea(child, PT_AR_EC, &ec, 1);
   10.67 - 	retval |= access_uarea(child, PT_AR_LC, &lc, 1);
   10.68 - 	retval |= access_uarea(child, PT_AR_RNAT, &rnat, 1);
   10.69 -diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
   10.70 ---- a/arch/ia64/kernel/signal.c
   10.71 -+++ b/arch/ia64/kernel/signal.c
   10.72 -@@ -94,7 +94,7 @@ sys_sigaltstack (const stack_t __user *u
   10.73 - static long
   10.74 - restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
   10.75 - {
   10.76 --	unsigned long ip, flags, nat, um, cfm;
   10.77 -+	unsigned long ip, flags, nat, um, cfm, rsc;
   10.78 - 	long err;
   10.79 - 
   10.80 - 	/* Always make any pending restarted system calls return -EINTR */
   10.81 -@@ -106,7 +106,7 @@ restore_sigcontext (struct sigcontext __
   10.82 - 	err |= __get_user(ip, &sc->sc_ip);			/* instruction pointer */
   10.83 - 	err |= __get_user(cfm, &sc->sc_cfm);
   10.84 - 	err |= __get_user(um, &sc->sc_um);			/* user mask */
   10.85 --	err |= __get_user(scr->pt.ar_rsc, &sc->sc_ar_rsc);
   10.86 -+	err |= __get_user(rsc, &sc->sc_ar_rsc);
   10.87 - 	err |= __get_user(scr->pt.ar_unat, &sc->sc_ar_unat);
   10.88 - 	err |= __get_user(scr->pt.ar_fpsr, &sc->sc_ar_fpsr);
   10.89 - 	err |= __get_user(scr->pt.ar_pfs, &sc->sc_ar_pfs);
   10.90 -@@ -119,6 +119,7 @@ restore_sigcontext (struct sigcontext __
   10.91 - 	err |= __copy_from_user(&scr->pt.r15, &sc->sc_gr[15], 8);	/* r15 */
   10.92 - 
   10.93 - 	scr->pt.cr_ifs = cfm | (1UL << 63);
   10.94 -+	scr->pt.ar_rsc = rsc | (3 << 2); /* force PL3 */
   10.95 - 
   10.96 - 	/* establish new instruction pointer: */
   10.97 - 	scr->pt.cr_iip = ip & ~0x3UL;
   10.98 -diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
   10.99 ---- a/arch/ppc/kernel/time.c
  10.100 -+++ b/arch/ppc/kernel/time.c
  10.101 -@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale;
  10.102 - 
  10.103 - extern unsigned long wall_jiffies;
  10.104 - 
  10.105 -+/* used for timezone offset */
  10.106 -+static long timezone_offset;
  10.107 -+
  10.108 - DEFINE_SPINLOCK(rtc_lock);
  10.109 - 
  10.110 - EXPORT_SYMBOL(rtc_lock);
  10.111 -@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * re
  10.112 - 		     xtime.tv_sec - last_rtc_update >= 659 &&
  10.113 - 		     abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
  10.114 - 		     jiffies - wall_jiffies == 1) {
  10.115 --		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0)
  10.116 -+		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
  10.117 - 				last_rtc_update = xtime.tv_sec+1;
  10.118 - 			else
  10.119 - 				/* Try again one minute later */
  10.120 -@@ -286,7 +289,7 @@ void __init time_init(void)
  10.121 - 	unsigned old_stamp, stamp, elapsed;
  10.122 - 
  10.123 -         if (ppc_md.time_init != NULL)
  10.124 --                time_offset = ppc_md.time_init();
  10.125 -+                timezone_offset = ppc_md.time_init();
  10.126 - 
  10.127 - 	if (__USE_RTC()) {
  10.128 - 		/* 601 processor: dec counts down by 128 every 128ns */
  10.129 -@@ -331,10 +334,10 @@ void __init time_init(void)
  10.130 - 	set_dec(tb_ticks_per_jiffy);
  10.131 - 
  10.132 - 	/* If platform provided a timezone (pmac), we correct the time */
  10.133 --        if (time_offset) {
  10.134 --		sys_tz.tz_minuteswest = -time_offset / 60;
  10.135 -+        if (timezone_offset) {
  10.136 -+		sys_tz.tz_minuteswest = -timezone_offset / 60;
  10.137 - 		sys_tz.tz_dsttime = 0;
  10.138 --		xtime.tv_sec -= time_offset;
  10.139 -+		xtime.tv_sec -= timezone_offset;
  10.140 -         }
  10.141 -         set_normalized_timespec(&wall_to_monotonic,
  10.142 -                                 -xtime.tv_sec, -xtime.tv_nsec);
  10.143 -diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
  10.144 ---- a/arch/um/kernel/process.c
  10.145 -+++ b/arch/um/kernel/process.c
  10.146 -@@ -130,7 +130,7 @@ int start_fork_tramp(void *thread_arg, u
  10.147 - 	return(arg.pid);
  10.148 - }
  10.149 - 
  10.150 --static int ptrace_child(void)
  10.151 -+static int ptrace_child(void *arg)
  10.152 - {
  10.153 - 	int ret;
  10.154 - 	int pid = os_getpid(), ppid = getppid();
  10.155 -@@ -159,16 +159,20 @@ static int ptrace_child(void)
  10.156 - 	_exit(ret);
  10.157 - }
  10.158 - 
  10.159 --static int start_ptraced_child(void)
  10.160 -+static int start_ptraced_child(void **stack_out)
  10.161 - {
  10.162 -+	void *stack;
  10.163 -+	unsigned long sp;
  10.164 - 	int pid, n, status;
  10.165 - 	
  10.166 --	pid = fork();
  10.167 --	if(pid == 0)
  10.168 --		ptrace_child();
  10.169 --
  10.170 -+	stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
  10.171 -+		     MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  10.172 -+	if(stack == MAP_FAILED)
  10.173 -+		panic("check_ptrace : mmap failed, errno = %d", errno);
  10.174 -+	sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
  10.175 -+	pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
  10.176 - 	if(pid < 0)
  10.177 --		panic("check_ptrace : fork failed, errno = %d", errno);
  10.178 -+		panic("check_ptrace : clone failed, errno = %d", errno);
  10.179 - 	CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
  10.180 - 	if(n < 0)
  10.181 - 		panic("check_ptrace : wait failed, errno = %d", errno);
  10.182 -@@ -176,6 +180,7 @@ static int start_ptraced_child(void)
  10.183 - 		panic("check_ptrace : expected SIGSTOP, got status = %d",
  10.184 - 		      status);
  10.185 - 
  10.186 -+	*stack_out = stack;
  10.187 - 	return(pid);
  10.188 - }
  10.189 - 
  10.190 -@@ -183,12 +188,12 @@ static int start_ptraced_child(void)
  10.191 -  * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
  10.192 -  * So only for SYSEMU features we test mustpanic, while normal host features
  10.193 -  * must work anyway!*/
  10.194 --static int stop_ptraced_child(int pid, int exitcode, int mustexit)
  10.195 -+static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic)
  10.196 - {
  10.197 - 	int status, n, ret = 0;
  10.198 - 
  10.199 - 	if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
  10.200 --		panic("stop_ptraced_child : ptrace failed, errno = %d", errno);
  10.201 -+		panic("check_ptrace : ptrace failed, errno = %d", errno);
  10.202 - 	CATCH_EINTR(n = waitpid(pid, &status, 0));
  10.203 - 	if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
  10.204 - 		int exit_with = WEXITSTATUS(status);
  10.205 -@@ -199,13 +204,15 @@ static int stop_ptraced_child(int pid, i
  10.206 - 		printk("check_ptrace : child exited with exitcode %d, while "
  10.207 - 		      "expecting %d; status 0x%x", exit_with,
  10.208 - 		      exitcode, status);
  10.209 --		if (mustexit)
  10.210 -+		if (mustpanic)
  10.211 - 			panic("\n");
  10.212 - 		else
  10.213 - 			printk("\n");
  10.214 - 		ret = -1;
  10.215 - 	}
  10.216 - 
  10.217 -+	if(munmap(stack, PAGE_SIZE) < 0)
  10.218 -+		panic("check_ptrace : munmap failed, errno = %d", errno);
  10.219 - 	return ret;
  10.220 - }
  10.221 - 
  10.222 -@@ -227,11 +234,12 @@ __uml_setup("nosysemu", nosysemu_cmd_par
  10.223 - 
  10.224 - static void __init check_sysemu(void)
  10.225 - {
  10.226 -+	void *stack;
  10.227 - 	int pid, syscall, n, status, count=0;
  10.228 - 
  10.229 - 	printk("Checking syscall emulation patch for ptrace...");
  10.230 - 	sysemu_supported = 0;
  10.231 --	pid = start_ptraced_child();
  10.232 -+	pid = start_ptraced_child(&stack);
  10.233 - 
  10.234 - 	if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)
  10.235 - 		goto fail;
  10.236 -@@ -249,7 +257,7 @@ static void __init check_sysemu(void)
  10.237 - 		panic("check_sysemu : failed to modify system "
  10.238 - 		      "call return, errno = %d", errno);
  10.239 - 
  10.240 --	if (stop_ptraced_child(pid, 0, 0) < 0)
  10.241 -+	if (stop_ptraced_child(pid, stack, 0, 0) < 0)
  10.242 - 		goto fail_stopped;
  10.243 - 
  10.244 - 	sysemu_supported = 1;
  10.245 -@@ -257,7 +265,7 @@ static void __init check_sysemu(void)
  10.246 - 	set_using_sysemu(!force_sysemu_disabled);
  10.247 - 
  10.248 - 	printk("Checking advanced syscall emulation patch for ptrace...");
  10.249 --	pid = start_ptraced_child();
  10.250 -+	pid = start_ptraced_child(&stack);
  10.251 - 	while(1){
  10.252 - 		count++;
  10.253 - 		if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
  10.254 -@@ -282,7 +290,7 @@ static void __init check_sysemu(void)
  10.255 - 			break;
  10.256 - 		}
  10.257 - 	}
  10.258 --	if (stop_ptraced_child(pid, 0, 0) < 0)
  10.259 -+	if (stop_ptraced_child(pid, stack, 0, 0) < 0)
  10.260 - 		goto fail_stopped;
  10.261 - 
  10.262 - 	sysemu_supported = 2;
  10.263 -@@ -293,17 +301,18 @@ static void __init check_sysemu(void)
  10.264 - 	return;
  10.265 - 
  10.266 - fail:
  10.267 --	stop_ptraced_child(pid, 1, 0);
  10.268 -+	stop_ptraced_child(pid, stack, 1, 0);
  10.269 - fail_stopped:
  10.270 - 	printk("missing\n");
  10.271 - }
  10.272 - 
  10.273 - void __init check_ptrace(void)
  10.274 - {
  10.275 -+	void *stack;
  10.276 - 	int pid, syscall, n, status;
  10.277 - 
  10.278 - 	printk("Checking that ptrace can change system call numbers...");
  10.279 --	pid = start_ptraced_child();
  10.280 -+	pid = start_ptraced_child(&stack);
  10.281 - 
  10.282 - 	if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
  10.283 - 		panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno);
  10.284 -@@ -330,7 +339,7 @@ void __init check_ptrace(void)
  10.285 - 			break;
  10.286 - 		}
  10.287 - 	}
  10.288 --	stop_ptraced_child(pid, 0, 1);
  10.289 -+	stop_ptraced_child(pid, stack, 0, 1);
  10.290 - 	printk("OK\n");
  10.291 - 	check_sysemu();
  10.292 - }
  10.293 -@@ -362,10 +371,11 @@ void forward_pending_sigio(int target)
  10.294 - static inline int check_skas3_ptrace_support(void)
  10.295 - {
  10.296 - 	struct ptrace_faultinfo fi;
  10.297 -+	void *stack;
  10.298 - 	int pid, n, ret = 1;
  10.299 - 
  10.300 - 	printf("Checking for the skas3 patch in the host...");
  10.301 --	pid = start_ptraced_child();
  10.302 -+	pid = start_ptraced_child(&stack);
  10.303 - 
  10.304 - 	n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
  10.305 - 	if (n < 0) {
  10.306 -@@ -380,7 +390,7 @@ static inline int check_skas3_ptrace_sup
  10.307 - 	}
  10.308 - 
  10.309 - 	init_registers(pid);
  10.310 --	stop_ptraced_child(pid, 1, 1);
  10.311 -+	stop_ptraced_child(pid, stack, 1, 1);
  10.312 - 
  10.313 - 	return(ret);
  10.314 - }
  10.315 -diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
  10.316 ---- a/drivers/acpi/pci_irq.c
  10.317 -+++ b/drivers/acpi/pci_irq.c
  10.318 -@@ -433,8 +433,9 @@ acpi_pci_irq_enable (
  10.319 - 		printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
  10.320 - 			pci_name(dev), ('A' + pin));
  10.321 - 		/* Interrupt Line values above 0xF are forbidden */
  10.322 --		if (dev->irq >= 0 && (dev->irq <= 0xF)) {
  10.323 -+		if (dev->irq > 0 && (dev->irq <= 0xF)) {
  10.324 - 			printk(" - using IRQ %d\n", dev->irq);
  10.325 -+			acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
  10.326 - 			return_VALUE(0);
  10.327 - 		}
  10.328 - 		else {
  10.329 -diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
  10.330 ---- a/drivers/char/tpm/tpm.c
  10.331 -+++ b/drivers/char/tpm/tpm.c
  10.332 -@@ -32,12 +32,6 @@
  10.333 - 
  10.334 - #define	TPM_BUFSIZE			2048
  10.335 - 
  10.336 --/* PCI configuration addresses */
  10.337 --#define	PCI_GEN_PMCON_1			0xA0
  10.338 --#define	PCI_GEN1_DEC			0xE4
  10.339 --#define	PCI_LPC_EN			0xE6
  10.340 --#define	PCI_GEN2_DEC			0xEC
  10.341 --
  10.342 - static LIST_HEAD(tpm_chip_list);
  10.343 - static DEFINE_SPINLOCK(driver_lock);
  10.344 - static int dev_mask[32];
  10.345 -@@ -61,72 +55,6 @@ void tpm_time_expired(unsigned long ptr)
  10.346 - EXPORT_SYMBOL_GPL(tpm_time_expired);
  10.347 - 
  10.348 - /*
  10.349 -- * Initialize the LPC bus and enable the TPM ports
  10.350 -- */
  10.351 --int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
  10.352 --{
  10.353 --	u32 lpcenable, tmp;
  10.354 --	int is_lpcm = 0;
  10.355 --
  10.356 --	switch (pci_dev->vendor) {
  10.357 --	case PCI_VENDOR_ID_INTEL:
  10.358 --		switch (pci_dev->device) {
  10.359 --		case PCI_DEVICE_ID_INTEL_82801CA_12:
  10.360 --		case PCI_DEVICE_ID_INTEL_82801DB_12:
  10.361 --			is_lpcm = 1;
  10.362 --			break;
  10.363 --		}
  10.364 --		/* init ICH (enable LPC) */
  10.365 --		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
  10.366 --		lpcenable |= 0x20000000;
  10.367 --		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
  10.368 --
  10.369 --		if (is_lpcm) {
  10.370 --			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
  10.371 --					      &lpcenable);
  10.372 --			if ((lpcenable & 0x20000000) == 0) {
  10.373 --				dev_err(&pci_dev->dev,
  10.374 --					"cannot enable LPC\n");
  10.375 --				return -ENODEV;
  10.376 --			}
  10.377 --		}
  10.378 --
  10.379 --		/* initialize TPM registers */
  10.380 --		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
  10.381 --
  10.382 --		if (!is_lpcm)
  10.383 --			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
  10.384 --		else
  10.385 --			tmp =
  10.386 --			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |
  10.387 --			    0x00000001;
  10.388 --
  10.389 --		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
  10.390 --
  10.391 --		if (is_lpcm) {
  10.392 --			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
  10.393 --					      &tmp);
  10.394 --			tmp |= 0x00000004;	/* enable CLKRUN */
  10.395 --			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
  10.396 --					       tmp);
  10.397 --		}
  10.398 --		tpm_write_index(0x0D, 0x55);	/* unlock 4F */
  10.399 --		tpm_write_index(0x0A, 0x00);	/* int disable */
  10.400 --		tpm_write_index(0x08, base);	/* base addr lo */
  10.401 --		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */
  10.402 --		tpm_write_index(0x0D, 0xAA);	/* lock 4F */
  10.403 --		break;
  10.404 --	case PCI_VENDOR_ID_AMD:
  10.405 --		/* nothing yet */
  10.406 --		break;
  10.407 --	}
  10.408 --
  10.409 --	return 0;
  10.410 --}
  10.411 --
  10.412 --EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
  10.413 --
  10.414 --/*
  10.415 -  * Internal kernel interface to transmit TPM commands
  10.416 -  */
  10.417 - static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
  10.418 -@@ -590,10 +518,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
  10.419 - 	if (chip == NULL)
  10.420 - 		return -ENODEV;
  10.421 - 
  10.422 --	spin_lock(&driver_lock);
  10.423 --	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
  10.424 --	spin_unlock(&driver_lock);
  10.425 --
  10.426 - 	return 0;
  10.427 - }
  10.428 - 
  10.429 -diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
  10.430 ---- a/drivers/char/tpm/tpm.h
  10.431 -+++ b/drivers/char/tpm/tpm.h
  10.432 -@@ -79,8 +79,6 @@ static inline void tpm_write_index(int i
  10.433 - }
  10.434 - 
  10.435 - extern void tpm_time_expired(unsigned long);
  10.436 --extern int tpm_lpc_bus_init(struct pci_dev *, u16);
  10.437 --
  10.438 - extern int tpm_register_hardware(struct pci_dev *,
  10.439 - 				 struct tpm_vendor_specific *);
  10.440 - extern int tpm_open(struct inode *, struct file *);
  10.441 -diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
  10.442 ---- a/drivers/char/tpm/tpm_atmel.c
  10.443 -+++ b/drivers/char/tpm/tpm_atmel.c
  10.444 -@@ -22,7 +22,10 @@
  10.445 - #include "tpm.h"
  10.446 - 
  10.447 - /* Atmel definitions */
  10.448 --#define	TPM_ATML_BASE			0x400
  10.449 -+enum tpm_atmel_addr {
  10.450 -+	TPM_ATMEL_BASE_ADDR_LO = 0x08,
  10.451 -+	TPM_ATMEL_BASE_ADDR_HI = 0x09
  10.452 -+};
  10.453 - 
  10.454 - /* write status bits */
  10.455 - #define	ATML_STATUS_ABORT		0x01
  10.456 -@@ -127,7 +130,6 @@ static struct tpm_vendor_specific tpm_at
  10.457 - 	.cancel = tpm_atml_cancel,
  10.458 - 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
  10.459 - 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
  10.460 --	.base = TPM_ATML_BASE,
  10.461 - 	.miscdev = { .fops = &atmel_ops, },
  10.462 - };
  10.463 - 
  10.464 -@@ -136,14 +138,16 @@ static int __devinit tpm_atml_init(struc
  10.465 - {
  10.466 - 	u8 version[4];
  10.467 - 	int rc = 0;
  10.468 -+	int lo, hi;
  10.469 - 
  10.470 - 	if (pci_enable_device(pci_dev))
  10.471 - 		return -EIO;
  10.472 - 
  10.473 --	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
  10.474 --		rc = -ENODEV;
  10.475 --		goto out_err;
  10.476 --	}
  10.477 -+	lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
  10.478 -+	hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
  10.479 -+
  10.480 -+	tpm_atmel.base = (hi<<8)|lo;
  10.481 -+	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
  10.482 - 
  10.483 - 	/* verify that it is an Atmel part */
  10.484 - 	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
  10.485 -diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
  10.486 ---- a/drivers/char/tpm/tpm_nsc.c
  10.487 -+++ b/drivers/char/tpm/tpm_nsc.c
  10.488 -@@ -24,6 +24,10 @@
  10.489 - /* National definitions */
  10.490 - #define	TPM_NSC_BASE			0x360
  10.491 - #define	TPM_NSC_IRQ			0x07
  10.492 -+#define	TPM_NSC_BASE0_HI		0x60
  10.493 -+#define	TPM_NSC_BASE0_LO		0x61
  10.494 -+#define	TPM_NSC_BASE1_HI		0x62
  10.495 -+#define	TPM_NSC_BASE1_LO		0x63
  10.496 - 
  10.497 - #define	NSC_LDN_INDEX			0x07
  10.498 - #define	NSC_SID_INDEX			0x20
  10.499 -@@ -234,7 +238,6 @@ static struct tpm_vendor_specific tpm_ns
  10.500 - 	.cancel = tpm_nsc_cancel,
  10.501 - 	.req_complete_mask = NSC_STATUS_OBF,
  10.502 - 	.req_complete_val = NSC_STATUS_OBF,
  10.503 --	.base = TPM_NSC_BASE,
  10.504 - 	.miscdev = { .fops = &nsc_ops, },
  10.505 - 	
  10.506 - };
  10.507 -@@ -243,15 +246,16 @@ static int __devinit tpm_nsc_init(struct
  10.508 - 				  const struct pci_device_id *pci_id)
  10.509 - {
  10.510 - 	int rc = 0;
  10.511 -+	int lo, hi;
  10.512 -+
  10.513 -+	hi = tpm_read_index(TPM_NSC_BASE0_HI);
  10.514 -+	lo = tpm_read_index(TPM_NSC_BASE0_LO);
  10.515 -+
  10.516 -+	tpm_nsc.base = (hi<<8) | lo;
  10.517 - 
  10.518 - 	if (pci_enable_device(pci_dev))
  10.519 - 		return -EIO;
  10.520 - 
  10.521 --	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
  10.522 --		rc = -ENODEV;
  10.523 --		goto out_err;
  10.524 --	}
  10.525 --
  10.526 - 	/* verify that it is a National part (SID) */
  10.527 - 	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
  10.528 - 		rc = -ENODEV;
  10.529 -diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
  10.530 ---- a/drivers/char/tty_ioctl.c
  10.531 -+++ b/drivers/char/tty_ioctl.c
  10.532 -@@ -476,11 +476,11 @@ int n_tty_ioctl(struct tty_struct * tty,
  10.533 - 			ld = tty_ldisc_ref(tty);
  10.534 - 			switch (arg) {
  10.535 - 			case TCIFLUSH:
  10.536 --				if (ld->flush_buffer)
  10.537 -+				if (ld && ld->flush_buffer)
  10.538 - 					ld->flush_buffer(tty);
  10.539 - 				break;
  10.540 - 			case TCIOFLUSH:
  10.541 --				if (ld->flush_buffer)
  10.542 -+				if (ld && ld->flush_buffer)
  10.543 - 					ld->flush_buffer(tty);
  10.544 - 				/* fall through */
  10.545 - 			case TCOFLUSH:
  10.546 -diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
  10.547 ---- a/drivers/media/video/cx88/cx88-video.c
  10.548 -+++ b/drivers/media/video/cx88/cx88-video.c
  10.549 -@@ -261,7 +261,7 @@ static struct cx88_ctrl cx8800_ctls[] = 
  10.550 - 			.default_value = 0,
  10.551 - 			.type          = V4L2_CTRL_TYPE_INTEGER,
  10.552 - 		},
  10.553 --		.off                   = 0,
  10.554 -+		.off                   = 128,
  10.555 - 		.reg                   = MO_HUE,
  10.556 - 		.mask                  = 0x00ff,
  10.557 - 		.shift                 = 0,
  10.558 -diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
  10.559 ---- a/drivers/net/e1000/e1000_main.c
  10.560 -+++ b/drivers/net/e1000/e1000_main.c
  10.561 -@@ -2307,6 +2307,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
  10.562 - 	tso = e1000_tso(adapter, skb);
  10.563 - 	if (tso < 0) {
  10.564 - 		dev_kfree_skb_any(skb);
  10.565 -+		spin_unlock_irqrestore(&adapter->tx_lock, flags);
  10.566 - 		return NETDEV_TX_OK;
  10.567 - 	}
  10.568 - 
  10.569 -diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
  10.570 ---- a/drivers/net/hamradio/Kconfig
  10.571 -+++ b/drivers/net/hamradio/Kconfig
  10.572 -@@ -17,7 +17,7 @@ config MKISS
  10.573 - 
  10.574 - config 6PACK
  10.575 - 	tristate "Serial port 6PACK driver"
  10.576 --	depends on AX25 && BROKEN_ON_SMP
  10.577 -+	depends on AX25
  10.578 - 	---help---
  10.579 - 	  6pack is a transmission protocol for the data exchange between your
  10.580 - 	  PC and your TNC (the Terminal Node Controller acts as a kind of
  10.581 -diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
  10.582 ---- a/drivers/net/shaper.c
  10.583 -+++ b/drivers/net/shaper.c
  10.584 -@@ -135,10 +135,8 @@ static int shaper_start_xmit(struct sk_b
  10.585 - {
  10.586 - 	struct shaper *shaper = dev->priv;
  10.587 -  	struct sk_buff *ptr;
  10.588 --   
  10.589 --	if (down_trylock(&shaper->sem))
  10.590 --		return -1;
  10.591 - 
  10.592 -+	spin_lock(&shaper->lock);
  10.593 -  	ptr=shaper->sendq.prev;
  10.594 -  	
  10.595 -  	/*
  10.596 -@@ -232,7 +230,7 @@ static int shaper_start_xmit(struct sk_b
  10.597 -                 shaper->stats.collisions++;
  10.598 -  	}
  10.599 - 	shaper_kick(shaper);
  10.600 --	up(&shaper->sem);
  10.601 -+	spin_unlock(&shaper->lock);
  10.602 -  	return 0;
  10.603 - }
  10.604 - 
  10.605 -@@ -271,11 +269,9 @@ static void shaper_timer(unsigned long d
  10.606 - {
  10.607 - 	struct shaper *shaper = (struct shaper *)data;
  10.608 - 
  10.609 --	if (!down_trylock(&shaper->sem)) {
  10.610 --		shaper_kick(shaper);
  10.611 --		up(&shaper->sem);
  10.612 --	} else
  10.613 --		mod_timer(&shaper->timer, jiffies);
  10.614 -+	spin_lock(&shaper->lock);
  10.615 -+	shaper_kick(shaper);
  10.616 -+	spin_unlock(&shaper->lock);
  10.617 - }
  10.618 - 
  10.619 - /*
  10.620 -@@ -332,21 +328,6 @@ static void shaper_kick(struct shaper *s
  10.621 - 
  10.622 - 
  10.623 - /*
  10.624 -- *	Flush the shaper queues on a closedown
  10.625 -- */
  10.626 -- 
  10.627 --static void shaper_flush(struct shaper *shaper)
  10.628 --{
  10.629 --	struct sk_buff *skb;
  10.630 --
  10.631 --	down(&shaper->sem);
  10.632 --	while((skb=skb_dequeue(&shaper->sendq))!=NULL)
  10.633 --		dev_kfree_skb(skb);
  10.634 --	shaper_kick(shaper);
  10.635 --	up(&shaper->sem);
  10.636 --}
  10.637 --
  10.638 --/*
  10.639 -  *	Bring the interface up. We just disallow this until a 
  10.640 -  *	bind.
  10.641 -  */
  10.642 -@@ -375,7 +356,15 @@ static int shaper_open(struct net_device
  10.643 - static int shaper_close(struct net_device *dev)
  10.644 - {
  10.645 - 	struct shaper *shaper=dev->priv;
  10.646 --	shaper_flush(shaper);
  10.647 -+	struct sk_buff *skb;
  10.648 -+
  10.649 -+	while ((skb = skb_dequeue(&shaper->sendq)) != NULL)
  10.650 -+		dev_kfree_skb(skb);
  10.651 -+
  10.652 -+	spin_lock_bh(&shaper->lock);
  10.653 -+	shaper_kick(shaper);
  10.654 -+	spin_unlock_bh(&shaper->lock);
  10.655 -+
  10.656 - 	del_timer_sync(&shaper->timer);
  10.657 - 	return 0;
  10.658 - }
  10.659 -@@ -576,6 +565,7 @@ static void shaper_init_priv(struct net_
  10.660 - 	init_timer(&sh->timer);
  10.661 - 	sh->timer.function=shaper_timer;
  10.662 - 	sh->timer.data=(unsigned long)sh;
  10.663 -+	spin_lock_init(&sh->lock);
  10.664 - }
  10.665 - 
  10.666 - /*
  10.667 -diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
  10.668 ---- a/drivers/pci/pci-driver.c
  10.669 -+++ b/drivers/pci/pci-driver.c
  10.670 -@@ -396,7 +396,7 @@ int pci_register_driver(struct pci_drive
  10.671 - 	/* FIXME, once all of the existing PCI drivers have been fixed to set
  10.672 - 	 * the pci shutdown function, this test can go away. */
  10.673 - 	if (!drv->driver.shutdown)
  10.674 --		drv->driver.shutdown = pci_device_shutdown,
  10.675 -+		drv->driver.shutdown = pci_device_shutdown;
  10.676 - 	drv->driver.owner = drv->owner;
  10.677 - 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
  10.678 - 	pci_init_dynids(&drv->dynids);
  10.679 -diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
  10.680 ---- a/drivers/scsi/qla2xxx/qla_os.c
  10.681 -+++ b/drivers/scsi/qla2xxx/qla_os.c
  10.682 -@@ -1150,7 +1150,7 @@ iospace_error_exit:
  10.683 -  */
  10.684 - int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
  10.685 - {
  10.686 --	int	ret;
  10.687 -+	int	ret = -ENODEV;
  10.688 - 	device_reg_t __iomem *reg;
  10.689 - 	struct Scsi_Host *host;
  10.690 - 	scsi_qla_host_t *ha;
  10.691 -@@ -1161,7 +1161,7 @@ int qla2x00_probe_one(struct pci_dev *pd
  10.692 - 	fc_port_t *fcport;
  10.693 - 
  10.694 - 	if (pci_enable_device(pdev))
  10.695 --		return -1;
  10.696 -+		goto probe_out;
  10.697 - 
  10.698 - 	host = scsi_host_alloc(&qla2x00_driver_template,
  10.699 - 	    sizeof(scsi_qla_host_t));
  10.700 -@@ -1183,9 +1183,8 @@ int qla2x00_probe_one(struct pci_dev *pd
  10.701 - 
  10.702 - 	/* Configure PCI I/O space */
  10.703 - 	ret = qla2x00_iospace_config(ha);
  10.704 --	if (ret != 0) {
  10.705 --		goto probe_alloc_failed;
  10.706 --	}
  10.707 -+	if (ret)
  10.708 -+		goto probe_failed;
  10.709 - 
  10.710 - 	/* Sanitize the information from PCI BIOS. */
  10.711 - 	host->irq = pdev->irq;
  10.712 -@@ -1258,23 +1257,10 @@ int qla2x00_probe_one(struct pci_dev *pd
  10.713 - 		qla_printk(KERN_WARNING, ha,
  10.714 - 		    "[ERROR] Failed to allocate memory for adapter\n");
  10.715 - 
  10.716 --		goto probe_alloc_failed;
  10.717 -+		ret = -ENOMEM;
  10.718 -+		goto probe_failed;
  10.719 - 	}
  10.720 - 
  10.721 --	pci_set_drvdata(pdev, ha);
  10.722 --	host->this_id = 255;
  10.723 --	host->cmd_per_lun = 3;
  10.724 --	host->unique_id = ha->instance;
  10.725 --	host->max_cmd_len = MAX_CMDSZ;
  10.726 --	host->max_channel = ha->ports - 1;
  10.727 --	host->max_id = ha->max_targets;
  10.728 --	host->max_lun = ha->max_luns;
  10.729 --	host->transportt = qla2xxx_transport_template;
  10.730 --	if (scsi_add_host(host, &pdev->dev))
  10.731 --		goto probe_alloc_failed;
  10.732 --
  10.733 --	qla2x00_alloc_sysfs_attr(ha);
  10.734 --
  10.735 - 	if (qla2x00_initialize_adapter(ha) &&
  10.736 - 	    !(ha->device_flags & DFLG_NO_CABLE)) {
  10.737 - 
  10.738 -@@ -1285,11 +1271,10 @@ int qla2x00_probe_one(struct pci_dev *pd
  10.739 - 		    "Adapter flags %x.\n",
  10.740 - 		    ha->host_no, ha->device_flags));
  10.741 - 
  10.742 -+		ret = -ENODEV;
  10.743 - 		goto probe_failed;
  10.744 - 	}
  10.745 - 
  10.746 --	qla2x00_init_host_attr(ha);
  10.747 --
  10.748 - 	/*
  10.749 - 	 * Startup the kernel thread for this host adapter
  10.750 - 	 */
  10.751 -@@ -1299,17 +1284,26 @@ int qla2x00_probe_one(struct pci_dev *pd
  10.752 - 		qla_printk(KERN_WARNING, ha,
  10.753 - 		    "Unable to start DPC thread!\n");
  10.754 - 
  10.755 -+		ret = -ENODEV;
  10.756 - 		goto probe_failed;
  10.757 - 	}
  10.758 - 	wait_for_completion(&ha->dpc_inited);
  10.759 - 
  10.760 -+	host->this_id = 255;
  10.761 -+	host->cmd_per_lun = 3;
  10.762 -+	host->unique_id = ha->instance;
  10.763 -+	host->max_cmd_len = MAX_CMDSZ;
  10.764 -+	host->max_channel = ha->ports - 1;
  10.765 -+	host->max_lun = MAX_LUNS;
  10.766 -+	host->transportt = qla2xxx_transport_template;
  10.767 -+
  10.768 - 	if (IS_QLA2100(ha) || IS_QLA2200(ha))
  10.769 - 		ret = request_irq(host->irq, qla2100_intr_handler,
  10.770 - 		    SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
  10.771 - 	else
  10.772 - 		ret = request_irq(host->irq, qla2300_intr_handler,
  10.773 - 		    SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
  10.774 --	if (ret != 0) {
  10.775 -+	if (ret) {
  10.776 - 		qla_printk(KERN_WARNING, ha,
  10.777 - 		    "Failed to reserve interrupt %d already in use.\n",
  10.778 - 		    host->irq);
  10.779 -@@ -1363,9 +1357,18 @@ int qla2x00_probe_one(struct pci_dev *pd
  10.780 - 		msleep(10);
  10.781 - 	}
  10.782 - 
  10.783 -+	pci_set_drvdata(pdev, ha);
  10.784 - 	ha->flags.init_done = 1;
  10.785 - 	num_hosts++;
  10.786 - 
  10.787 -+	ret = scsi_add_host(host, &pdev->dev);
  10.788 -+	if (ret)
  10.789 -+		goto probe_failed;
  10.790 -+
  10.791 -+	qla2x00_alloc_sysfs_attr(ha);
  10.792 -+
  10.793 -+	qla2x00_init_host_attr(ha);
  10.794 -+
  10.795 - 	qla_printk(KERN_INFO, ha, "\n"
  10.796 - 	    " QLogic Fibre Channel HBA Driver: %s\n"
  10.797 - 	    "  QLogic %s - %s\n"
  10.798 -@@ -1384,9 +1387,6 @@ int qla2x00_probe_one(struct pci_dev *pd
  10.799 - probe_failed:
  10.800 - 	fc_remove_host(ha->host);
  10.801 - 
  10.802 --	scsi_remove_host(host);
  10.803 --
  10.804 --probe_alloc_failed:
  10.805 - 	qla2x00_free_device(ha);
  10.806 - 
  10.807 - 	scsi_host_put(host);
  10.808 -@@ -1394,7 +1394,8 @@ probe_alloc_failed:
  10.809 - probe_disable_device:
  10.810 - 	pci_disable_device(pdev);
  10.811 - 
  10.812 --	return -1;
  10.813 -+probe_out:
  10.814 -+	return ret;
  10.815 - }
  10.816 - EXPORT_SYMBOL_GPL(qla2x00_probe_one);
  10.817 - 
  10.818 -diff --git a/fs/char_dev.c b/fs/char_dev.c
  10.819 ---- a/fs/char_dev.c
  10.820 -+++ b/fs/char_dev.c
  10.821 -@@ -139,7 +139,7 @@ __unregister_chrdev_region(unsigned majo
  10.822 - 	struct char_device_struct *cd = NULL, **cp;
  10.823 - 	int i = major_to_index(major);
  10.824 - 
  10.825 --	up(&chrdevs_lock);
  10.826 -+	down(&chrdevs_lock);
  10.827 - 	for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next)
  10.828 - 		if ((*cp)->major == major &&
  10.829 - 		    (*cp)->baseminor == baseminor &&
  10.830 -diff --git a/fs/exec.c b/fs/exec.c
  10.831 ---- a/fs/exec.c
  10.832 -+++ b/fs/exec.c
  10.833 -@@ -649,6 +649,7 @@ static inline int de_thread(struct task_
  10.834 - 	}
  10.835 - 	sig->group_exit_task = NULL;
  10.836 - 	sig->notify_count = 0;
  10.837 -+	sig->real_timer.data = (unsigned long)current;
  10.838 - 	spin_unlock_irq(lock);
  10.839 - 
  10.840 - 	/*
  10.841 -diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
  10.842 ---- a/include/asm-i386/string.h
  10.843 -+++ b/include/asm-i386/string.h
  10.844 -@@ -116,7 +116,8 @@ __asm__ __volatile__(
  10.845 - 	"orb $1,%%al\n"
  10.846 - 	"3:"
  10.847 - 	:"=a" (__res), "=&S" (d0), "=&D" (d1)
  10.848 --		     :"1" (cs),"2" (ct));
  10.849 -+	:"1" (cs),"2" (ct)
  10.850 -+	:"memory");
  10.851 - return __res;
  10.852 - }
  10.853 - 
  10.854 -@@ -138,8 +139,9 @@ __asm__ __volatile__(
  10.855 - 	"3:\tsbbl %%eax,%%eax\n\t"
  10.856 - 	"orb $1,%%al\n"
  10.857 - 	"4:"
  10.858 --		     :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
  10.859 --		     :"1" (cs),"2" (ct),"3" (count));
  10.860 -+	:"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
  10.861 -+	:"1" (cs),"2" (ct),"3" (count)
  10.862 -+	:"memory");
  10.863 - return __res;
  10.864 - }
  10.865 - 
  10.866 -@@ -158,7 +160,9 @@ __asm__ __volatile__(
  10.867 - 	"movl $1,%1\n"
  10.868 - 	"2:\tmovl %1,%0\n\t"
  10.869 - 	"decl %0"
  10.870 --	:"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));
  10.871 -+	:"=a" (__res), "=&S" (d0)
  10.872 -+	:"1" (s),"0" (c)
  10.873 -+	:"memory");
  10.874 - return __res;
  10.875 - }
  10.876 - 
  10.877 -@@ -175,7 +179,9 @@ __asm__ __volatile__(
  10.878 - 	"leal -1(%%esi),%0\n"
  10.879 - 	"2:\ttestb %%al,%%al\n\t"
  10.880 - 	"jne 1b"
  10.881 --	:"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c));
  10.882 -+	:"=g" (__res), "=&S" (d0), "=&a" (d1)
  10.883 -+	:"0" (0),"1" (s),"2" (c)
  10.884 -+	:"memory");
  10.885 - return __res;
  10.886 - }
  10.887 - 
  10.888 -@@ -189,7 +195,9 @@ __asm__ __volatile__(
  10.889 - 	"scasb\n\t"
  10.890 - 	"notl %0\n\t"
  10.891 - 	"decl %0"
  10.892 --	:"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffffu));
  10.893 -+	:"=c" (__res), "=&D" (d0)
  10.894 -+	:"1" (s),"a" (0), "0" (0xffffffffu)
  10.895 -+	:"memory");
  10.896 - return __res;
  10.897 - }
  10.898 - 
  10.899 -@@ -333,7 +341,9 @@ __asm__ __volatile__(
  10.900 - 	"je 1f\n\t"
  10.901 - 	"movl $1,%0\n"
  10.902 - 	"1:\tdecl %0"
  10.903 --	:"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count));
  10.904 -+	:"=D" (__res), "=&c" (d0)
  10.905 -+	:"a" (c),"0" (cs),"1" (count)
  10.906 -+	:"memory");
  10.907 - return __res;
  10.908 - }
  10.909 - 
  10.910 -@@ -369,7 +379,7 @@ __asm__ __volatile__(
  10.911 - 	"je 2f\n\t"
  10.912 - 	"stosb\n"
  10.913 - 	"2:"
  10.914 --	: "=&c" (d0), "=&D" (d1)
  10.915 -+	:"=&c" (d0), "=&D" (d1)
  10.916 - 	:"a" (c), "q" (count), "0" (count/4), "1" ((long) s)
  10.917 - 	:"memory");
  10.918 - return (s);	
  10.919 -@@ -392,7 +402,8 @@ __asm__ __volatile__(
  10.920 - 	"jne 1b\n"
  10.921 - 	"3:\tsubl %2,%0"
  10.922 - 	:"=a" (__res), "=&d" (d0)
  10.923 --	:"c" (s),"1" (count));
  10.924 -+	:"c" (s),"1" (count)
  10.925 -+	:"memory");
  10.926 - return __res;
  10.927 - }
  10.928 - /* end of additional stuff */
  10.929 -@@ -473,7 +484,8 @@ static inline void * memscan(void * addr
  10.930 - 		"dec %%edi\n"
  10.931 - 		"1:"
  10.932 - 		: "=D" (addr), "=c" (size)
  10.933 --		: "0" (addr), "1" (size), "a" (c));
  10.934 -+		: "0" (addr), "1" (size), "a" (c)
  10.935 -+		: "memory");
  10.936 - 	return addr;
  10.937 - }
  10.938 - 
  10.939 -diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
  10.940 ---- a/include/linux/if_shaper.h
  10.941 -+++ b/include/linux/if_shaper.h
  10.942 -@@ -23,7 +23,7 @@ struct shaper
  10.943 - 	__u32 shapeclock;
  10.944 - 	unsigned long recovery;	/* Time we can next clock a packet out on
  10.945 - 				   an empty queue */
  10.946 --	struct semaphore sem;
  10.947 -+	spinlock_t lock;
  10.948 -         struct net_device_stats stats;
  10.949 - 	struct net_device *dev;
  10.950 - 	int  (*hard_start_xmit) (struct sk_buff *skb,
  10.951 -diff --git a/mm/memory.c b/mm/memory.c
  10.952 ---- a/mm/memory.c
  10.953 -+++ b/mm/memory.c
  10.954 -@@ -1164,7 +1164,7 @@ int remap_pfn_range(struct vm_area_struc
  10.955 - {
  10.956 - 	pgd_t *pgd;
  10.957 - 	unsigned long next;
  10.958 --	unsigned long end = addr + size;
  10.959 -+	unsigned long end = addr + PAGE_ALIGN(size);
  10.960 - 	struct mm_struct *mm = vma->vm_mm;
  10.961 - 	int err;
  10.962 - 
  10.963 -diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
  10.964 ---- a/net/ipv4/ip_output.c
  10.965 -+++ b/net/ipv4/ip_output.c
  10.966 -@@ -111,7 +111,6 @@ static int ip_dev_loopback_xmit(struct s
  10.967 - #ifdef CONFIG_NETFILTER_DEBUG
  10.968 - 	nf_debug_ip_loopback_xmit(newskb);
  10.969 - #endif
  10.970 --	nf_reset(newskb);
  10.971 - 	netif_rx(newskb);
  10.972 - 	return 0;
  10.973 - }
  10.974 -@@ -196,8 +195,6 @@ static inline int ip_finish_output2(stru
  10.975 - 	nf_debug_ip_finish_output2(skb);
  10.976 - #endif /*CONFIG_NETFILTER_DEBUG*/
  10.977 - 
  10.978 --	nf_reset(skb);
  10.979 --
  10.980 - 	if (hh) {
  10.981 - 		int hh_alen;
  10.982 - 
  10.983 -diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
  10.984 ---- a/net/ipv4/netfilter/ip_conntrack_standalone.c
  10.985 -+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
  10.986 -@@ -432,6 +432,13 @@ static unsigned int ip_conntrack_defrag(
  10.987 - 				        const struct net_device *out,
  10.988 - 				        int (*okfn)(struct sk_buff *))
  10.989 - {
  10.990 -+#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
  10.991 -+	/* Previously seen (loopback)?  Ignore.  Do this before
  10.992 -+           fragment check. */
  10.993 -+	if ((*pskb)->nfct)
  10.994 -+		return NF_ACCEPT;
  10.995 -+#endif
  10.996 -+
  10.997 - 	/* Gather fragments. */
  10.998 - 	if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
  10.999 - 		*pskb = ip_ct_gather_frags(*pskb,
 10.1000 -diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
 10.1001 ---- a/net/netlink/af_netlink.c
 10.1002 -+++ b/net/netlink/af_netlink.c
 10.1003 -@@ -315,8 +315,8 @@ err:
 10.1004 - static void netlink_remove(struct sock *sk)
 10.1005 - {
 10.1006 - 	netlink_table_grab();
 10.1007 --	nl_table[sk->sk_protocol].hash.entries--;
 10.1008 --	sk_del_node_init(sk);
 10.1009 -+	if (sk_del_node_init(sk))
 10.1010 -+		nl_table[sk->sk_protocol].hash.entries--;
 10.1011 - 	if (nlk_sk(sk)->groups)
 10.1012 - 		__sk_del_bind_node(sk);
 10.1013 - 	netlink_table_ungrab();
 10.1014 -@@ -429,7 +429,12 @@ retry:
 10.1015 - 	err = netlink_insert(sk, pid);
 10.1016 - 	if (err == -EADDRINUSE)
 10.1017 - 		goto retry;
 10.1018 --	return 0;
 10.1019 -+
 10.1020 -+	/* If 2 threads race to autobind, that is fine.  */
 10.1021 -+	if (err == -EBUSY)
 10.1022 -+		err = 0;
 10.1023 -+
 10.1024 -+	return err;
 10.1025 - }
 10.1026 - 
 10.1027 - static inline int netlink_capable(struct socket *sock, unsigned int flag) 
 10.1028 -diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
 10.1029 ---- a/net/packet/af_packet.c
 10.1030 -+++ b/net/packet/af_packet.c
 10.1031 -@@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buf
 10.1032 - 	dst_release(skb->dst);
 10.1033 - 	skb->dst = NULL;
 10.1034 - 
 10.1035 -+	/* drop conntrack reference */
 10.1036 -+	nf_reset(skb);
 10.1037 -+
 10.1038 - 	spkt = (struct sockaddr_pkt*)skb->cb;
 10.1039 - 
 10.1040 - 	skb_push(skb, skb->data-skb->mac.raw);
 10.1041 -@@ -517,6 +520,9 @@ static int packet_rcv(struct sk_buff *sk
 10.1042 - 	dst_release(skb->dst);
 10.1043 - 	skb->dst = NULL;
 10.1044 - 
 10.1045 -+	/* drop conntrack reference */
 10.1046 -+	nf_reset(skb);
 10.1047 -+
 10.1048 - 	spin_lock(&sk->sk_receive_queue.lock);
 10.1049 - 	po->stats.tp_packets++;
 10.1050 - 	__skb_queue_tail(&sk->sk_receive_queue, skb);
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/patches/linux-2.6.12/linux-2.6.12.4.patch	Mon Aug 15 07:24:30 2005 +0000
    11.3 @@ -0,0 +1,1266 @@
    11.4 +diff --git a/Makefile b/Makefile
    11.5 +--- a/Makefile
    11.6 ++++ b/Makefile
    11.7 +@@ -1,7 +1,7 @@
    11.8 + VERSION = 2
    11.9 + PATCHLEVEL = 6
   11.10 + SUBLEVEL = 12
   11.11 +-EXTRAVERSION =
   11.12 ++EXTRAVERSION = .4
   11.13 + NAME=Woozy Numbat
   11.14 + 
   11.15 + # *DOCUMENTATION*
   11.16 +@@ -1149,7 +1149,7 @@ endif # KBUILD_EXTMOD
   11.17 + #(which is the most common case IMHO) to avoid unneeded clutter in the big tags file.
   11.18 + #Adding $(srctree) adds about 20M on i386 to the size of the output file!
   11.19 + 
   11.20 +-ifeq ($(KBUILD_OUTPUT),)
   11.21 ++ifeq ($(src),$(obj))
   11.22 + __srctree =
   11.23 + else
   11.24 + __srctree = $(srctree)/
   11.25 +diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
   11.26 +--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
   11.27 ++++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
   11.28 +@@ -44,7 +44,7 @@
   11.29 + 
   11.30 + #define PFX "powernow-k8: "
   11.31 + #define BFX PFX "BIOS error: "
   11.32 +-#define VERSION "version 1.40.2"
   11.33 ++#define VERSION "version 1.40.4"
   11.34 + #include "powernow-k8.h"
   11.35 + 
   11.36 + /* serialize freq changes  */
   11.37 +@@ -978,7 +978,7 @@ static int __init powernowk8_cpu_init(st
   11.38 + {
   11.39 + 	struct powernow_k8_data *data;
   11.40 + 	cpumask_t oldmask = CPU_MASK_ALL;
   11.41 +-	int rc;
   11.42 ++	int rc, i;
   11.43 + 
   11.44 + 	if (!check_supported_cpu(pol->cpu))
   11.45 + 		return -ENODEV;
   11.46 +@@ -1064,7 +1064,9 @@ static int __init powernowk8_cpu_init(st
   11.47 + 	printk("cpu_init done, current fid 0x%x, vid 0x%x\n",
   11.48 + 	       data->currfid, data->currvid);
   11.49 + 
   11.50 +-	powernow_data[pol->cpu] = data;
   11.51 ++	for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {
   11.52 ++		powernow_data[i] = data;
   11.53 ++	}
   11.54 + 
   11.55 + 	return 0;
   11.56 + 
   11.57 +diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
   11.58 +--- a/arch/i386/kernel/process.c
   11.59 ++++ b/arch/i386/kernel/process.c
   11.60 +@@ -827,6 +827,8 @@ asmlinkage int sys_get_thread_area(struc
   11.61 + 	if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
   11.62 + 		return -EINVAL;
   11.63 + 
   11.64 ++	memset(&info, 0, sizeof(info));
   11.65 ++
   11.66 + 	desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;
   11.67 + 
   11.68 + 	info.entry_number = idx;
   11.69 +diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
   11.70 +--- a/arch/ia64/kernel/ptrace.c
   11.71 ++++ b/arch/ia64/kernel/ptrace.c
   11.72 +@@ -945,6 +945,13 @@ access_uarea (struct task_struct *child,
   11.73 + 				*data = (pt->cr_ipsr & IPSR_MASK);
   11.74 + 			return 0;
   11.75 + 
   11.76 ++		      case PT_AR_RSC:
   11.77 ++			if (write_access)
   11.78 ++				pt->ar_rsc = *data | (3 << 2); /* force PL3 */
   11.79 ++			else
   11.80 ++				*data = pt->ar_rsc;
   11.81 ++			return 0;
   11.82 ++
   11.83 + 		      case PT_AR_RNAT:
   11.84 + 			urbs_end = ia64_get_user_rbs_end(child, pt, NULL);
   11.85 + 			rnat_addr = (long) ia64_rse_rnat_addr((long *)
   11.86 +@@ -996,9 +1003,6 @@ access_uarea (struct task_struct *child,
   11.87 + 		      case PT_AR_BSPSTORE:
   11.88 + 			ptr = pt_reg_addr(pt, ar_bspstore);
   11.89 + 			break;
   11.90 +-		      case PT_AR_RSC:
   11.91 +-			ptr = pt_reg_addr(pt, ar_rsc);
   11.92 +-			break;
   11.93 + 		      case PT_AR_UNAT:
   11.94 + 			ptr = pt_reg_addr(pt, ar_unat);
   11.95 + 			break;
   11.96 +@@ -1234,7 +1238,7 @@ ptrace_getregs (struct task_struct *chil
   11.97 + static long
   11.98 + ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
   11.99 + {
  11.100 +-	unsigned long psr, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;
  11.101 ++	unsigned long psr, rsc, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;
  11.102 + 	struct unw_frame_info info;
  11.103 + 	struct switch_stack *sw;
  11.104 + 	struct ia64_fpreg fpval;
  11.105 +@@ -1267,7 +1271,7 @@ ptrace_setregs (struct task_struct *chil
  11.106 + 	/* app regs */
  11.107 + 
  11.108 + 	retval |= __get_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]);
  11.109 +-	retval |= __get_user(pt->ar_rsc, &ppr->ar[PT_AUR_RSC]);
  11.110 ++	retval |= __get_user(rsc, &ppr->ar[PT_AUR_RSC]);
  11.111 + 	retval |= __get_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]);
  11.112 + 	retval |= __get_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]);
  11.113 + 	retval |= __get_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]);
  11.114 +@@ -1365,6 +1369,7 @@ ptrace_setregs (struct task_struct *chil
  11.115 + 	retval |= __get_user(nat_bits, &ppr->nat);
  11.116 + 
  11.117 + 	retval |= access_uarea(child, PT_CR_IPSR, &psr, 1);
  11.118 ++	retval |= access_uarea(child, PT_AR_RSC, &rsc, 1);
  11.119 + 	retval |= access_uarea(child, PT_AR_EC, &ec, 1);
  11.120 + 	retval |= access_uarea(child, PT_AR_LC, &lc, 1);
  11.121 + 	retval |= access_uarea(child, PT_AR_RNAT, &rnat, 1);
  11.122 +diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
  11.123 +--- a/arch/ia64/kernel/signal.c
  11.124 ++++ b/arch/ia64/kernel/signal.c
  11.125 +@@ -94,7 +94,7 @@ sys_sigaltstack (const stack_t __user *u
  11.126 + static long
  11.127 + restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
  11.128 + {
  11.129 +-	unsigned long ip, flags, nat, um, cfm;
  11.130 ++	unsigned long ip, flags, nat, um, cfm, rsc;
  11.131 + 	long err;
  11.132 + 
  11.133 + 	/* Always make any pending restarted system calls return -EINTR */
  11.134 +@@ -106,7 +106,7 @@ restore_sigcontext (struct sigcontext __
  11.135 + 	err |= __get_user(ip, &sc->sc_ip);			/* instruction pointer */
  11.136 + 	err |= __get_user(cfm, &sc->sc_cfm);
  11.137 + 	err |= __get_user(um, &sc->sc_um);			/* user mask */
  11.138 +-	err |= __get_user(scr->pt.ar_rsc, &sc->sc_ar_rsc);
  11.139 ++	err |= __get_user(rsc, &sc->sc_ar_rsc);
  11.140 + 	err |= __get_user(scr->pt.ar_unat, &sc->sc_ar_unat);
  11.141 + 	err |= __get_user(scr->pt.ar_fpsr, &sc->sc_ar_fpsr);
  11.142 + 	err |= __get_user(scr->pt.ar_pfs, &sc->sc_ar_pfs);
  11.143 +@@ -119,6 +119,7 @@ restore_sigcontext (struct sigcontext __
  11.144 + 	err |= __copy_from_user(&scr->pt.r15, &sc->sc_gr[15], 8);	/* r15 */
  11.145 + 
  11.146 + 	scr->pt.cr_ifs = cfm | (1UL << 63);
  11.147 ++	scr->pt.ar_rsc = rsc | (3 << 2); /* force PL3 */
  11.148 + 
  11.149 + 	/* establish new instruction pointer: */
  11.150 + 	scr->pt.cr_iip = ip & ~0x3UL;
  11.151 +diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
  11.152 +--- a/arch/ppc/kernel/time.c
  11.153 ++++ b/arch/ppc/kernel/time.c
  11.154 +@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale;
  11.155 + 
  11.156 + extern unsigned long wall_jiffies;
  11.157 + 
  11.158 ++/* used for timezone offset */
  11.159 ++static long timezone_offset;
  11.160 ++
  11.161 + DEFINE_SPINLOCK(rtc_lock);
  11.162 + 
  11.163 + EXPORT_SYMBOL(rtc_lock);
  11.164 +@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * re
  11.165 + 		     xtime.tv_sec - last_rtc_update >= 659 &&
  11.166 + 		     abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
  11.167 + 		     jiffies - wall_jiffies == 1) {
  11.168 +-		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0)
  11.169 ++		  	if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
  11.170 + 				last_rtc_update = xtime.tv_sec+1;
  11.171 + 			else
  11.172 + 				/* Try again one minute later */
  11.173 +@@ -286,7 +289,7 @@ void __init time_init(void)
  11.174 + 	unsigned old_stamp, stamp, elapsed;
  11.175 + 
  11.176 +         if (ppc_md.time_init != NULL)
  11.177 +-                time_offset = ppc_md.time_init();
  11.178 ++                timezone_offset = ppc_md.time_init();
  11.179 + 
  11.180 + 	if (__USE_RTC()) {
  11.181 + 		/* 601 processor: dec counts down by 128 every 128ns */
  11.182 +@@ -331,10 +334,10 @@ void __init time_init(void)
  11.183 + 	set_dec(tb_ticks_per_jiffy);
  11.184 + 
  11.185 + 	/* If platform provided a timezone (pmac), we correct the time */
  11.186 +-        if (time_offset) {
  11.187 +-		sys_tz.tz_minuteswest = -time_offset / 60;
  11.188 ++        if (timezone_offset) {
  11.189 ++		sys_tz.tz_minuteswest = -timezone_offset / 60;
  11.190 + 		sys_tz.tz_dsttime = 0;
  11.191 +-		xtime.tv_sec -= time_offset;
  11.192 ++		xtime.tv_sec -= timezone_offset;
  11.193 +         }
  11.194 +         set_normalized_timespec(&wall_to_monotonic,
  11.195 +                                 -xtime.tv_sec, -xtime.tv_nsec);
  11.196 +diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
  11.197 +--- a/arch/um/kernel/process.c
  11.198 ++++ b/arch/um/kernel/process.c
  11.199 +@@ -130,7 +130,7 @@ int start_fork_tramp(void *thread_arg, u
  11.200 + 	return(arg.pid);
  11.201 + }
  11.202 + 
  11.203 +-static int ptrace_child(void)
  11.204 ++static int ptrace_child(void *arg)
  11.205 + {
  11.206 + 	int ret;
  11.207 + 	int pid = os_getpid(), ppid = getppid();
  11.208 +@@ -159,16 +159,20 @@ static int ptrace_child(void)
  11.209 + 	_exit(ret);
  11.210 + }
  11.211 + 
  11.212 +-static int start_ptraced_child(void)
  11.213 ++static int start_ptraced_child(void **stack_out)
  11.214 + {
  11.215 ++	void *stack;
  11.216 ++	unsigned long sp;
  11.217 + 	int pid, n, status;
  11.218 + 	
  11.219 +-	pid = fork();
  11.220 +-	if(pid == 0)
  11.221 +-		ptrace_child();
  11.222 +-
  11.223 ++	stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
  11.224 ++		     MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  11.225 ++	if(stack == MAP_FAILED)
  11.226 ++		panic("check_ptrace : mmap failed, errno = %d", errno);
  11.227 ++	sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
  11.228 ++	pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
  11.229 + 	if(pid < 0)
  11.230 +-		panic("check_ptrace : fork failed, errno = %d", errno);
  11.231 ++		panic("check_ptrace : clone failed, errno = %d", errno);
  11.232 + 	CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED));
  11.233 + 	if(n < 0)
  11.234 + 		panic("check_ptrace : wait failed, errno = %d", errno);
  11.235 +@@ -176,6 +180,7 @@ static int start_ptraced_child(void)
  11.236 + 		panic("check_ptrace : expected SIGSTOP, got status = %d",
  11.237 + 		      status);
  11.238 + 
  11.239 ++	*stack_out = stack;
  11.240 + 	return(pid);
  11.241 + }
  11.242 + 
  11.243 +@@ -183,12 +188,12 @@ static int start_ptraced_child(void)
  11.244 +  * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
  11.245 +  * So only for SYSEMU features we test mustpanic, while normal host features
  11.246 +  * must work anyway!*/
  11.247 +-static int stop_ptraced_child(int pid, int exitcode, int mustexit)
  11.248 ++static int stop_ptraced_child(int pid, void *stack, int exitcode, int mustpanic)
  11.249 + {
  11.250 + 	int status, n, ret = 0;
  11.251 + 
  11.252 + 	if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
  11.253 +-		panic("stop_ptraced_child : ptrace failed, errno = %d", errno);
  11.254 ++		panic("check_ptrace : ptrace failed, errno = %d", errno);
  11.255 + 	CATCH_EINTR(n = waitpid(pid, &status, 0));
  11.256 + 	if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
  11.257 + 		int exit_with = WEXITSTATUS(status);
  11.258 +@@ -199,13 +204,15 @@ static int stop_ptraced_child(int pid, i
  11.259 + 		printk("check_ptrace : child exited with exitcode %d, while "
  11.260 + 		      "expecting %d; status 0x%x", exit_with,
  11.261 + 		      exitcode, status);
  11.262 +-		if (mustexit)
  11.263 ++		if (mustpanic)
  11.264 + 			panic("\n");
  11.265 + 		else
  11.266 + 			printk("\n");
  11.267 + 		ret = -1;
  11.268 + 	}
  11.269 + 
  11.270 ++	if(munmap(stack, PAGE_SIZE) < 0)
  11.271 ++		panic("check_ptrace : munmap failed, errno = %d", errno);
  11.272 + 	return ret;
  11.273 + }
  11.274 + 
  11.275 +@@ -227,11 +234,12 @@ __uml_setup("nosysemu", nosysemu_cmd_par
  11.276 + 
  11.277 + static void __init check_sysemu(void)
  11.278 + {
  11.279 ++	void *stack;
  11.280 + 	int pid, syscall, n, status, count=0;
  11.281 + 
  11.282 + 	printk("Checking syscall emulation patch for ptrace...");
  11.283 + 	sysemu_supported = 0;
  11.284 +-	pid = start_ptraced_child();
  11.285 ++	pid = start_ptraced_child(&stack);
  11.286 + 
  11.287 + 	if(ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0)
  11.288 + 		goto fail;
  11.289 +@@ -249,7 +257,7 @@ static void __init check_sysemu(void)
  11.290 + 		panic("check_sysemu : failed to modify system "
  11.291 + 		      "call return, errno = %d", errno);
  11.292 + 
  11.293 +-	if (stop_ptraced_child(pid, 0, 0) < 0)
  11.294 ++	if (stop_ptraced_child(pid, stack, 0, 0) < 0)
  11.295 + 		goto fail_stopped;
  11.296 + 
  11.297 + 	sysemu_supported = 1;
  11.298 +@@ -257,7 +265,7 @@ static void __init check_sysemu(void)
  11.299 + 	set_using_sysemu(!force_sysemu_disabled);
  11.300 + 
  11.301 + 	printk("Checking advanced syscall emulation patch for ptrace...");
  11.302 +-	pid = start_ptraced_child();
  11.303 ++	pid = start_ptraced_child(&stack);
  11.304 + 	while(1){
  11.305 + 		count++;
  11.306 + 		if(ptrace(PTRACE_SYSEMU_SINGLESTEP, pid, 0, 0) < 0)
  11.307 +@@ -282,7 +290,7 @@ static void __init check_sysemu(void)
  11.308 + 			break;
  11.309 + 		}
  11.310 + 	}
  11.311 +-	if (stop_ptraced_child(pid, 0, 0) < 0)
  11.312 ++	if (stop_ptraced_child(pid, stack, 0, 0) < 0)
  11.313 + 		goto fail_stopped;
  11.314 + 
  11.315 + 	sysemu_supported = 2;
  11.316 +@@ -293,17 +301,18 @@ static void __init check_sysemu(void)
  11.317 + 	return;
  11.318 + 
  11.319 + fail:
  11.320 +-	stop_ptraced_child(pid, 1, 0);
  11.321 ++	stop_ptraced_child(pid, stack, 1, 0);
  11.322 + fail_stopped:
  11.323 + 	printk("missing\n");
  11.324 + }
  11.325 + 
  11.326 + void __init check_ptrace(void)
  11.327 + {
  11.328 ++	void *stack;
  11.329 + 	int pid, syscall, n, status;
  11.330 + 
  11.331 + 	printk("Checking that ptrace can change system call numbers...");
  11.332 +-	pid = start_ptraced_child();
  11.333 ++	pid = start_ptraced_child(&stack);
  11.334 + 
  11.335 + 	if (ptrace(PTRACE_OLDSETOPTIONS, pid, 0, (void *)PTRACE_O_TRACESYSGOOD) < 0)
  11.336 + 		panic("check_ptrace: PTRACE_SETOPTIONS failed, errno = %d", errno);
  11.337 +@@ -330,7 +339,7 @@ void __init check_ptrace(void)
  11.338 + 			break;
  11.339 + 		}
  11.340 + 	}
  11.341 +-	stop_ptraced_child(pid, 0, 1);
  11.342 ++	stop_ptraced_child(pid, stack, 0, 1);
  11.343 + 	printk("OK\n");
  11.344 + 	check_sysemu();
  11.345 + }
  11.346 +@@ -362,10 +371,11 @@ void forward_pending_sigio(int target)
  11.347 + static inline int check_skas3_ptrace_support(void)
  11.348 + {
  11.349 + 	struct ptrace_faultinfo fi;
  11.350 ++	void *stack;
  11.351 + 	int pid, n, ret = 1;
  11.352 + 
  11.353 + 	printf("Checking for the skas3 patch in the host...");
  11.354 +-	pid = start_ptraced_child();
  11.355 ++	pid = start_ptraced_child(&stack);
  11.356 + 
  11.357 + 	n = ptrace(PTRACE_FAULTINFO, pid, 0, &fi);
  11.358 + 	if (n < 0) {
  11.359 +@@ -380,7 +390,7 @@ static inline int check_skas3_ptrace_sup
  11.360 + 	}
  11.361 + 
  11.362 + 	init_registers(pid);
  11.363 +-	stop_ptraced_child(pid, 1, 1);
  11.364 ++	stop_ptraced_child(pid, stack, 1, 1);
  11.365 + 
  11.366 + 	return(ret);
  11.367 + }
  11.368 +diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c
  11.369 +--- a/arch/x86_64/ia32/syscall32.c
  11.370 ++++ b/arch/x86_64/ia32/syscall32.c
  11.371 +@@ -57,6 +57,7 @@ int syscall32_setup_pages(struct linux_b
  11.372 + 	int npages = (VSYSCALL32_END - VSYSCALL32_BASE) >> PAGE_SHIFT;
  11.373 + 	struct vm_area_struct *vma;
  11.374 + 	struct mm_struct *mm = current->mm;
  11.375 ++	int ret;
  11.376 + 
  11.377 + 	vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
  11.378 + 	if (!vma)
  11.379 +@@ -78,7 +79,11 @@ int syscall32_setup_pages(struct linux_b
  11.380 + 	vma->vm_mm = mm;
  11.381 + 
  11.382 + 	down_write(&mm->mmap_sem);
  11.383 +-	insert_vm_struct(mm, vma);
  11.384 ++	if ((ret = insert_vm_struct(mm, vma))) {
  11.385 ++		up_write(&mm->mmap_sem);
  11.386 ++		kmem_cache_free(vm_area_cachep, vma);
  11.387 ++		return ret;
  11.388 ++	}
  11.389 + 	mm->total_vm += npages;
  11.390 + 	up_write(&mm->mmap_sem);
  11.391 + 	return 0;
  11.392 +diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
  11.393 +--- a/drivers/acpi/pci_irq.c
  11.394 ++++ b/drivers/acpi/pci_irq.c
  11.395 +@@ -433,8 +433,9 @@ acpi_pci_irq_enable (
  11.396 + 		printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
  11.397 + 			pci_name(dev), ('A' + pin));
  11.398 + 		/* Interrupt Line values above 0xF are forbidden */
  11.399 +-		if (dev->irq >= 0 && (dev->irq <= 0xF)) {
  11.400 ++		if (dev->irq > 0 && (dev->irq <= 0xF)) {
  11.401 + 			printk(" - using IRQ %d\n", dev->irq);
  11.402 ++			acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
  11.403 + 			return_VALUE(0);
  11.404 + 		}
  11.405 + 		else {
  11.406 +diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
  11.407 +--- a/drivers/char/rocket.c
  11.408 ++++ b/drivers/char/rocket.c
  11.409 +@@ -277,7 +277,7 @@ static void rp_do_receive(struct r_port 
  11.410 + 		ToRecv = space;
  11.411 + 
  11.412 + 	if (ToRecv <= 0)
  11.413 +-		return;
  11.414 ++		goto done;
  11.415 + 
  11.416 + 	/*
  11.417 + 	 * if status indicates there are errored characters in the
  11.418 +@@ -359,6 +359,7 @@ static void rp_do_receive(struct r_port 
  11.419 + 	}
  11.420 + 	/*  Push the data up to the tty layer */
  11.421 + 	ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count);
  11.422 ++done:
  11.423 + 	tty_ldisc_deref(ld);
  11.424 + }
  11.425 + 
  11.426 +diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
  11.427 +--- a/drivers/char/tpm/tpm.c
  11.428 ++++ b/drivers/char/tpm/tpm.c
  11.429 +@@ -32,12 +32,6 @@
  11.430 + 
  11.431 + #define	TPM_BUFSIZE			2048
  11.432 + 
  11.433 +-/* PCI configuration addresses */
  11.434 +-#define	PCI_GEN_PMCON_1			0xA0
  11.435 +-#define	PCI_GEN1_DEC			0xE4
  11.436 +-#define	PCI_LPC_EN			0xE6
  11.437 +-#define	PCI_GEN2_DEC			0xEC
  11.438 +-
  11.439 + static LIST_HEAD(tpm_chip_list);
  11.440 + static DEFINE_SPINLOCK(driver_lock);
  11.441 + static int dev_mask[32];
  11.442 +@@ -61,72 +55,6 @@ void tpm_time_expired(unsigned long ptr)
  11.443 + EXPORT_SYMBOL_GPL(tpm_time_expired);
  11.444 + 
  11.445 + /*
  11.446 +- * Initialize the LPC bus and enable the TPM ports
  11.447 +- */
  11.448 +-int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
  11.449 +-{
  11.450 +-	u32 lpcenable, tmp;
  11.451 +-	int is_lpcm = 0;
  11.452 +-
  11.453 +-	switch (pci_dev->vendor) {
  11.454 +-	case PCI_VENDOR_ID_INTEL:
  11.455 +-		switch (pci_dev->device) {
  11.456 +-		case PCI_DEVICE_ID_INTEL_82801CA_12:
  11.457 +-		case PCI_DEVICE_ID_INTEL_82801DB_12:
  11.458 +-			is_lpcm = 1;
  11.459 +-			break;
  11.460 +-		}
  11.461 +-		/* init ICH (enable LPC) */
  11.462 +-		pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
  11.463 +-		lpcenable |= 0x20000000;
  11.464 +-		pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
  11.465 +-
  11.466 +-		if (is_lpcm) {
  11.467 +-			pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
  11.468 +-					      &lpcenable);
  11.469 +-			if ((lpcenable & 0x20000000) == 0) {
  11.470 +-				dev_err(&pci_dev->dev,
  11.471 +-					"cannot enable LPC\n");
  11.472 +-				return -ENODEV;
  11.473 +-			}
  11.474 +-		}
  11.475 +-
  11.476 +-		/* initialize TPM registers */
  11.477 +-		pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
  11.478 +-
  11.479 +-		if (!is_lpcm)
  11.480 +-			tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
  11.481 +-		else
  11.482 +-			tmp =
  11.483 +-			    (tmp & 0xFFFF0000) | (base & 0xFFF0) |
  11.484 +-			    0x00000001;
  11.485 +-
  11.486 +-		pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
  11.487 +-
  11.488 +-		if (is_lpcm) {
  11.489 +-			pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
  11.490 +-					      &tmp);
  11.491 +-			tmp |= 0x00000004;	/* enable CLKRUN */
  11.492 +-			pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
  11.493 +-					       tmp);
  11.494 +-		}
  11.495 +-		tpm_write_index(0x0D, 0x55);	/* unlock 4F */
  11.496 +-		tpm_write_index(0x0A, 0x00);	/* int disable */
  11.497 +-		tpm_write_index(0x08, base);	/* base addr lo */
  11.498 +-		tpm_write_index(0x09, (base & 0xFF00) >> 8);	/* base addr hi */
  11.499 +-		tpm_write_index(0x0D, 0xAA);	/* lock 4F */
  11.500 +-		break;
  11.501 +-	case PCI_VENDOR_ID_AMD:
  11.502 +-		/* nothing yet */
  11.503 +-		break;
  11.504 +-	}
  11.505 +-
  11.506 +-	return 0;
  11.507 +-}
  11.508 +-
  11.509 +-EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
  11.510 +-
  11.511 +-/*
  11.512 +  * Internal kernel interface to transmit TPM commands
  11.513 +  */
  11.514 + static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
  11.515 +@@ -590,10 +518,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
  11.516 + 	if (chip == NULL)
  11.517 + 		return -ENODEV;
  11.518 + 
  11.519 +-	spin_lock(&driver_lock);
  11.520 +-	tpm_lpc_bus_init(pci_dev, chip->vendor->base);
  11.521 +-	spin_unlock(&driver_lock);
  11.522 +-
  11.523 + 	return 0;
  11.524 + }
  11.525 + 
  11.526 +diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
  11.527 +--- a/drivers/char/tpm/tpm.h
  11.528 ++++ b/drivers/char/tpm/tpm.h
  11.529 +@@ -79,8 +79,6 @@ static inline void tpm_write_index(int i
  11.530 + }
  11.531 + 
  11.532 + extern void tpm_time_expired(unsigned long);
  11.533 +-extern int tpm_lpc_bus_init(struct pci_dev *, u16);
  11.534 +-
  11.535 + extern int tpm_register_hardware(struct pci_dev *,
  11.536 + 				 struct tpm_vendor_specific *);
  11.537 + extern int tpm_open(struct inode *, struct file *);
  11.538 +diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
  11.539 +--- a/drivers/char/tpm/tpm_atmel.c
  11.540 ++++ b/drivers/char/tpm/tpm_atmel.c
  11.541 +@@ -22,7 +22,10 @@
  11.542 + #include "tpm.h"
  11.543 + 
  11.544 + /* Atmel definitions */
  11.545 +-#define	TPM_ATML_BASE			0x400
  11.546 ++enum tpm_atmel_addr {
  11.547 ++	TPM_ATMEL_BASE_ADDR_LO = 0x08,
  11.548 ++	TPM_ATMEL_BASE_ADDR_HI = 0x09
  11.549 ++};
  11.550 + 
  11.551 + /* write status bits */
  11.552 + #define	ATML_STATUS_ABORT		0x01
  11.553 +@@ -127,7 +130,6 @@ static struct tpm_vendor_specific tpm_at
  11.554 + 	.cancel = tpm_atml_cancel,
  11.555 + 	.req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
  11.556 + 	.req_complete_val = ATML_STATUS_DATA_AVAIL,
  11.557 +-	.base = TPM_ATML_BASE,
  11.558 + 	.miscdev = { .fops = &atmel_ops, },
  11.559 + };
  11.560 + 
  11.561 +@@ -136,14 +138,16 @@ static int __devinit tpm_atml_init(struc
  11.562 + {
  11.563 + 	u8 version[4];
  11.564 + 	int rc = 0;
  11.565 ++	int lo, hi;
  11.566 + 
  11.567 + 	if (pci_enable_device(pci_dev))
  11.568 + 		return -EIO;
  11.569 + 
  11.570 +-	if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
  11.571 +-		rc = -ENODEV;
  11.572 +-		goto out_err;
  11.573 +-	}
  11.574 ++	lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
  11.575 ++	hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
  11.576 ++
  11.577 ++	tpm_atmel.base = (hi<<8)|lo;
  11.578 ++	dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
  11.579 + 
  11.580 + 	/* verify that it is an Atmel part */
  11.581 + 	if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
  11.582 +diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
  11.583 +--- a/drivers/char/tpm/tpm_nsc.c
  11.584 ++++ b/drivers/char/tpm/tpm_nsc.c
  11.585 +@@ -24,6 +24,10 @@
  11.586 + /* National definitions */
  11.587 + #define	TPM_NSC_BASE			0x360
  11.588 + #define	TPM_NSC_IRQ			0x07
  11.589 ++#define	TPM_NSC_BASE0_HI		0x60
  11.590 ++#define	TPM_NSC_BASE0_LO		0x61
  11.591 ++#define	TPM_NSC_BASE1_HI		0x62
  11.592 ++#define	TPM_NSC_BASE1_LO		0x63
  11.593 + 
  11.594 + #define	NSC_LDN_INDEX			0x07
  11.595 + #define	NSC_SID_INDEX			0x20
  11.596 +@@ -234,7 +238,6 @@ static struct tpm_vendor_specific tpm_ns
  11.597 + 	.cancel = tpm_nsc_cancel,
  11.598 + 	.req_complete_mask = NSC_STATUS_OBF,
  11.599 + 	.req_complete_val = NSC_STATUS_OBF,
  11.600 +-	.base = TPM_NSC_BASE,
  11.601 + 	.miscdev = { .fops = &nsc_ops, },
  11.602 + 	
  11.603 + };
  11.604 +@@ -243,15 +246,16 @@ static int __devinit tpm_nsc_init(struct
  11.605 + 				  const struct pci_device_id *pci_id)
  11.606 + {
  11.607 + 	int rc = 0;
  11.608 ++	int lo, hi;
  11.609 ++
  11.610 ++	hi = tpm_read_index(TPM_NSC_BASE0_HI);
  11.611 ++	lo = tpm_read_index(TPM_NSC_BASE0_LO);
  11.612 ++
  11.613 ++	tpm_nsc.base = (hi<<8) | lo;
  11.614 + 
  11.615 + 	if (pci_enable_device(pci_dev))
  11.616 + 		return -EIO;
  11.617 + 
  11.618 +-	if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
  11.619 +-		rc = -ENODEV;
  11.620 +-		goto out_err;
  11.621 +-	}
  11.622 +-
  11.623 + 	/* verify that it is a National part (SID) */
  11.624 + 	if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
  11.625 + 		rc = -ENODEV;
  11.626 +diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
  11.627 +--- a/drivers/char/tty_ioctl.c
  11.628 ++++ b/drivers/char/tty_ioctl.c
  11.629 +@@ -476,11 +476,11 @@ int n_tty_ioctl(struct tty_struct * tty,
  11.630 + 			ld = tty_ldisc_ref(tty);
  11.631 + 			switch (arg) {
  11.632 + 			case TCIFLUSH:
  11.633 +-				if (ld->flush_buffer)
  11.634 ++				if (ld && ld->flush_buffer)
  11.635 + 					ld->flush_buffer(tty);
  11.636 + 				break;
  11.637 + 			case TCIOFLUSH:
  11.638 +-				if (ld->flush_buffer)
  11.639 ++				if (ld && ld->flush_buffer)
  11.640 + 					ld->flush_buffer(tty);
  11.641 + 				/* fall through */
  11.642 + 			case TCOFLUSH:
  11.643 +diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
  11.644 +--- a/drivers/media/video/cx88/cx88-video.c
  11.645 ++++ b/drivers/media/video/cx88/cx88-video.c
  11.646 +@@ -261,7 +261,7 @@ static struct cx88_ctrl cx8800_ctls[] = 
  11.647 + 			.default_value = 0,
  11.648 + 			.type          = V4L2_CTRL_TYPE_INTEGER,
  11.649 + 		},
  11.650 +-		.off                   = 0,
  11.651 ++		.off                   = 128,
  11.652 + 		.reg                   = MO_HUE,
  11.653 + 		.mask                  = 0x00ff,
  11.654 + 		.shift                 = 0,
  11.655 +diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
  11.656 +--- a/drivers/net/e1000/e1000_main.c
  11.657 ++++ b/drivers/net/e1000/e1000_main.c
  11.658 +@@ -2307,6 +2307,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
  11.659 + 	tso = e1000_tso(adapter, skb);
  11.660 + 	if (tso < 0) {
  11.661 + 		dev_kfree_skb_any(skb);
  11.662 ++		spin_unlock_irqrestore(&adapter->tx_lock, flags);
  11.663 + 		return NETDEV_TX_OK;
  11.664 + 	}
  11.665 + 
  11.666 +diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
  11.667 +--- a/drivers/net/hamradio/Kconfig
  11.668 ++++ b/drivers/net/hamradio/Kconfig
  11.669 +@@ -17,7 +17,7 @@ config MKISS
  11.670 + 
  11.671 + config 6PACK
  11.672 + 	tristate "Serial port 6PACK driver"
  11.673 +-	depends on AX25 && BROKEN_ON_SMP
  11.674 ++	depends on AX25
  11.675 + 	---help---
  11.676 + 	  6pack is a transmission protocol for the data exchange between your
  11.677 + 	  PC and your TNC (the Terminal Node Controller acts as a kind of
  11.678 +diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
  11.679 +--- a/drivers/net/shaper.c
  11.680 ++++ b/drivers/net/shaper.c
  11.681 +@@ -135,10 +135,8 @@ static int shaper_start_xmit(struct sk_b
  11.682 + {
  11.683 + 	struct shaper *shaper = dev->priv;
  11.684 +  	struct sk_buff *ptr;
  11.685 +-   
  11.686 +-	if (down_trylock(&shaper->sem))
  11.687 +-		return -1;
  11.688 + 
  11.689 ++	spin_lock(&shaper->lock);
  11.690 +  	ptr=shaper->sendq.prev;
  11.691 +  	
  11.692 +  	/*
  11.693 +@@ -232,7 +230,7 @@ static int shaper_start_xmit(struct sk_b
  11.694 +                 shaper->stats.collisions++;
  11.695 +  	}
  11.696 + 	shaper_kick(shaper);
  11.697 +-	up(&shaper->sem);
  11.698 ++	spin_unlock(&shaper->lock);
  11.699 +  	return 0;
  11.700 + }
  11.701 + 
  11.702 +@@ -271,11 +269,9 @@ static void shaper_timer(unsigned long d
  11.703 + {
  11.704 + 	struct shaper *shaper = (struct shaper *)data;
  11.705 + 
  11.706 +-	if (!down_trylock(&shaper->sem)) {
  11.707 +-		shaper_kick(shaper);
  11.708 +-		up(&shaper->sem);
  11.709 +-	} else
  11.710 +-		mod_timer(&shaper->timer, jiffies);
  11.711 ++	spin_lock(&shaper->lock);
  11.712 ++	shaper_kick(shaper);
  11.713 ++	spin_unlock(&shaper->lock);
  11.714 + }
  11.715 + 
  11.716 + /*
  11.717 +@@ -332,21 +328,6 @@ static void shaper_kick(struct shaper *s
  11.718 + 
  11.719 + 
  11.720 + /*
  11.721 +- *	Flush the shaper queues on a closedown
  11.722 +- */
  11.723 +- 
  11.724 +-static void shaper_flush(struct shaper *shaper)
  11.725 +-{
  11.726 +-	struct sk_buff *skb;
  11.727 +-
  11.728 +-	down(&shaper->sem);
  11.729 +-	while((skb=skb_dequeue(&shaper->sendq))!=NULL)
  11.730 +-		dev_kfree_skb(skb);
  11.731 +-	shaper_kick(shaper);
  11.732 +-	up(&shaper->sem);
  11.733 +-}
  11.734 +-
  11.735 +-/*
  11.736 +  *	Bring the interface up. We just disallow this until a 
  11.737 +  *	bind.
  11.738 +  */
  11.739 +@@ -375,7 +356,15 @@ static int shaper_open(struct net_device
  11.740 + static int shaper_close(struct net_device *dev)
  11.741 + {
  11.742 + 	struct shaper *shaper=dev->priv;
  11.743 +-	shaper_flush(shaper);
  11.744 ++	struct sk_buff *skb;
  11.745 ++
  11.746 ++	while ((skb = skb_dequeue(&shaper->sendq)) != NULL)
  11.747 ++		dev_kfree_skb(skb);
  11.748 ++
  11.749 ++	spin_lock_bh(&shaper->lock);
  11.750 ++	shaper_kick(shaper);
  11.751 ++	spin_unlock_bh(&shaper->lock);
  11.752 ++
  11.753 + 	del_timer_sync(&shaper->timer);
  11.754 + 	return 0;
  11.755 + }
  11.756 +@@ -576,6 +565,7 @@ static void shaper_init_priv(struct net_
  11.757 + 	init_timer(&sh->timer);
  11.758 + 	sh->timer.function=shaper_timer;
  11.759 + 	sh->timer.data=(unsigned long)sh;
  11.760 ++	spin_lock_init(&sh->lock);
  11.761 + }
  11.762 + 
  11.763 + /*
  11.764 +diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
  11.765 +--- a/drivers/pci/pci-driver.c
  11.766 ++++ b/drivers/pci/pci-driver.c
  11.767 +@@ -396,7 +396,7 @@ int pci_register_driver(struct pci_drive
  11.768 + 	/* FIXME, once all of the existing PCI drivers have been fixed to set
  11.769 + 	 * the pci shutdown function, this test can go away. */
  11.770 + 	if (!drv->driver.shutdown)
  11.771 +-		drv->driver.shutdown = pci_device_shutdown,
  11.772 ++		drv->driver.shutdown = pci_device_shutdown;
  11.773 + 	drv->driver.owner = drv->owner;
  11.774 + 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
  11.775 + 	pci_init_dynids(&drv->dynids);
  11.776 +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
  11.777 +--- a/drivers/scsi/qla2xxx/qla_init.c
  11.778 ++++ b/drivers/scsi/qla2xxx/qla_init.c
  11.779 +@@ -1914,9 +1914,11 @@ qla2x00_reg_remote_port(scsi_qla_host_t 
  11.780 + 		rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET;
  11.781 + 
  11.782 + 	fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids);
  11.783 +-	if (!rport)
  11.784 ++	if (!rport) {
  11.785 + 		qla_printk(KERN_WARNING, ha,
  11.786 + 		    "Unable to allocate fc remote port!\n");
  11.787 ++		return;
  11.788 ++	}
  11.789 + 
  11.790 + 	if (rport->scsi_target_id != -1 && rport->scsi_target_id < MAX_TARGETS)
  11.791 + 		fcport->os_target_id = rport->scsi_target_id;
  11.792 +diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
  11.793 +--- a/drivers/scsi/qla2xxx/qla_os.c
  11.794 ++++ b/drivers/scsi/qla2xxx/qla_os.c
  11.795 +@@ -1150,7 +1150,7 @@ iospace_error_exit:
  11.796 +  */
  11.797 + int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
  11.798 + {
  11.799 +-	int	ret;
  11.800 ++	int	ret = -ENODEV;
  11.801 + 	device_reg_t __iomem *reg;
  11.802 + 	struct Scsi_Host *host;
  11.803 + 	scsi_qla_host_t *ha;
  11.804 +@@ -1161,7 +1161,7 @@ int qla2x00_probe_one(struct pci_dev *pd
  11.805 + 	fc_port_t *fcport;
  11.806 + 
  11.807 + 	if (pci_enable_device(pdev))
  11.808 +-		return -1;
  11.809 ++		goto probe_out;
  11.810 + 
  11.811 + 	host = scsi_host_alloc(&qla2x00_driver_template,
  11.812 + 	    sizeof(scsi_qla_host_t));
  11.813 +@@ -1183,9 +1183,8 @@ int qla2x00_probe_one(struct pci_dev *pd
  11.814 + 
  11.815 + 	/* Configure PCI I/O space */
  11.816 + 	ret = qla2x00_iospace_config(ha);
  11.817 +-	if (ret != 0) {
  11.818 +-		goto probe_alloc_failed;
  11.819 +-	}
  11.820 ++	if (ret)
  11.821 ++		goto probe_failed;
  11.822 + 
  11.823 + 	/* Sanitize the information from PCI BIOS. */
  11.824 + 	host->irq = pdev->irq;
  11.825 +@@ -1258,23 +1257,10 @@ int qla2x00_probe_one(struct pci_dev *pd
  11.826 + 		qla_printk(KERN_WARNING, ha,
  11.827 + 		    "[ERROR] Failed to allocate memory for adapter\n");
  11.828 + 
  11.829 +-		goto probe_alloc_failed;
  11.830 ++		ret = -ENOMEM;
  11.831 ++		goto probe_failed;
  11.832 + 	}
  11.833 + 
  11.834 +-	pci_set_drvdata(pdev, ha);
  11.835 +-	host->this_id = 255;
  11.836 +-	host->cmd_per_lun = 3;
  11.837 +-	host->unique_id = ha->instance;
  11.838 +-	host->max_cmd_len = MAX_CMDSZ;
  11.839 +-	host->max_channel = ha->ports - 1;
  11.840 +-	host->max_id = ha->max_targets;
  11.841 +-	host->max_lun = ha->max_luns;
  11.842 +-	host->transportt = qla2xxx_transport_template;
  11.843 +-	if (scsi_add_host(host, &pdev->dev))
  11.844 +-		goto probe_alloc_failed;
  11.845 +-
  11.846 +-	qla2x00_alloc_sysfs_attr(ha);
  11.847 +-
  11.848 + 	if (qla2x00_initialize_adapter(ha) &&
  11.849 + 	    !(ha->device_flags & DFLG_NO_CABLE)) {
  11.850 + 
  11.851 +@@ -1285,11 +1271,10 @@ int qla2x00_probe_one(struct pci_dev *pd
  11.852 + 		    "Adapter flags %x.\n",
  11.853 + 		    ha->host_no, ha->device_flags));
  11.854 + 
  11.855 ++		ret = -ENODEV;
  11.856 + 		goto probe_failed;
  11.857 + 	}
  11.858 + 
  11.859 +-	qla2x00_init_host_attr(ha);
  11.860 +-
  11.861 + 	/*
  11.862 + 	 * Startup the kernel thread for this host adapter
  11.863 + 	 */
  11.864 +@@ -1299,17 +1284,26 @@ int qla2x00_probe_one(struct pci_dev *pd
  11.865 + 		qla_printk(KERN_WARNING, ha,
  11.866 + 		    "Unable to start DPC thread!\n");
  11.867 + 
  11.868 ++		ret = -ENODEV;
  11.869 + 		goto probe_failed;
  11.870 + 	}
  11.871 + 	wait_for_completion(&ha->dpc_inited);
  11.872 + 
  11.873 ++	host->this_id = 255;
  11.874 ++	host->cmd_per_lun = 3;
  11.875 ++	host->unique_id = ha->instance;
  11.876 ++	host->max_cmd_len = MAX_CMDSZ;
  11.877 ++	host->max_channel = ha->ports - 1;
  11.878 ++	host->max_lun = MAX_LUNS;
  11.879 ++	host->transportt = qla2xxx_transport_template;
  11.880 ++
  11.881 + 	if (IS_QLA2100(ha) || IS_QLA2200(ha))
  11.882 + 		ret = request_irq(host->irq, qla2100_intr_handler,
  11.883 + 		    SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
  11.884 + 	else
  11.885 + 		ret = request_irq(host->irq, qla2300_intr_handler,
  11.886 + 		    SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
  11.887 +-	if (ret != 0) {
  11.888 ++	if (ret) {
  11.889 + 		qla_printk(KERN_WARNING, ha,
  11.890 + 		    "Failed to reserve interrupt %d already in use.\n",
  11.891 + 		    host->irq);
  11.892 +@@ -1363,9 +1357,18 @@ int qla2x00_probe_one(struct pci_dev *pd
  11.893 + 		msleep(10);
  11.894 + 	}
  11.895 + 
  11.896 ++	pci_set_drvdata(pdev, ha);
  11.897 + 	ha->flags.init_done = 1;
  11.898 + 	num_hosts++;
  11.899 + 
  11.900 ++	ret = scsi_add_host(host, &pdev->dev);
  11.901 ++	if (ret)
  11.902 ++		goto probe_failed;
  11.903 ++
  11.904 ++	qla2x00_alloc_sysfs_attr(ha);
  11.905 ++
  11.906 ++	qla2x00_init_host_attr(ha);
  11.907 ++
  11.908 + 	qla_printk(KERN_INFO, ha, "\n"
  11.909 + 	    " QLogic Fibre Channel HBA Driver: %s\n"
  11.910 + 	    "  QLogic %s - %s\n"
  11.911 +@@ -1384,9 +1387,6 @@ int qla2x00_probe_one(struct pci_dev *pd
  11.912 + probe_failed:
  11.913 + 	fc_remove_host(ha->host);
  11.914 + 
  11.915 +-	scsi_remove_host(host);
  11.916 +-
  11.917 +-probe_alloc_failed:
  11.918 + 	qla2x00_free_device(ha);
  11.919 + 
  11.920 + 	scsi_host_put(host);
  11.921 +@@ -1394,7 +1394,8 @@ probe_alloc_failed:
  11.922 + probe_disable_device:
  11.923 + 	pci_disable_device(pdev);
  11.924 + 
  11.925 +-	return -1;
  11.926 ++probe_out:
  11.927 ++	return ret;
  11.928 + }
  11.929 + EXPORT_SYMBOL_GPL(qla2x00_probe_one);
  11.930 + 
  11.931 +diff --git a/fs/bio.c b/fs/bio.c
  11.932 +--- a/fs/bio.c
  11.933 ++++ b/fs/bio.c
  11.934 +@@ -261,6 +261,7 @@ inline void __bio_clone(struct bio *bio,
  11.935 + 	 */
  11.936 + 	bio->bi_vcnt = bio_src->bi_vcnt;
  11.937 + 	bio->bi_size = bio_src->bi_size;
  11.938 ++	bio->bi_idx = bio_src->bi_idx;
  11.939 + 	bio_phys_segments(q, bio);
  11.940 + 	bio_hw_segments(q, bio);
  11.941 + }
  11.942 +diff --git a/fs/char_dev.c b/fs/char_dev.c
  11.943 +--- a/fs/char_dev.c
  11.944 ++++ b/fs/char_dev.c
  11.945 +@@ -139,7 +139,7 @@ __unregister_chrdev_region(unsigned majo
  11.946 + 	struct char_device_struct *cd = NULL, **cp;
  11.947 + 	int i = major_to_index(major);
  11.948 + 
  11.949 +-	up(&chrdevs_lock);
  11.950 ++	down(&chrdevs_lock);
  11.951 + 	for (cp = &chrdevs[i]; *cp; cp = &(*cp)->next)
  11.952 + 		if ((*cp)->major == major &&
  11.953 + 		    (*cp)->baseminor == baseminor &&
  11.954 +diff --git a/fs/exec.c b/fs/exec.c
  11.955 +--- a/fs/exec.c
  11.956 ++++ b/fs/exec.c
  11.957 +@@ -649,6 +649,7 @@ static inline int de_thread(struct task_
  11.958 + 	}
  11.959 + 	sig->group_exit_task = NULL;
  11.960 + 	sig->notify_count = 0;
  11.961 ++	sig->real_timer.data = (unsigned long)current;
  11.962 + 	spin_unlock_irq(lock);
  11.963 + 
  11.964 + 	/*
  11.965 +diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
  11.966 +--- a/include/asm-i386/string.h
  11.967 ++++ b/include/asm-i386/string.h
  11.968 +@@ -116,7 +116,8 @@ __asm__ __volatile__(
  11.969 + 	"orb $1,%%al\n"
  11.970 + 	"3:"
  11.971 + 	:"=a" (__res), "=&S" (d0), "=&D" (d1)
  11.972 +-		     :"1" (cs),"2" (ct));
  11.973 ++	:"1" (cs),"2" (ct)
  11.974 ++	:"memory");
  11.975 + return __res;
  11.976 + }
  11.977 + 
  11.978 +@@ -138,8 +139,9 @@ __asm__ __volatile__(
  11.979 + 	"3:\tsbbl %%eax,%%eax\n\t"
  11.980 + 	"orb $1,%%al\n"
  11.981 + 	"4:"
  11.982 +-		     :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
  11.983 +-		     :"1" (cs),"2" (ct),"3" (count));
  11.984 ++	:"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
  11.985 ++	:"1" (cs),"2" (ct),"3" (count)
  11.986 ++	:"memory");
  11.987 + return __res;
  11.988 + }
  11.989 + 
  11.990 +@@ -158,7 +160,9 @@ __asm__ __volatile__(
  11.991 + 	"movl $1,%1\n"
  11.992 + 	"2:\tmovl %1,%0\n\t"
  11.993 + 	"decl %0"
  11.994 +-	:"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));
  11.995 ++	:"=a" (__res), "=&S" (d0)
  11.996 ++	:"1" (s),"0" (c)
  11.997 ++	:"memory");
  11.998 + return __res;
  11.999 + }
 11.1000 + 
 11.1001 +@@ -175,7 +179,9 @@ __asm__ __volatile__(
 11.1002 + 	"leal -1(%%esi),%0\n"
 11.1003 + 	"2:\ttestb %%al,%%al\n\t"
 11.1004 + 	"jne 1b"
 11.1005 +-	:"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c));
 11.1006 ++	:"=g" (__res), "=&S" (d0), "=&a" (d1)
 11.1007 ++	:"0" (0),"1" (s),"2" (c)
 11.1008 ++	:"memory");
 11.1009 + return __res;
 11.1010 + }
 11.1011 + 
 11.1012 +@@ -189,7 +195,9 @@ __asm__ __volatile__(
 11.1013 + 	"scasb\n\t"
 11.1014 + 	"notl %0\n\t"
 11.1015 + 	"decl %0"
 11.1016 +-	:"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffffu));
 11.1017 ++	:"=c" (__res), "=&D" (d0)
 11.1018 ++	:"1" (s),"a" (0), "0" (0xffffffffu)
 11.1019 ++	:"memory");
 11.1020 + return __res;
 11.1021 + }
 11.1022 + 
 11.1023 +@@ -333,7 +341,9 @@ __asm__ __volatile__(
 11.1024 + 	"je 1f\n\t"
 11.1025 + 	"movl $1,%0\n"
 11.1026 + 	"1:\tdecl %0"
 11.1027 +-	:"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count));
 11.1028 ++	:"=D" (__res), "=&c" (d0)
 11.1029 ++	:"a" (c),"0" (cs),"1" (count)
 11.1030 ++	:"memory");
 11.1031 + return __res;
 11.1032 + }
 11.1033 + 
 11.1034 +@@ -369,7 +379,7 @@ __asm__ __volatile__(
 11.1035 + 	"je 2f\n\t"
 11.1036 + 	"stosb\n"
 11.1037 + 	"2:"
 11.1038 +-	: "=&c" (d0), "=&D" (d1)
 11.1039 ++	:"=&c" (d0), "=&D" (d1)
 11.1040 + 	:"a" (c), "q" (count), "0" (count/4), "1" ((long) s)
 11.1041 + 	:"memory");
 11.1042 + return (s);	
 11.1043 +@@ -392,7 +402,8 @@ __asm__ __volatile__(
 11.1044 + 	"jne 1b\n"
 11.1045 + 	"3:\tsubl %2,%0"
 11.1046 + 	:"=a" (__res), "=&d" (d0)
 11.1047 +-	:"c" (s),"1" (count));
 11.1048 ++	:"c" (s),"1" (count)
 11.1049 ++	:"memory");
 11.1050 + return __res;
 11.1051 + }
 11.1052 + /* end of additional stuff */
 11.1053 +@@ -473,7 +484,8 @@ static inline void * memscan(void * addr
 11.1054 + 		"dec %%edi\n"
 11.1055 + 		"1:"
 11.1056 + 		: "=D" (addr), "=c" (size)
 11.1057 +-		: "0" (addr), "1" (size), "a" (c));
 11.1058 ++		: "0" (addr), "1" (size), "a" (c)
 11.1059 ++		: "memory");
 11.1060 + 	return addr;
 11.1061 + }
 11.1062 + 
 11.1063 +diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
 11.1064 +--- a/include/linux/if_shaper.h
 11.1065 ++++ b/include/linux/if_shaper.h
 11.1066 +@@ -23,7 +23,7 @@ struct shaper
 11.1067 + 	__u32 shapeclock;
 11.1068 + 	unsigned long recovery;	/* Time we can next clock a packet out on
 11.1069 + 				   an empty queue */
 11.1070 +-	struct semaphore sem;
 11.1071 ++	spinlock_t lock;
 11.1072 +         struct net_device_stats stats;
 11.1073 + 	struct net_device *dev;
 11.1074 + 	int  (*hard_start_xmit) (struct sk_buff *skb,
 11.1075 +diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
 11.1076 +--- a/include/linux/skbuff.h
 11.1077 ++++ b/include/linux/skbuff.h
 11.1078 +@@ -1192,7 +1192,7 @@ static inline void *skb_header_pointer(c
 11.1079 + {
 11.1080 + 	int hlen = skb_headlen(skb);
 11.1081 + 
 11.1082 +-	if (offset + len <= hlen)
 11.1083 ++	if (hlen - offset >= len)
 11.1084 + 		return skb->data + offset;
 11.1085 + 
 11.1086 + 	if (skb_copy_bits(skb, offset, buffer, len) < 0)
 11.1087 +diff --git a/mm/memory.c b/mm/memory.c
 11.1088 +--- a/mm/memory.c
 11.1089 ++++ b/mm/memory.c
 11.1090 +@@ -1164,7 +1164,7 @@ int remap_pfn_range(struct vm_area_struc
 11.1091 + {
 11.1092 + 	pgd_t *pgd;
 11.1093 + 	unsigned long next;
 11.1094 +-	unsigned long end = addr + size;
 11.1095 ++	unsigned long end = addr + PAGE_ALIGN(size);
 11.1096 + 	struct mm_struct *mm = vma->vm_mm;
 11.1097 + 	int err;
 11.1098 + 
 11.1099 +diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
 11.1100 +--- a/net/8021q/vlan.c
 11.1101 ++++ b/net/8021q/vlan.c
 11.1102 +@@ -578,6 +578,14 @@ static int vlan_device_event(struct noti
 11.1103 + 			if (!vlandev)
 11.1104 + 				continue;
 11.1105 + 
 11.1106 ++			if (netif_carrier_ok(dev)) {
 11.1107 ++				if (!netif_carrier_ok(vlandev))
 11.1108 ++					netif_carrier_on(vlandev);
 11.1109 ++			} else {
 11.1110 ++				if (netif_carrier_ok(vlandev))
 11.1111 ++					netif_carrier_off(vlandev);
 11.1112 ++			}
 11.1113 ++
 11.1114 + 			if ((vlandev->state & VLAN_LINK_STATE_MASK) != flgs) {
 11.1115 + 				vlandev->state = (vlandev->state &~ VLAN_LINK_STATE_MASK) 
 11.1116 + 					| flgs;
 11.1117 +diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
 11.1118 +--- a/net/ipv4/ip_output.c
 11.1119 ++++ b/net/ipv4/ip_output.c
 11.1120 +@@ -111,7 +111,6 @@ static int ip_dev_loopback_xmit(struct s
 11.1121 + #ifdef CONFIG_NETFILTER_DEBUG
 11.1122 + 	nf_debug_ip_loopback_xmit(newskb);
 11.1123 + #endif
 11.1124 +-	nf_reset(newskb);
 11.1125 + 	netif_rx(newskb);
 11.1126 + 	return 0;
 11.1127 + }
 11.1128 +@@ -196,8 +195,6 @@ static inline int ip_finish_output2(stru
 11.1129 + 	nf_debug_ip_finish_output2(skb);
 11.1130 + #endif /*CONFIG_NETFILTER_DEBUG*/
 11.1131 + 
 11.1132 +-	nf_reset(skb);
 11.1133 +-
 11.1134 + 	if (hh) {
 11.1135 + 		int hh_alen;
 11.1136 + 
 11.1137 +diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
 11.1138 +--- a/net/ipv4/netfilter/ip_conntrack_core.c
 11.1139 ++++ b/net/ipv4/netfilter/ip_conntrack_core.c
 11.1140 +@@ -1124,6 +1124,9 @@ void ip_conntrack_cleanup(void)
 11.1141 + 		schedule();
 11.1142 + 		goto i_see_dead_people;
 11.1143 + 	}
 11.1144 ++	/* wait until all references to ip_conntrack_untracked are dropped */
 11.1145 ++	while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1)
 11.1146 ++		schedule();
 11.1147 + 
 11.1148 + 	kmem_cache_destroy(ip_conntrack_cachep);
 11.1149 + 	kmem_cache_destroy(ip_conntrack_expect_cachep);
 11.1150 +diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
 11.1151 +--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
 11.1152 ++++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
 11.1153 +@@ -432,6 +432,13 @@ static unsigned int ip_conntrack_defrag(
 11.1154 + 				        const struct net_device *out,
 11.1155 + 				        int (*okfn)(struct sk_buff *))
 11.1156 + {
 11.1157 ++#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
 11.1158 ++	/* Previously seen (loopback)?  Ignore.  Do this before
 11.1159 ++           fragment check. */
 11.1160 ++	if ((*pskb)->nfct)
 11.1161 ++		return NF_ACCEPT;
 11.1162 ++#endif
 11.1163 ++
 11.1164 + 	/* Gather fragments. */
 11.1165 + 	if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {
 11.1166 + 		*pskb = ip_ct_gather_frags(*pskb,
 11.1167 +diff --git a/net/ipv4/netfilter/ip_nat_proto_tcp.c b/net/ipv4/netfilter/ip_nat_proto_tcp.c
 11.1168 +--- a/net/ipv4/netfilter/ip_nat_proto_tcp.c
 11.1169 ++++ b/net/ipv4/netfilter/ip_nat_proto_tcp.c
 11.1170 +@@ -40,7 +40,8 @@ tcp_unique_tuple(struct ip_conntrack_tup
 11.1171 + 		 enum ip_nat_manip_type maniptype,
 11.1172 + 		 const struct ip_conntrack *conntrack)
 11.1173 + {
 11.1174 +-	static u_int16_t port, *portptr;
 11.1175 ++	static u_int16_t port;
 11.1176 ++	u_int16_t *portptr;
 11.1177 + 	unsigned int range_size, min, i;
 11.1178 + 
 11.1179 + 	if (maniptype == IP_NAT_MANIP_SRC)
 11.1180 +diff --git a/net/ipv4/netfilter/ip_nat_proto_udp.c b/net/ipv4/netfilter/ip_nat_proto_udp.c
 11.1181 +--- a/net/ipv4/netfilter/ip_nat_proto_udp.c
 11.1182 ++++ b/net/ipv4/netfilter/ip_nat_proto_udp.c
 11.1183 +@@ -41,7 +41,8 @@ udp_unique_tuple(struct ip_conntrack_tup
 11.1184 + 		 enum ip_nat_manip_type maniptype,
 11.1185 + 		 const struct ip_conntrack *conntrack)
 11.1186 + {
 11.1187 +-	static u_int16_t port, *portptr;
 11.1188 ++	static u_int16_t port;
 11.1189 ++	u_int16_t *portptr;
 11.1190 + 	unsigned int range_size, min, i;
 11.1191 + 
 11.1192 + 	if (maniptype == IP_NAT_MANIP_SRC)
 11.1193 +diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
 11.1194 +--- a/net/ipv6/netfilter/ip6_queue.c
 11.1195 ++++ b/net/ipv6/netfilter/ip6_queue.c
 11.1196 +@@ -76,7 +76,9 @@ static DECLARE_MUTEX(ipqnl_sem);
 11.1197 + static void
 11.1198 + ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)
 11.1199 + {
 11.1200 ++	local_bh_disable();
 11.1201 + 	nf_reinject(entry->skb, entry->info, verdict);
 11.1202 ++	local_bh_enable();
 11.1203 + 	kfree(entry);
 11.1204 + }
 11.1205 + 
 11.1206 +diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
 11.1207 +--- a/net/netlink/af_netlink.c
 11.1208 ++++ b/net/netlink/af_netlink.c
 11.1209 +@@ -315,8 +315,8 @@ err:
 11.1210 + static void netlink_remove(struct sock *sk)
 11.1211 + {
 11.1212 + 	netlink_table_grab();
 11.1213 +-	nl_table[sk->sk_protocol].hash.entries--;
 11.1214 +-	sk_del_node_init(sk);
 11.1215 ++	if (sk_del_node_init(sk))
 11.1216 ++		nl_table[sk->sk_protocol].hash.entries--;
 11.1217 + 	if (nlk_sk(sk)->groups)
 11.1218 + 		__sk_del_bind_node(sk);
 11.1219 + 	netlink_table_ungrab();
 11.1220 +@@ -429,7 +429,12 @@ retry:
 11.1221 + 	err = netlink_insert(sk, pid);
 11.1222 + 	if (err == -EADDRINUSE)
 11.1223 + 		goto retry;
 11.1224 +-	return 0;
 11.1225 ++
 11.1226 ++	/* If 2 threads race to autobind, that is fine.  */
 11.1227 ++	if (err == -EBUSY)
 11.1228 ++		err = 0;
 11.1229 ++
 11.1230 ++	return err;
 11.1231 + }
 11.1232 + 
 11.1233 + static inline int netlink_capable(struct socket *sock, unsigned int flag) 
 11.1234 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
 11.1235 +--- a/net/packet/af_packet.c
 11.1236 ++++ b/net/packet/af_packet.c
 11.1237 +@@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buf
 11.1238 + 	dst_release(skb->dst);
 11.1239 + 	skb->dst = NULL;
 11.1240 + 
 11.1241 ++	/* drop conntrack reference */
 11.1242 ++	nf_reset(skb);
 11.1243 ++
 11.1244 + 	spkt = (struct sockaddr_pkt*)skb->cb;
 11.1245 + 
 11.1246 + 	skb_push(skb, skb->data-skb->mac.raw);
 11.1247 +@@ -517,6 +520,9 @@ static int packet_rcv(struct sk_buff *sk
 11.1248 + 	dst_release(skb->dst);
 11.1249 + 	skb->dst = NULL;
 11.1250 + 
 11.1251 ++	/* drop conntrack reference */
 11.1252 ++	nf_reset(skb);
 11.1253 ++
 11.1254 + 	spin_lock(&sk->sk_receive_queue.lock);
 11.1255 + 	po->stats.tp_packets++;
 11.1256 + 	__skb_queue_tail(&sk->sk_receive_queue, skb);
 11.1257 +diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
 11.1258 +--- a/net/xfrm/xfrm_user.c
 11.1259 ++++ b/net/xfrm/xfrm_user.c
 11.1260 +@@ -1180,6 +1180,9 @@ static struct xfrm_policy *xfrm_compile_
 11.1261 + 	if (nr > XFRM_MAX_DEPTH)
 11.1262 + 		return NULL;
 11.1263 + 
 11.1264 ++	if (p->dir > XFRM_POLICY_OUT)
 11.1265 ++		return NULL;
 11.1266 ++
 11.1267 + 	xp = xfrm_policy_alloc(GFP_KERNEL);
 11.1268 + 	if (xp == NULL) {
 11.1269 + 		*dir = -ENOBUFS;