diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/MAINTAINERS linux-2.4.31-pre2/MAINTAINERS
--- linux-2.4.30/MAINTAINERS	2005-04-04 01:42:19.000000000 +0000
+++ linux-2.4.31-pre2/MAINTAINERS	2005-05-12 12:17:54.644338216 +0000
@@ -152,14 +152,6 @@ L:	linux-sound@vger.kernel.org
 W:	http://www.uni-karlsruhe.de/~Robert.Siemer/Private/
 S:	Maintained
 
-ACP/MWAVE MODEM
-P:	Paul B Schroeder
-M:	paulsch@us.ibm.com
-P:	Mike Sullivan
-M:	sullivam@us.ibm.com
-W:	http://www.ibm.com/linux/ltc/
-S:	Supported
-
 AACRAID SCSI RAID DRIVER
 P:	Adaptec OEM Raid Solutions
 M:	linux-aacraid-devel@dell.com
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/Makefile linux-2.4.31-pre2/Makefile
--- linux-2.4.30/Makefile	2005-04-04 01:42:20.000000000 +0000
+++ linux-2.4.31-pre2/Makefile	2005-05-12 12:18:06.847483056 +0000
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
-SUBLEVEL = 30
-EXTRAVERSION =
+SUBLEVEL = 31
+EXTRAVERSION = -pre2
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/i386/mm/pageattr.c linux-2.4.31-pre2/arch/i386/mm/pageattr.c
--- linux-2.4.30/arch/i386/mm/pageattr.c	2004-08-07 23:26:04.000000000 +0000
+++ linux-2.4.31-pre2/arch/i386/mm/pageattr.c	2005-05-12 12:17:03.007188256 +0000
@@ -119,19 +119,15 @@ __change_page_attr(struct page *page, pg
 	kpte_page = virt_to_page(((unsigned long)kpte) & PAGE_MASK);
 	if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { 
 		if ((pte_val(*kpte) & _PAGE_PSE) == 0) {
-			pte_t old = *kpte;
-			pte_t standard = mk_pte(page, PAGE_KERNEL); 
-
 			set_pte_atomic(kpte, mk_pte(page, prot)); 
-			if (pte_same(old,standard))
-				atomic_inc(&kpte_page->count);
 		} else {
 			struct page *split = split_large_page(address, prot); 
 			if (!split)
 				return -ENOMEM;
-			atomic_inc(&kpte_page->count); 	
 			set_pmd_pte(kpte,address,mk_pte(split, PAGE_KERNEL));
+			kpte_page = split;
 		}	
+		atomic_inc(&kpte_page->count);
 	} else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
 		set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
 		atomic_dec(&kpte_page->count); 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/ppc/kernel/time.c linux-2.4.31-pre2/arch/ppc/kernel/time.c
--- linux-2.4.30/arch/ppc/kernel/time.c	2003-08-25 11:44:40.000000000 +0000
+++ linux-2.4.31-pre2/arch/ppc/kernel/time.c	2005-05-12 12:18:18.219754208 +0000
@@ -150,7 +150,7 @@ int timer_interrupt(struct pt_regs * reg
 
 	hardirq_enter(cpu);
 
-	while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) < 0) {
+	while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) <= 0) {
 		jiffy_stamp += tb_ticks_per_jiffy;
 		if (!user_mode(regs))
 			ppc_do_profile(instruction_pointer(regs));
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/x86_64/kernel/e820.c linux-2.4.31-pre2/arch/x86_64/kernel/e820.c
--- linux-2.4.30/arch/x86_64/kernel/e820.c	2004-08-07 23:26:04.000000000 +0000
+++ linux-2.4.31-pre2/arch/x86_64/kernel/e820.c	2005-05-12 12:17:11.562887592 +0000
@@ -594,7 +594,10 @@ void __init parse_mem_cmdline (char ** c
 			ioapic_force = 1;
 			skip_ioapic_setup = 0;
 		}
-		
+		else if (!memcmp(from, "noexec=", 7)) { 
+			extern int nonx_setup(char *);
+			nonx_setup(from + 7);
+		}					
 	next:
 		c = *(from++);
 		if (!c)
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/x86_64/kernel/mtrr.c linux-2.4.31-pre2/arch/x86_64/kernel/mtrr.c
--- linux-2.4.30/arch/x86_64/kernel/mtrr.c	2004-08-07 23:26:04.000000000 +0000
+++ linux-2.4.31-pre2/arch/x86_64/kernel/mtrr.c	2005-05-12 12:16:22.750308232 +0000
@@ -198,8 +198,7 @@ static u64 size_or_mask, size_and_mask;
 
 static void get_mtrr (unsigned int reg, u64 *base, u32 *size, mtrr_type * type)
 {
-	u32 count, tmp, mask_lo, mask_hi;
-	int i;
+	u32 mask_lo, mask_hi;
 	u32 base_lo, base_hi;
 
 	rdmsr (MSR_MTRRphysMask(reg), mask_lo, mask_hi);
@@ -213,22 +212,17 @@ static void get_mtrr (unsigned int reg, 
 
 	rdmsr (MSR_MTRRphysBase(reg), base_lo, base_hi);
 
-	count = 0;
-	tmp = mask_lo >> MTRR_BEG_BIT;
-	for (i = MTRR_BEG_BIT; i <= 31; i++, tmp = tmp >> 1)
-		count = (count << (~tmp & 1)) | (~tmp & 1);
-	
-	tmp = mask_hi;
-	for (i = 0; i <= MTRR_END_BIT; i++, tmp = tmp >> 1)
-		count = (count << (~tmp & 1)) | (~tmp & 1);
-	
-	*size = (count+1); 
-	*base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT;
-	*type = base_lo & 0xff;
+	/* Work out the shifted address mask */
+	mask_lo = size_or_mask | mask_hi << (32 - PAGE_SHIFT) | 
+		  mask_lo >> PAGE_SHIFT; 
+
+	/* This works correctly if size is a power of two, i.e. a
+	   continguous range. */
+	*size = -mask_lo;
+	*base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT; 
+	*type = base_lo & 0xff; 
 }
 
-
-
 /*
  * Set variable MTRR register on the local CPU.
  *  <reg> The register to set.
@@ -242,8 +236,6 @@ static void set_mtrr_up (unsigned int re
 		   u32 size, mtrr_type type, int do_safe)
 {
 	struct set_mtrr_context ctxt;
-	u64 base64;
-	u64 size64;
 
 	if (do_safe) { 
 		set_mtrr_prepare (&ctxt);
@@ -255,12 +247,10 @@ static void set_mtrr_up (unsigned int re
 		   relevant mask register to disable a range. */
 		wrmsr (MSR_MTRRphysMask(reg), 0, 0);
 	} else {
-		base64 = (base << PAGE_SHIFT) & size_and_mask;
-		wrmsr (MSR_MTRRphysBase(reg), base64 | type, base64 >> 32);
-
-		size64 = ~(((u64)size << PAGE_SHIFT) - 1);
-		size64 = size64 & size_and_mask;
-		wrmsr (MSR_MTRRphysMask(reg), (u32) (size64 | 0x800), (u32) (size64 >> 32));
+		wrmsr (MSR_MTRRphysBase(reg), base << PAGE_SHIFT | type, 
+			(base & size_and_mask) >> (32 - PAGE_SHIFT));
+		wrmsr(MSR_MTRRphysMask(reg), -size << PAGE_SHIFT | 0x800,
+			(-size & size_and_mask) >> (32 - PAGE_SHIFT));
 	}
 	if (do_safe)
 		set_mtrr_done (&ctxt);
@@ -691,13 +681,13 @@ int mtrr_add_page (u64 base, u32 size, u
 		return -ENOSYS;
 	}
 
-	if (base & (size_or_mask>>PAGE_SHIFT)) {
+	if (base & size_or_mask) {
 		printk (KERN_WARNING "mtrr: base(%Lx) exceeds the MTRR width(%Lx)\n",
-				base, (size_or_mask>>PAGE_SHIFT));
+				base, size_or_mask);
 		return -EINVAL;
 	}
 
-	if (size & (size_or_mask>>PAGE_SHIFT)) {
+	if (size & size_or_mask) {
 		printk (KERN_WARNING "mtrr: size exceeds the MTRR width\n");
 		return -EINVAL;
 	}
@@ -1281,16 +1271,22 @@ static void __init mtrr_setup (void)
 
 	if (test_bit (X86_FEATURE_MTRR, boot_cpu_data.x86_capability)) {
 		/* Query the width (in bits) of the physical
-		   addressable memory on the Hammer family. */
-		if ((cpuid_eax (0x80000000) >= 0x80000008)) {
+		   addressable memory. This is an AMD specific MSR,
+		   but we assume(hope?) Intel will implement it too
+		   when they extend the width of the Xeon address bus. */
+		if (cpuid_eax (0x80000000) >= 0x80000008) {
 			u32 phys_addr;
 			phys_addr = cpuid_eax (0x80000008) & 0xff;
-			size_or_mask = ~((1L << phys_addr) - 1);
+			size_or_mask = ~((1L << (phys_addr - PAGE_SHIFT)) - 1);
 			/*
 			 * top bits MBZ as its beyond the addressable range.
 			 * bottom bits MBZ as we don't care about lower 12 bits of addr.
 			 */
-			size_and_mask = (~size_or_mask) & 0x000ffffffffff000L;
+			size_and_mask = ~size_or_mask &  0xfff00000;
+		} else {
+			/* 36bit fallback */
+			size_or_mask = 0xff000000;
+			size_and_mask = 0x00f00000;
 		}
 	}
 }
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/x86_64/kernel/process.c linux-2.4.31-pre2/arch/x86_64/kernel/process.c
--- linux-2.4.30/arch/x86_64/kernel/process.c	2004-04-14 13:05:28.000000000 +0000
+++ linux-2.4.31-pre2/arch/x86_64/kernel/process.c	2005-05-12 12:17:21.360398144 +0000
@@ -185,7 +185,6 @@ int __init select_idle_routine(struct cp
 		}
 		return 1;
 	}
-	pm_idle = default_idle;
 	return 1;
 }
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/x86_64/kernel/setup64.c linux-2.4.31-pre2/arch/x86_64/kernel/setup64.c
--- linux-2.4.30/arch/x86_64/kernel/setup64.c	2004-04-14 13:05:28.000000000 +0000
+++ linux-2.4.31-pre2/arch/x86_64/kernel/setup64.c	2005-05-12 12:18:45.666581656 +0000
@@ -53,7 +53,7 @@ noforce (default) Don't enable by defaul
 
 */ 
 
-static int __init nonx_setup(char *str)
+int __init nonx_setup(char *str)
 {
 	if (!strncmp(str, "on",3)) { 
 		__supported_pte_mask |= _PAGE_NX; 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/x86_64/kernel/smp.c linux-2.4.31-pre2/arch/x86_64/kernel/smp.c
--- linux-2.4.30/arch/x86_64/kernel/smp.c	2003-11-28 18:26:19.000000000 +0000
+++ linux-2.4.31-pre2/arch/x86_64/kernel/smp.c	2005-05-12 12:17:10.464054640 +0000
@@ -228,7 +228,8 @@ static void inline leave_mm (unsigned lo
 		BUG();
 	clear_bit(cpu, &cpu_tlbstate[cpu].active_mm->cpu_vm_mask);
 	/* flush TLB before it goes away. this stops speculative prefetches */
-	__flush_tlb(); 
+	*read_pda(level4_pgt) = __pa(init_mm.pgd) | _PAGE_TABLE;
+	__flush_tlb();
 }
 
 /*
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/arch/x86_64/mm/pageattr.c linux-2.4.31-pre2/arch/x86_64/mm/pageattr.c
--- linux-2.4.30/arch/x86_64/mm/pageattr.c	2004-04-14 13:05:28.000000000 +0000
+++ linux-2.4.31-pre2/arch/x86_64/mm/pageattr.c	2005-05-12 12:16:40.395625736 +0000
@@ -55,7 +55,7 @@ static void flush_kernel_map(void * addr
 			asm volatile("clflush (%0)" :: "r" (address + i)); 
 	} else
 		asm volatile("wbinvd":::"memory"); 
-	__flush_tlb_one(address);
+	__flush_tlb_all();
 }
 
 /* no more special protections in this 2MB area - revert to a
@@ -101,18 +101,15 @@ __change_page_attr(unsigned long address
 	kpte_page = virt_to_page(((unsigned long)kpte) & PAGE_MASK);
 	if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { 
 		if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
-			pte_t old = *kpte;
-			pte_t standard = mk_pte(page, PAGE_KERNEL); 
-
 			set_pte(kpte, mk_pte(page, prot)); 
-			if (pte_same(old,standard))
-				atomic_inc(&kpte_page->count);
 		} else {
 			struct page *split = split_large_page(address, prot); 
 			if (!split)
 				return -ENOMEM;
 			set_pte(kpte,mk_pte(split, PAGE_KERNEL));
-		}	
+			kpte_page = split;
+		}
+		atomic_inc(&kpte_page->count);	
 	} else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
 		set_pte(kpte, mk_pte(page, PAGE_KERNEL));
 		atomic_dec(&kpte_page->count); 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/char/moxa.c linux-2.4.31-pre2/drivers/char/moxa.c
--- linux-2.4.30/drivers/char/moxa.c	2005-01-19 14:09:47.000000000 +0000
+++ linux-2.4.31-pre2/drivers/char/moxa.c	2005-05-12 12:18:39.815471160 +0000
@@ -995,7 +995,8 @@ static void moxa_poll(unsigned long igno
 		return;
 	}
 	for (card = 0; card < MAX_BOARDS; card++) {
-		if ((ports = MoxaPortsOfCard(card)) <= 0)
+		if ((ports = MoxaPortsOfCard(card)) <= 0
+				|| moxaIntPend[card] == 0)
 			continue;
 		ch = &moxaChannels[card * MAX_PORTS_PER_BOARD];
 		for (i = 0; i < ports; i++, ch++) {
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/i2c/i2c-core.c linux-2.4.31-pre2/drivers/i2c/i2c-core.c
--- linux-2.4.30/drivers/i2c/i2c-core.c	2005-01-19 14:09:54.000000000 +0000
+++ linux-2.4.31-pre2/drivers/i2c/i2c-core.c	2005-05-12 12:16:32.256863016 +0000
@@ -851,7 +851,7 @@ int i2c_probe(struct i2c_adapter *adapte
 		   at all */
 		found = 0;
 
-		for (i = 0; !found && (address_data->force[i] != I2C_CLIENT_END); i += 3) {
+		for (i = 0; !found && (address_data->force[i] != I2C_CLIENT_END); i += 2) {
 			if (((adap_id == address_data->force[i]) || 
 			     (address_data->force[i] == ANY_I2C_BUS)) &&
 			     (addr == address_data->force[i+1])) {
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/net/bonding/bond_main.c linux-2.4.31-pre2/drivers/net/bonding/bond_main.c
--- linux-2.4.30/drivers/net/bonding/bond_main.c	2004-11-17 11:54:21.000000000 +0000
+++ linux-2.4.31-pre2/drivers/net/bonding/bond_main.c	2005-05-12 12:18:39.492520256 +0000
@@ -469,6 +469,13 @@
  *	  * Add support for VLAN hardware acceleration capable slaves.
  *	  * Add capability to tag self generated packets in ALB/TLB modes.
  *	  Set version to 2.6.0.
+ * 2004/10/29 - Mitch Williams <mitch.a.williams at intel dot com>
+ *	- Fixed bug when unloading module while using 802.3ad.  If
+ *	  spinlock debugging is turned on, this causes a stack dump.
+ *	  Solution is to move call to dev_remove_pack outside of the
+ *	  spinlock.
+ *	  Set version to 2.6.1.
+ *
  */
 
 //#define BONDING_DEBUG 1
@@ -3565,15 +3572,15 @@ static int bond_close(struct net_device 
 {
 	struct bonding *bond = bond_dev->priv;
 
-	write_lock_bh(&bond->lock);
-
-	bond_mc_list_destroy(bond);
-
 	if (bond->params.mode == BOND_MODE_8023AD) {
 		/* Unregister the receive of LACPDUs */
 		bond_unregister_lacpdu(bond);
 	}
 
+	write_lock_bh(&bond->lock);
+
+	bond_mc_list_destroy(bond);
+
 	/* signal timers not to re-arm */
 	bond->kill_timers = 1;
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/net/pcnet32.c linux-2.4.31-pre2/drivers/net/pcnet32.c
--- linux-2.4.30/drivers/net/pcnet32.c	2005-01-19 14:09:56.000000000 +0000
+++ linux-2.4.31-pre2/drivers/net/pcnet32.c	2005-05-12 12:16:51.013011648 +0000
@@ -1348,7 +1348,8 @@ pcnet32_probe1(unsigned long ioaddr, int
 	printk(KERN_INFO "%s: registered as %s\n", dev->name, lp->name);
     cards_found++;
 
-    a->write_bcr(ioaddr, 2, 0x1002);	/* enable LED writes */
+    /* enable LED writes */
+    a->write_bcr(ioaddr, 2, a->read_bcr(ioaddr, 2) | 0x1000);
 
     return 0;
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/scsi/ahci.c linux-2.4.31-pre2/drivers/scsi/ahci.c
--- linux-2.4.30/drivers/scsi/ahci.c	2005-04-04 01:42:19.000000000 +0000
+++ linux-2.4.31-pre2/drivers/scsi/ahci.c	2005-05-12 12:18:52.343566600 +0000
@@ -176,6 +176,7 @@ static void ahci_eng_timeout(struct ata_
 static int ahci_port_start(struct ata_port *ap);
 static void ahci_port_stop(struct ata_port *ap);
 static void ahci_host_stop(struct ata_host_set *host_set);
+static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
 static void ahci_qc_prep(struct ata_queued_cmd *qc);
 static u8 ahci_check_status(struct ata_port *ap);
 static u8 ahci_check_err(struct ata_port *ap);
@@ -209,6 +210,8 @@ static struct ata_port_operations ahci_o
 	.check_err		= ahci_check_err,
 	.dev_select		= ata_noop_dev_select,
 
+	.tf_read		= ahci_tf_read,
+
 	.phy_reset		= ahci_phy_reset,
 
 	.qc_prep		= ahci_qc_prep,
@@ -249,8 +252,6 @@ static struct pci_device_id ahci_pci_tbl
 	  board_ahci }, /* ICH7 */
 	{ PCI_VENDOR_ID_INTEL, 0x27c5, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 	  board_ahci }, /* ICH7M */
-	{ PCI_VENDOR_ID_INTEL, 0x27c2, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-	  board_ahci }, /* ICH7R */
 	{ PCI_VENDOR_ID_INTEL, 0x27c3, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 	  board_ahci }, /* ICH7R */
 	{ PCI_VENDOR_ID_AL, 0x5288, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
@@ -462,6 +463,14 @@ static u8 ahci_check_err(struct ata_port
 	return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;
 }
 
+static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
+{
+	struct ahci_port_priv *pp = ap->private_data;
+	u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
+
+	ata_tf_from_fis(d2h_fis, tf);
+}
+
 static void ahci_fill_sg(struct ata_queued_cmd *qc)
 {
 	struct ahci_port_priv *pp = qc->ap->private_data;
@@ -538,7 +547,7 @@ static void ahci_intr_error(struct ata_p
 
 	/* stop DMA */
 	tmp = readl(port_mmio + PORT_CMD);
-	tmp &= PORT_CMD_START | PORT_CMD_FIS_RX;
+	tmp &= ~PORT_CMD_START;
 	writel(tmp, port_mmio + PORT_CMD);
 
 	/* wait for engine to stop.  TODO: this could be
@@ -570,7 +579,7 @@ static void ahci_intr_error(struct ata_p
 
 	/* re-start DMA */
 	tmp = readl(port_mmio + PORT_CMD);
-	tmp |= PORT_CMD_START | PORT_CMD_FIS_RX;
+	tmp |= PORT_CMD_START;
 	writel(tmp, port_mmio + PORT_CMD);
 	readl(port_mmio + PORT_CMD); /* flush */
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/scsi/libata-scsi.c linux-2.4.31-pre2/drivers/scsi/libata-scsi.c
--- linux-2.4.30/drivers/scsi/libata-scsi.c	2005-04-04 01:42:19.000000000 +0000
+++ linux-2.4.31-pre2/drivers/scsi/libata-scsi.c	2005-05-12 12:16:27.213629704 +0000
@@ -1000,7 +1000,12 @@ static unsigned int ata_msense_caching(u
 
 static unsigned int ata_msense_ctl_mode(u8 **ptr_io, const u8 *last)
 {
-	const u8 page[] = {0xa, 0xa, 2, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 30};
+	const u8 page[] = {0xa, 0xa, 6, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 30};
+
+	/* byte 2: set the descriptor format sense data bit (bit 2)
+	 * since we need to support returning this format for SAT
+	 * commands and any SCSI commands against a 48b LBA device.
+	 */
 
 	ata_msense_push(ptr_io, last, page, sizeof(page));
 	return sizeof(page);
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/scsi/sata_sil.c linux-2.4.31-pre2/drivers/scsi/sata_sil.c
--- linux-2.4.30/drivers/scsi/sata_sil.c	2005-04-04 01:42:19.000000000 +0000
+++ linux-2.4.31-pre2/drivers/scsi/sata_sil.c	2005-05-12 12:17:43.878974800 +0000
@@ -38,12 +38,21 @@
 #include <linux/libata.h>
 
 #define DRV_NAME	"sata_sil"
-#define DRV_VERSION	"0.8"
+#define DRV_VERSION	"0.9"
 
 enum {
 	sil_3112		= 0,
 	sil_3114		= 1,
 
+	SIL_FIFO_R0		= 0x40,
+	SIL_FIFO_W0		= 0x41,
+	SIL_FIFO_R1		= 0x44,
+	SIL_FIFO_W1		= 0x45,
+	SIL_FIFO_R2		= 0x240,
+	SIL_FIFO_W2		= 0x241,
+	SIL_FIFO_R3		= 0x244,
+	SIL_FIFO_W3		= 0x245,
+
 	SIL_SYSCFG		= 0x48,
 	SIL_MASK_IDE0_INT	= (1 << 22),
 	SIL_MASK_IDE1_INT	= (1 << 23),
@@ -199,6 +208,13 @@ MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, sil_pci_tbl);
 MODULE_VERSION(DRV_VERSION);
 
+static unsigned char sil_get_device_cache_line(struct pci_dev *pdev)
+{
+	u8 cache_line = 0;
+	pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache_line);
+	return cache_line;
+}
+
 static void sil_post_set_mode (struct ata_port *ap)
 {
 	struct ata_host_set *host_set = ap->host_set;
@@ -341,6 +357,7 @@ static int sil_init_one (struct pci_dev 
 	unsigned int i;
 	int pci_dev_busy = 0;
 	u32 tmp, irq_mask;
+	u8 cls;
 
 	if (!printed_version++)
 		printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
@@ -402,6 +419,19 @@ static int sil_init_one (struct pci_dev 
 		ata_std_ports(&probe_ent->port[i]);
 	}
 
+	/* Initialize FIFO PCI bus arbitration */
+	cls = sil_get_device_cache_line(pdev);
+	if (cls) {
+		cls >>= 3;
+		cls++;  /* cls = (line_size/8)+1 */
+		writeb(cls, mmio_base + SIL_FIFO_R0);
+		writeb(cls, mmio_base + SIL_FIFO_W0);
+		writeb(cls, mmio_base + SIL_FIFO_R1);
+		writeb(cls, mmio_base + SIL_FIFO_W2);
+	} else
+		printk(KERN_WARNING DRV_NAME "(%s): cache line size not set.  Driver may not function\n",
+			pci_name(pdev));
+
 	if (ent->driver_data == sil_3114) {
 		irq_mask = SIL_MASK_4PORT;
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/scsi/sata_svw.c linux-2.4.31-pre2/drivers/scsi/sata_svw.c
--- linux-2.4.30/drivers/scsi/sata_svw.c	2005-04-04 01:42:19.000000000 +0000
+++ linux-2.4.31-pre2/drivers/scsi/sata_svw.c	2005-05-12 12:18:06.864480472 +0000
@@ -392,7 +392,7 @@ static int k2_sata_init_one (struct pci_
 
 	/* Clear a magic bit in SCR1 according to Darwin, those help
 	 * some funky seagate drives (though so far, those were already
-	 * set by the firmware on the machines I had access to
+	 * set by the firmware on the machines I had access to)
 	 */
 	writel(readl(mmio_base + K2_SATA_SICR1_OFFSET) & ~0x00040000,
 	       mmio_base + K2_SATA_SICR1_OFFSET);
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/usb/serial/pl2303.c linux-2.4.31-pre2/drivers/usb/serial/pl2303.c
--- linux-2.4.30/drivers/usb/serial/pl2303.c	2004-08-07 23:26:05.000000000 +0000
+++ linux-2.4.31-pre2/drivers/usb/serial/pl2303.c	2005-05-12 12:17:32.005779800 +0000
@@ -59,7 +59,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v0.10"
+#define DRIVER_VERSION "v0.10.1"	/* Takes from 2.6's */
 #define DRIVER_DESC "Prolific PL2303 USB to serial adaptor driver"
 
 
@@ -156,20 +156,38 @@ static struct usb_serial_device_type pl2
 	.shutdown =		pl2303_shutdown,
 };
 
+enum pl2303_type {
+	type_0,		/* don't know the difference between type 0 and */
+	type_1,		/* type 1, until someone from prolific tells us... */
+	HX,		/* HX version of the pl2303 chip */
+};
+
 struct pl2303_private {
 	spinlock_t lock;
 	wait_queue_head_t delta_msr_wait;
 	u8 line_control;
 	u8 line_status;
 	u8 termios_initialized;
+	enum pl2303_type type;
 };
 
 
 static int pl2303_startup (struct usb_serial *serial)
 {
 	struct pl2303_private *priv;
+	enum pl2303_type type = type_0;
 	int i;
 
+	if (serial->dev->descriptor.bDeviceClass == 0x02)
+		type = type_0;
+	else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40)
+		type = HX;
+	else if (serial->dev->descriptor.bDeviceClass == 0x00)
+		type = type_1;
+	else if (serial->dev->descriptor.bDeviceClass == 0xFF)
+		type = type_1;
+	dbg("device type: %d", type);
+
 	for (i = 0; i < serial->num_ports; ++i) {
 		priv = kmalloc (sizeof (struct pl2303_private), GFP_KERNEL);
 		if (!priv)
@@ -178,6 +196,7 @@ static int pl2303_startup (struct usb_se
 		spin_lock_init(&priv->lock);
 		init_waitqueue_head(&priv->delta_msr_wait);
 		usb_set_serial_port_data(&serial->port[i], priv);
+		priv->type = type;
 	}
 	return 0;
 }
@@ -380,10 +399,17 @@ static void pl2303_set_termios (struct u
 	     buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
 
 	if (cflag & CRTSCTS) {
-		i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
-				     VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
-				     0x0, 0x41, NULL, 0, 100);
-		dbg ("0x40:0x1:0x0:0x41  %d", i);
+		__u16 index;
+		if (priv->type == HX)
+			index = 0x61;
+		else
+			index = 0x41;
+		i = usb_control_msg(serial->dev, 
+				    usb_sndctrlpipe(serial->dev, 0),
+				    VENDOR_WRITE_REQUEST,
+				    VENDOR_WRITE_REQUEST_TYPE,
+				    0x0, index, NULL, 0, 100);
+		dbg ("0x40:0x1:0x0:0x%x  %d", index, i);
 	}
 
 	kfree (buf);
@@ -395,6 +421,7 @@ static int pl2303_open (struct usb_seria
 	struct termios tmp_termios;
 	struct usb_serial *serial = port->serial;
 	unsigned char *buf;
+	struct pl2303_private *priv = port->private;
 	int result;
 
 	if (port_paranoia_check (port, __FUNCTION__))
@@ -427,6 +454,18 @@ static int pl2303_open (struct usb_seria
 	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1);
 	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);
 	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);
+	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1);
+	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0);
+ 
+	if (priv->type == HX) {
+		/* HX chip */
+		SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x44);
+		/* reset upstream data pipes */
+          	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 8, 0);
+        	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 9, 0);
+	} else {
+		SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x24);
+	}
 
 	kfree(buf);
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/usb/serial/visor.c linux-2.4.31-pre2/drivers/usb/serial/visor.c
--- linux-2.4.30/drivers/usb/serial/visor.c	2004-08-07 23:26:05.000000000 +0000
+++ linux-2.4.31-pre2/drivers/usb/serial/visor.c	2005-05-12 12:16:58.079937312 +0000
@@ -206,6 +206,7 @@ static struct usb_device_id id_table [] 
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_M130_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_T_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_Z_ID) },
+	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE31_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_0_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_S360_ID) },
@@ -243,6 +244,7 @@ static __devinitdata struct usb_device_i
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_M130_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_T_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_TUNGSTEN_Z_ID) },
+	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE31_ID) },
 	{ USB_DEVICE(PALM_VENDOR_ID, PALM_ZIRE_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_3_5_ID) },
 	{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_0_ID) },
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/drivers/usb/serial/visor.h linux-2.4.31-pre2/drivers/usb/serial/visor.h
--- linux-2.4.30/drivers/usb/serial/visor.h	2004-04-14 13:05:35.000000000 +0000
+++ linux-2.4.31-pre2/drivers/usb/serial/visor.h	2005-05-12 12:16:51.818889136 +0000
@@ -31,6 +31,7 @@
 #define PALM_M130_ID			0x0050
 #define PALM_TUNGSTEN_T_ID		0x0060
 #define PALM_TUNGSTEN_Z_ID		0x0031
+#define PALM_ZIRE31_ID			0x0061
 #define PALM_ZIRE_ID			0x0070
 #define PALM_M100_ID			0x0080
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/fs/binfmt_elf.c linux-2.4.31-pre2/fs/binfmt_elf.c
--- linux-2.4.30/fs/binfmt_elf.c	2005-04-04 01:42:20.000000000 +0000
+++ linux-2.4.31-pre2/fs/binfmt_elf.c	2005-05-12 12:17:31.346879968 +0000
@@ -222,7 +222,7 @@ create_elf_tables(char *p, int argc, int
 	}
 
 	__put_user((elf_addr_t)argc,--sp);
-	current->mm->arg_start = (unsigned long) p;
+	current->mm->arg_start = current->mm->arg_end = (unsigned long) p;
 	while (argc-->0) {
 		__put_user((elf_caddr_t)(unsigned long)p,argv++);
 		len = strnlen_user(p, PAGE_SIZE*MAX_ARG_PAGES);
@@ -1159,7 +1159,7 @@ static int elf_core_dump(long signr, str
 	/* first copy the parameters from user space */
 	memset(&psinfo, 0, sizeof(psinfo));
 	{
-		int i, len;
+		unsigned int i, len;
 
 		len = current->mm->arg_end - current->mm->arg_start;
 		if (len >= ELF_PRARGSZ)
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/include/asm-x86_64/hw_irq.h linux-2.4.31-pre2/include/asm-x86_64/hw_irq.h
--- linux-2.4.30/include/asm-x86_64/hw_irq.h	2003-06-13 14:51:38.000000000 +0000
+++ linux-2.4.31-pre2/include/asm-x86_64/hw_irq.h	2005-05-12 12:18:27.426354592 +0000
@@ -156,7 +156,7 @@ static inline void x86_do_profile (unsig
 	atomic_inc((atomic_t *)&prof_buffer[eip]);
 }
 
-#ifdef CONFIG_SMP /*more of this file should probably be ifdefed SMP */
+#ifdef CONFIG_X86_IO_APIC
 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {
 	if (IO_APIC_IRQ(i))
 		send_IPI_self(IO_APIC_VECTOR(i));
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/include/asm-x86_64/mmu_context.h linux-2.4.31-pre2/include/asm-x86_64/mmu_context.h
--- linux-2.4.30/include/asm-x86_64/mmu_context.h	2002-11-28 23:53:15.000000000 +0000
+++ linux-2.4.31-pre2/include/asm-x86_64/mmu_context.h	2005-05-12 12:16:23.461200160 +0000
@@ -60,9 +60,11 @@ static inline void switch_mm(struct mm_s
 			out_of_line_bug();
 		if(!test_and_set_bit(cpu, &next->cpu_vm_mask)) {
 			/* We were in lazy tlb mode and leave_mm disabled 
-			 * tlb flush IPI delivery. We must flush our tlb.
+			 * tlb flush IPI delivery. We must reload the page 
+			 * table.
 			 */
-			local_flush_tlb();
+			*read_pda(level4_pgt) = __pa(next->pgd) | _PAGE_TABLE;
+			__flush_tlb();
 		}
 		if (!test_and_set_bit(cpu, &next->context.cpuvalid))
 			load_LDT(next);
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/include/asm-x86_64/unistd.h linux-2.4.31-pre2/include/asm-x86_64/unistd.h
--- linux-2.4.30/include/asm-x86_64/unistd.h	2004-11-17 11:54:22.000000000 +0000
+++ linux-2.4.31-pre2/include/asm-x86_64/unistd.h	2005-05-12 12:18:24.100860144 +0000
@@ -673,7 +673,7 @@ static inline long close(unsigned int fd
 }
 
 extern long sys_exit(int) __attribute__((noreturn));
-static inline void exit(int error_code)
+extern inline void exit(int error_code)
 {
 	sys_exit(error_code);
 }
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/include/linux/i2c.h linux-2.4.31-pre2/include/linux/i2c.h
--- linux-2.4.30/include/linux/i2c.h	2005-01-19 14:10:12.000000000 +0000
+++ linux-2.4.31-pre2/include/linux/i2c.h	2005-05-12 12:16:36.810170808 +0000
@@ -193,7 +193,7 @@ struct i2c_algorithm {
 	char name[32];				/* textual description 	*/
 	unsigned int id;
 
-	/* If an adapter algorithm can't to I2C-level access, set master_xfer
+	/* If an adapter algorithm can't do I2C-level access, set master_xfer
 	   to NULL. If an adapter algorithm can do SMBus access, set 
 	   smbus_xfer. If set to NULL, the SMBus protocol is simulated
 	   using common I2C messages */
@@ -390,23 +390,23 @@ struct i2c_msg {
 #define I2C_FUNC_SMBUS_READ_I2C_BLOCK	0x04000000 /* New I2C-like block */
 #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK	0x08000000 /* transfer */
 
-#define I2C_FUNC_SMBUS_BYTE I2C_FUNC_SMBUS_READ_BYTE | \
-                            I2C_FUNC_SMBUS_WRITE_BYTE
-#define I2C_FUNC_SMBUS_BYTE_DATA I2C_FUNC_SMBUS_READ_BYTE_DATA | \
-                                 I2C_FUNC_SMBUS_WRITE_BYTE_DATA
-#define I2C_FUNC_SMBUS_WORD_DATA I2C_FUNC_SMBUS_READ_WORD_DATA | \
-                                 I2C_FUNC_SMBUS_WRITE_WORD_DATA
-#define I2C_FUNC_SMBUS_BLOCK_DATA I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
-                                  I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
-#define I2C_FUNC_SMBUS_I2C_BLOCK I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
-                                  I2C_FUNC_SMBUS_WRITE_I2C_BLOCK
-
-#define I2C_FUNC_SMBUS_EMUL I2C_FUNC_SMBUS_QUICK | \
-                            I2C_FUNC_SMBUS_BYTE | \
-                            I2C_FUNC_SMBUS_BYTE_DATA | \
-                            I2C_FUNC_SMBUS_WORD_DATA | \
-                            I2C_FUNC_SMBUS_PROC_CALL | \
-                            I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
+#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
+                             I2C_FUNC_SMBUS_WRITE_BYTE)
+#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \
+                                  I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
+#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \
+                                  I2C_FUNC_SMBUS_WRITE_WORD_DATA)
+#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
+                                   I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
+#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \
+                                  I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
+
+#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
+                             I2C_FUNC_SMBUS_BYTE | \
+                             I2C_FUNC_SMBUS_BYTE_DATA | \
+                             I2C_FUNC_SMBUS_WORD_DATA | \
+                             I2C_FUNC_SMBUS_PROC_CALL | \
+                             I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
 
 /* 
  * Data for SMBus Messages 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/lib/rwsem-spinlock.c linux-2.4.31-pre2/lib/rwsem-spinlock.c
--- linux-2.4.30/lib/rwsem-spinlock.c	2005-01-19 14:10:13.000000000 +0000
+++ linux-2.4.31-pre2/lib/rwsem-spinlock.c	2005-05-12 12:16:31.180026720 +0000
@@ -127,12 +127,12 @@ void fastcall __down_read(struct rw_sema
 
 	rwsemtrace(sem,"Entering __down_read");
 
-	spin_lock(&sem->wait_lock);
+	spin_lock_irq(&sem->wait_lock);
 
 	if (sem->activity>=0 && list_empty(&sem->wait_list)) {
 		/* granted */
 		sem->activity++;
-		spin_unlock(&sem->wait_lock);
+		spin_unlock_irq(&sem->wait_lock);
 		goto out;
 	}
 
@@ -147,7 +147,7 @@ void fastcall __down_read(struct rw_sema
 	list_add_tail(&waiter.list,&sem->wait_list);
 
 	/* we don't need to touch the semaphore struct anymore */
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irq(&sem->wait_lock);
 
 	/* wait to be given the lock */
 	for (;;) {
@@ -169,9 +169,10 @@ void fastcall __down_read(struct rw_sema
 int fastcall __down_read_trylock(struct rw_semaphore *sem)
 {
 	int ret = 0;
+	unsigned long flags;
 	rwsemtrace(sem,"Entering __down_read_trylock");
 
-	spin_lock(&sem->wait_lock);
+	spin_lock_irqsave(&sem->wait_lock, flags);
 
 	if (sem->activity>=0 && list_empty(&sem->wait_list)) {
 		/* granted */
@@ -179,7 +180,7 @@ int fastcall __down_read_trylock(struct 
 		ret = 1;
 	}
 
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irqrestore(&sem->wait_lock, flags);
 
 	rwsemtrace(sem,"Leaving __down_read_trylock");
 	return ret;
@@ -196,12 +197,12 @@ void fastcall __down_write(struct rw_sem
 
 	rwsemtrace(sem,"Entering __down_write");
 
-	spin_lock(&sem->wait_lock);
+	spin_lock_irq(&sem->wait_lock);
 
 	if (sem->activity==0 && list_empty(&sem->wait_list)) {
 		/* granted */
 		sem->activity = -1;
-		spin_unlock(&sem->wait_lock);
+		spin_unlock_irq(&sem->wait_lock);
 		goto out;
 	}
 
@@ -216,7 +217,7 @@ void fastcall __down_write(struct rw_sem
 	list_add_tail(&waiter.list,&sem->wait_list);
 
 	/* we don't need to touch the semaphore struct anymore */
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irq(&sem->wait_lock);
 
 	/* wait to be given the lock */
 	for (;;) {
@@ -238,9 +239,10 @@ void fastcall __down_write(struct rw_sem
 int fastcall __down_write_trylock(struct rw_semaphore *sem)
 {
 	int ret = 0;
+	unsigned long flags;
 	rwsemtrace(sem,"Entering __down_write_trylock");
 
-	spin_lock(&sem->wait_lock);
+	spin_lock_irqsave(&sem->wait_lock, flags);
 
 	if (sem->activity==0 && list_empty(&sem->wait_list)) {
 		/* granted */
@@ -248,7 +250,7 @@ int fastcall __down_write_trylock(struct
 		ret = 1;
 	}
 
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irqrestore(&sem->wait_lock, flags);
 
 	rwsemtrace(sem,"Leaving __down_write_trylock");
 	return ret;
@@ -259,14 +261,15 @@ int fastcall __down_write_trylock(struct
  */
 void fastcall __up_read(struct rw_semaphore *sem)
 {
+	unsigned long flags;
 	rwsemtrace(sem,"Entering __up_read");
 
-	spin_lock(&sem->wait_lock);
+	spin_lock_irqsave(&sem->wait_lock, flags);
 
 	if (--sem->activity==0 && !list_empty(&sem->wait_list))
 		sem = __rwsem_wake_one_writer(sem);
 
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irqrestore(&sem->wait_lock, flags);
 
 	rwsemtrace(sem,"Leaving __up_read");
 }
@@ -276,15 +279,16 @@ void fastcall __up_read(struct rw_semaph
  */
 void fastcall __up_write(struct rw_semaphore *sem)
 {
+	unsigned long flags;
 	rwsemtrace(sem,"Entering __up_write");
 
-	spin_lock(&sem->wait_lock);
+	spin_lock_irqsave(&sem->wait_lock, flags);
 
 	sem->activity = 0;
 	if (!list_empty(&sem->wait_list))
 		sem = __rwsem_do_wake(sem);
 
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irqrestore(&sem->wait_lock, flags);
 
 	rwsemtrace(sem,"Leaving __up_write");
 }
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/lib/rwsem.c linux-2.4.31-pre2/lib/rwsem.c
--- linux-2.4.30/lib/rwsem.c	2004-11-17 11:54:22.000000000 +0000
+++ linux-2.4.31-pre2/lib/rwsem.c	2005-05-12 12:16:13.073779288 +0000
@@ -127,7 +127,7 @@ static inline struct rw_semaphore *rwsem
 	set_task_state(tsk,TASK_UNINTERRUPTIBLE);
 
 	/* set up my own style of waitqueue */
-	spin_lock(&sem->wait_lock);
+	spin_lock_irq(&sem->wait_lock);
 	waiter->task = tsk;
 	get_task_struct(tsk);
 
@@ -142,7 +142,7 @@ static inline struct rw_semaphore *rwsem
 	if (!(count & RWSEM_ACTIVE_MASK))
 		sem = __rwsem_do_wake(sem);
 
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irq(&sem->wait_lock);
 
 	/* wait to be given the lock */
 	for (;;) {
@@ -195,15 +195,16 @@ struct rw_semaphore fastcall *rwsem_down
  */
 struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
 {
+	unsigned long flags;
 	rwsemtrace(sem,"Entering rwsem_wake");
 
-	spin_lock(&sem->wait_lock);
+	spin_lock_irqsave(&sem->wait_lock, flags);
 
 	/* do nothing if list empty */
 	if (!list_empty(&sem->wait_list))
 		sem = __rwsem_do_wake(sem);
 
-	spin_unlock(&sem->wait_lock);
+	spin_unlock_irqrestore(&sem->wait_lock, flags);
 
 	rwsemtrace(sem,"Leaving rwsem_wake");
 
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/mm/filemap.c linux-2.4.31-pre2/mm/filemap.c
--- linux-2.4.30/mm/filemap.c	2005-04-04 01:42:20.000000000 +0000
+++ linux-2.4.31-pre2/mm/filemap.c	2005-05-12 12:17:10.495049928 +0000
@@ -2605,6 +2605,8 @@ static long madvise_willneed(struct vm_a
 		end = vma->vm_end;
 	end = ((end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
 
+	error = -EIO;
+
 	/* round to cluster boundaries if this isn't a "random" area. */
 	if (!VM_RandomReadHint(vma)) {
 		start = CLUSTER_OFFSET(start);
diff -Naur -p -X /home/marcelo/lib/dontdiff linux-2.4.30/net/netlink/af_netlink.c linux-2.4.31-pre2/net/netlink/af_netlink.c
--- linux-2.4.30/net/netlink/af_netlink.c	2005-04-04 01:42:20.000000000 +0000
+++ linux-2.4.31-pre2/net/netlink/af_netlink.c	2005-05-12 12:17:41.514334280 +0000
@@ -980,9 +980,11 @@ static int netlink_dump(struct sock *sk)
 	len = cb->dump(skb, cb);
 
 	if (len > 0) {
+		sock_hold(sk);
 		spin_unlock(&sk->protinfo.af_netlink->cb_lock);
 		skb_queue_tail(&sk->receive_queue, skb);
 		sk->data_ready(sk, len);
+		sock_put(sk);
 		return 0;
 	}
 
