]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
uas: Add no-report-opcodes quirk
authorHans de Goede <hdegoede@redhat.com>
Tue, 16 Sep 2014 16:36:52 +0000 (18:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 04:40:48 +0000 (21:40 -0700)
Besides the ASM1051 (*) needing sdev->no_report_opcodes = 1, it turns out that
the JMicron JMS567 also needs it to work properly with uas (usb-storage always
sets it). Since some of the scsi devs were not to keen on the idea to
outrightly set sdev->no_report_opcodes = 1 for all uas devices, so add a quirk
for this, and set it for the JMS567.

*) Which has become a non-issue since we've completely blacklisted uas on
the ASM1051 for other reasons

Cc: stable@vger.kernel.org
Reported-and-tested-by: Claudio Bizzarri <claudio.bizzarri@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/kernel-parameters.txt
drivers/usb/storage/uas.c
drivers/usb/storage/unusual_uas.h
drivers/usb/storage/usb.c
include/linux/usb_usual.h

index dd4fe9880e4a96aeb43cbef3494d056b12c4b346..1edd5fdc629d29d4b9ddbf650a86f285a457f71b 100644 (file)
@@ -3522,6 +3522,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                                        READ_DISC_INFO command);
                                e = NO_READ_CAPACITY_16 (don't use
                                        READ_CAPACITY_16 command);
+                               f = NO_REPORT_OPCODES (don't use report opcodes
+                                       command, uas only);
                                h = CAPACITY_HEURISTICS (decrease the
                                        reported device capacity by one
                                        sector if the number is odd);
index 8c7d4a239f4c238303e0cc2361e079026e0d382a..cad02ac88564657b1ea842f9cbefb57e6f90d7b7 100644 (file)
@@ -961,6 +961,10 @@ static int uas_slave_alloc(struct scsi_device *sdev)
 static int uas_slave_configure(struct scsi_device *sdev)
 {
        struct uas_dev_info *devinfo = sdev->hostdata;
+
+       if (devinfo->flags & US_FL_NO_REPORT_OPCODES)
+               sdev->no_report_opcodes = 1;
+
        scsi_set_tag_type(sdev, MSG_ORDERED_TAG);
        scsi_activate_tcq(sdev, devinfo->qdepth - 2);
        return 0;
index 3ff2dd4c78cafe46111e705736e0c40756660f15..3e6243719df82207df1f0189bcb5ad233e5dd02a 100644 (file)
@@ -53,3 +53,10 @@ UNUSUAL_DEV(0x0bc2, 0x3312, 0x0000, 0x9999,
                "Expansion Desk",
                USB_SC_DEVICE, USB_PR_DEVICE, NULL,
                US_FL_NO_ATA_1X),
+
+/* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */
+UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999,
+               "JMicron",
+               "JMS567",
+               USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+               US_FL_NO_REPORT_OPCODES),
index b9d1b9357287148071c2504a3814ea3fa74e85cf..f60e7d463636f3a34b7bea24e30788a487c85cc7 100644 (file)
@@ -479,7 +479,7 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)
                        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_WRITE_CACHE |
-                       US_FL_NO_ATA_1X);
+                       US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES);
 
        p = quirks;
        while (*p) {
@@ -517,6 +517,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)
                case 'e':
                        f |= US_FL_NO_READ_CAPACITY_16;
                        break;
+               case 'f':
+                       f |= US_FL_NO_REPORT_OPCODES;
+                       break;
                case 'h':
                        f |= US_FL_CAPACITY_HEURISTICS;
                        break;
index d271f88f30addd3e47fc139bc899371ca9fece85..a7f2604c5f25928938f2a55051f31f22ba469a49 100644 (file)
@@ -75,6 +75,8 @@
                /* Cannot handle FUA in WRITE or READ CDBs */   \
        US_FLAG(NO_ATA_1X,      0x02000000)                     \
                /* Cannot handle ATA_12 or ATA_16 CDBs */       \
+       US_FLAG(NO_REPORT_OPCODES,      0x04000000)             \
+               /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };