Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33abc04f0420dceed0ebc2d1094019d3bb2b5c29
Commit:     33abc04f0420dceed0ebc2d1094019d3bb2b5c29
Parent:     b9e13ac30f850313be9232497ff98e90c43bc6b6
Author:     Doug Maxey <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 5 23:36:45 2007 -0600
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Mon Dec 17 10:47:14 2007 -0800

    usb-storage: Fix devices that cannot handle 32k transfers
    
    When a device cannot handle the smallest previously limited transfer
    size (64 blocks) without stalling, limit the device to the amount of
    packets that fit in a platform native page.
    
    The lowest possible limit is PAGE_CACHE_SIZE, so if the device is ever
    used on a platform that has larger than 8K pages, you lose unless you
    can convince the device firmware folks to fix the issue.
    
    Cc: Mathew Dharm <[EMAIL PROTECTED]>
    Cc: Alan Stern <[EMAIL PROTECTED]>
    Cc: Pete Zaitcev <[EMAIL PROTECTED]>
    Signed-off-by: Doug Maxey <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/storage/scsiglue.c     |   12 +++++++++---
 drivers/usb/storage/unusual_devs.h |    7 +++++++
 include/linux/usb_usual.h          |    5 ++++-
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 836a34a..7c9593b 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -114,9 +114,15 @@ static int slave_configure(struct scsi_device *sdev)
         * 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) &&
-                       sdev->request_queue->max_sectors > 64)
-               blk_queue_max_sectors(sdev->request_queue, 64);
+       if (us->flags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) {
+               unsigned int max_sectors = 64;
+
+               if (us->flags & US_FL_MAX_SECTORS_MIN)
+                       max_sectors = PAGE_CACHE_SIZE >> 9;
+               if (sdev->request_queue->max_sectors > max_sectors)
+                       blk_queue_max_sectors(sdev->request_queue,
+                                             max_sectors);
+       }
 
        /* We can't put these settings in slave_alloc() because that gets
         * called before the device type is known.  Consequently these
diff --git a/drivers/usb/storage/unusual_devs.h 
b/drivers/usb/storage/unusual_devs.h
index 2c27721..7bbfd31 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -376,6 +376,13 @@ UNUSUAL_DEV(  0x04b0, 0x0417, 0x0100, 0x0100,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_CAPACITY),
 
+/* Reported by Doug Maxey ([EMAIL PROTECTED]) */
+UNUSUAL_DEV(  0x04b3, 0x4001, 0x0110, 0x0110,
+               "IBM",
+               "IBM RSA2",
+               US_SC_DEVICE, US_PR_CB, NULL,
+               US_FL_MAX_SECTORS_MIN),
+
 /* BENQ DC5330
  * Reported by Manuel Fombuena <[EMAIL PROTECTED]> and
  * Frank Copeland <[EMAIL PROTECTED]> */
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 1b792b9..a417b09 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -48,7 +48,10 @@
        US_FLAG(IGNORE_DEVICE,  0x00000800)                     \
                /* Don't claim device */                        \
        US_FLAG(CAPACITY_HEURISTICS,    0x00001000)             \
-               /* sometimes sizes is too big */
+               /* sometimes sizes is too big */                \
+       US_FLAG(MAX_SECTORS_MIN,0x00002000)                     \
+               /* Sets max_sectors to arch min */
+
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to