## Automatically generated incremental diff
## From:   linux-2.4.29-bk3
## To:     linux-2.4.29-bk4
## Robot:  $Id: make-incremental-diff,v 1.12 2004/01/06 07:19:36 hpa Exp $

diff -urN linux-2.4.29-bk3/Makefile linux-2.4.29-bk4/Makefile
--- linux-2.4.29-bk3/Makefile	2005-01-28 02:50:25.631888224 -0800
+++ linux-2.4.29-bk4/Makefile	2005-01-28 02:50:28.242002512 -0800
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 29
-EXTRAVERSION = -bk3
+EXTRAVERSION = -bk4
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.29-bk3/drivers/md/lvm-snap.c linux-2.4.29-bk4/drivers/md/lvm-snap.c
--- linux-2.4.29-bk3/drivers/md/lvm-snap.c	2004-04-14 06:05:30.000000000 -0700
+++ linux-2.4.29-bk4/drivers/md/lvm-snap.c	2005-01-28 02:50:28.245002643 -0800
@@ -119,7 +119,6 @@
 	unsigned long mask = lv->lv_snapshot_hash_mask;
 	int chunk_size = lv->lv_chunk_size;
 	lv_block_exception_t *ret;
-	int i = 0;
 
 	hash_table =
 	    &hash_table[hashfn(org_dev, org_start, mask, chunk_size)];
@@ -132,15 +131,9 @@
 		exception = list_entry(next, lv_block_exception_t, hash);
 		if (exception->rsector_org == org_start &&
 		    exception->rdev_org == org_dev) {
-			if (i) {
-				/* fun, isn't it? :) */
-				list_del(next);
-				list_add(next, hash_table);
-			}
 			ret = exception;
 			break;
 		}
-		i++;
 	}
 	return ret;
 }
diff -urN linux-2.4.29-bk3/drivers/usb/hiddev.c linux-2.4.29-bk4/drivers/usb/hiddev.c
--- linux-2.4.29-bk3/drivers/usb/hiddev.c	2004-08-07 16:26:05.000000000 -0700
+++ linux-2.4.29-bk4/drivers/usb/hiddev.c	2005-01-28 02:50:28.246002687 -0800
@@ -328,6 +328,7 @@
 				}
 				
 				schedule();
+				set_current_state(TASK_INTERRUPTIBLE);
 			}
 
 			set_current_state(TASK_RUNNING);
diff -urN linux-2.4.29-bk3/drivers/usb/storage/transport.c linux-2.4.29-bk4/drivers/usb/storage/transport.c
--- linux-2.4.29-bk3/drivers/usb/storage/transport.c	2004-11-17 03:54:21.000000000 -0800
+++ linux-2.4.29-bk4/drivers/usb/storage/transport.c	2005-01-28 02:50:28.247002731 -0800
@@ -1181,6 +1181,13 @@
 
 	/* if the command transfered well, then we go to the data stage */
 	if (result == 0) {
+
+		/* Genesys Logic interface chips need a 100us delay between
+		 * the command phase and the data phase.  Some systems need
+		 * even more, probably because of clock rate inaccuracies. */
+		if (us->pusb_dev->descriptor.idVendor == USB_VENDOR_ID_GENESYS)
+			udelay(110);
+
 		/* send/receive data payload, if there is any */
 		if (bcb->DataTransferLength) {
 			usb_stor_transfer(srb, us);
diff -urN linux-2.4.29-bk3/drivers/usb/storage/usb.c linux-2.4.29-bk4/drivers/usb/storage/usb.c
--- linux-2.4.29-bk3/drivers/usb/storage/usb.c	2004-11-17 03:54:21.000000000 -0800
+++ linux-2.4.29-bk4/drivers/usb/storage/usb.c	2005-01-28 02:50:28.248002775 -0800
@@ -996,6 +996,15 @@
 		 */
 		ss->htmplt.proc_dir = (void *)ss; 
 
+		/* According to the technical support people at Genesys Logic,
+		 * devices using their chips have problems transferring more
+		 * than 32 KB at a time.  In practice people have found that
+		 * 64 KB works okay and that's what Windows does.  But we'll
+		 * be conservative.
+		 */
+		if (ss->pusb_dev->descriptor.idVendor == USB_VENDOR_ID_GENESYS)
+			ss->htmplt.max_sectors = 64;
+
 		/* Just before we start our control thread, initialize
 		 * the device if it needs initialization */
 		if (unusual_dev && unusual_dev->initFunction)
diff -urN linux-2.4.29-bk3/drivers/usb/storage/usb.h linux-2.4.29-bk4/drivers/usb/storage/usb.h
--- linux-2.4.29-bk3/drivers/usb/storage/usb.h	2004-08-07 16:26:05.000000000 -0700
+++ linux-2.4.29-bk4/drivers/usb/storage/usb.h	2005-01-28 02:50:28.249002819 -0800
@@ -193,4 +193,7 @@
 /* Function to fill an inquiry response. See usb.c for details */
 extern void fill_inquiry_response(struct us_data *us,
 	unsigned char *data, unsigned int data_len);
+
+/* Vendor ID list for devices that require special handling */
+#define USB_VENDOR_ID_GENESYS		0x05e3	/* Genesys Logic */
 #endif
diff -urN linux-2.4.29-bk3/mm/filemap.c linux-2.4.29-bk4/mm/filemap.c
--- linux-2.4.29-bk3/mm/filemap.c	2004-11-17 03:54:22.000000000 -0800
+++ linux-2.4.29-bk4/mm/filemap.c	2005-01-28 02:50:28.253002994 -0800
@@ -2609,6 +2609,9 @@
 	error = -EIO;
 	rlim_rss = current->rlim ?  current->rlim[RLIMIT_RSS].rlim_cur :
 				LONG_MAX; /* default: see resource.h */
+
+	rlim_rss = (rlim_rss & PAGE_MASK) >> PAGE_SHIFT;
+
 	if ((vma->vm_mm->rss + (end - start)) > rlim_rss)
 		return error;
 
