linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / usb / storage / scsiglue.c
index a4b7df9..4ef5527 100644 (file)
@@ -47,7 +47,6 @@
 
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <linux/mutex.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
@@ -112,11 +111,13 @@ static int slave_configure(struct scsi_device *sdev)
        if (sdev->scsi_level < SCSI_2)
                sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;
 
-       /* Many devices have trouble transfering more than 32KB at a time,
-        * while others have trouble with more than 64K. At this time we
-        * are limiting both to 32K (64 sectores).
-        */
-       if ((us->flags & US_FL_MAX_SECTORS_64) &&
+       /* 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; people can always use the sysfs interface to
+        * increase max_sectors. */
+       if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == USB_VENDOR_ID_GENESYS &&
                        sdev->request_queue->max_sectors > 64)
                blk_queue_max_sectors(sdev->request_queue, 64);
 
@@ -270,9 +271,9 @@ static int device_reset(struct scsi_cmnd *srb)
        US_DEBUGP("%s called\n", __FUNCTION__);
 
        /* lock the device pointers and do the reset */
-       mutex_lock(&(us->dev_mutex));
+       down(&(us->dev_semaphore));
        result = us->transport_reset(us);
-       mutex_unlock(&us->dev_mutex);
+       up(&(us->dev_semaphore));
 
        return result < 0 ? FAILED : SUCCESS;
 }
@@ -284,7 +285,11 @@ static int bus_reset(struct scsi_cmnd *srb)
        int result;
 
        US_DEBUGP("%s called\n", __FUNCTION__);
+
+       down(&(us->dev_semaphore));
        result = usb_stor_port_reset(us);
+       up(&(us->dev_semaphore));
+
        return result < 0 ? FAILED : SUCCESS;
 }