USB: uas: Add a new NO_REPORT_LUNS quirk
authorHans de Goede <hdegoede@redhat.com>
Tue, 12 Apr 2016 10:27:09 +0000 (12:27 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 15 Jun 2016 20:28:11 +0000 (21:28 +0100)
commit 1363074667a6b7d0507527742ccd7bbed5e3ceaa upstream.

Add a new NO_REPORT_LUNS quirk and set it for Seagate drives with
an usb-id of: 0bc2:331a, as these will fail to respond to a
REPORT_LUNS command.

Reported-and-tested-by: David Webb <djw@noc.ac.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2:
 - Adjust context
 - Drop the UAS changes]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Documentation/kernel-parameters.txt
drivers/usb/storage/usb.c
include/linux/usb_usual.h

index f0001eb..ac601c4 100644 (file)
@@ -2699,6 +2699,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                                        sector if the number is odd);
                                i = IGNORE_DEVICE (don't bind to this
                                        device);
                                        sector if the number is odd);
                                i = IGNORE_DEVICE (don't bind to this
                                        device);
+                               j = NO_REPORT_LUNS (don't use report luns
+                                       command, uas only);
                                l = NOT_LOCKABLE (don't try to lock and
                                        unlock ejectable media);
                                m = MAX_SECTORS_64 (don't transfer more
                                l = NOT_LOCKABLE (don't try to lock and
                                        unlock ejectable media);
                                m = MAX_SECTORS_64 (don't transfer more
index d582af4..d281742 100644 (file)
@@ -453,7 +453,7 @@ static void adjust_quirks(struct us_data *us)
                        US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE |
                        US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT |
                        US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 |
                        US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE |
                        US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT |
                        US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 |
-                       US_FL_INITIAL_READ10);
+                       US_FL_INITIAL_READ10 | US_FL_NO_REPORT_LUNS);
 
        p = quirks;
        while (*p) {
 
        p = quirks;
        while (*p) {
@@ -497,6 +497,9 @@ static void adjust_quirks(struct us_data *us)
                case 'i':
                        f |= US_FL_IGNORE_DEVICE;
                        break;
                case 'i':
                        f |= US_FL_IGNORE_DEVICE;
                        break;
+               case 'j':
+                       f |= US_FL_NO_REPORT_LUNS;
+                       break;
                case 'l':
                        f |= US_FL_NOT_LOCKABLE;
                        break;
                case 'l':
                        f |= US_FL_NOT_LOCKABLE;
                        break;
index 88413e9..a3d6fac 100644 (file)
@@ -67,6 +67,8 @@
                /* Initial READ(10) (and others) must be retried */ \
        US_FLAG(BROKEN_FUA,     0x01000000)                     \
                /* Cannot handle FUA in WRITE or READ CDBs */   \
                /* Initial READ(10) (and others) must be retried */ \
        US_FLAG(BROKEN_FUA,     0x01000000)                     \
                /* Cannot handle FUA in WRITE or READ CDBs */   \
+       US_FLAG(NO_REPORT_LUNS, 0x10000000)                     \
+               /* Cannot handle REPORT_LUNS */                 \
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };