]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.16-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Oct 2014 15:36:45 +0000 (08:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Oct 2014 15:36:45 +0000 (08:36 -0700)
added patches:
uas-add-missing-le16_to_cpu-calls-to-asm1051-asm1053-usb-id-check.patch
uas-disable-uas-on-asm1051-devices.patch

queue-3.16/series
queue-3.16/uas-add-missing-le16_to_cpu-calls-to-asm1051-asm1053-usb-id-check.patch [new file with mode: 0644]
queue-3.16/uas-disable-uas-on-asm1051-devices.patch [new file with mode: 0644]

index 1bb2c035df1846afa2cf9c0e0bfbbf436374eccf..1c58f1276615404cefcced2e4c3fb292a280e46f 100644 (file)
@@ -16,5 +16,7 @@ init-kconfig-fix-have_futex_cmpxchg-to-not-break-up-the-expert-menu.patch
 ring-buffer-fix-infinite-spin-in-reading-buffer.patch
 uas-only-complain-about-missing-sg-if-all-other-checks-succeed.patch
 uas-log-a-warning-when-we-cannot-use-uas-because-the-hcd-lacks-streams.patch
+uas-disable-uas-on-asm1051-devices.patch
+uas-add-missing-le16_to_cpu-calls-to-asm1051-asm1053-usb-id-check.patch
 x86-ia64-move-efi_fb-vga_default_device-initialization-to-pci_vga_fixup.patch
 vgaarb-don-t-default-exclusively-to-first-video-device-with-mem-io.patch
diff --git a/queue-3.16/uas-add-missing-le16_to_cpu-calls-to-asm1051-asm1053-usb-id-check.patch b/queue-3.16/uas-add-missing-le16_to_cpu-calls-to-asm1051-asm1053-usb-id-check.patch
new file mode 100644 (file)
index 0000000..ff6eeeb
--- /dev/null
@@ -0,0 +1,30 @@
+From a79e5bc53a9519202dfad7d916761601fcbf8db1 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Thu, 11 Sep 2014 11:06:12 +0200
+Subject: uas: Add missing le16_to_cpu calls to asm1051 / asm1053 usb-id check
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit a79e5bc53a9519202dfad7d916761601fcbf8db1 upstream.
+
+Reported-by: kbuild test robot <fengguang.wu@intel.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/storage/uas-detect.h |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/storage/uas-detect.h
++++ b/drivers/usb/storage/uas-detect.h
+@@ -73,8 +73,8 @@ static int uas_use_uas_driver(struct usb
+        * broken on the ASM1051, use the number of streams to differentiate.
+        * New ASM1053-s also support 32 streams, but have a different prod-id.
+        */
+-      if (udev->descriptor.idVendor == 0x174c &&
+-                      udev->descriptor.idProduct == 0x55aa) {
++      if (le16_to_cpu(udev->descriptor.idVendor) == 0x174c &&
++                      le16_to_cpu(udev->descriptor.idProduct) == 0x55aa) {
+               if (udev->speed < USB_SPEED_SUPER) {
+                       /* No streams info, assume ASM1051 */
+                       flags |= US_FL_IGNORE_UAS;
diff --git a/queue-3.16/uas-disable-uas-on-asm1051-devices.patch b/queue-3.16/uas-disable-uas-on-asm1051-devices.patch
new file mode 100644 (file)
index 0000000..372acfa
--- /dev/null
@@ -0,0 +1,83 @@
+From a9c54caa456dccba938005f6479892b589975e6a Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Wed, 10 Sep 2014 10:51:36 +0200
+Subject: uas: Disable uas on ASM1051 devices
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit a9c54caa456dccba938005f6479892b589975e6a upstream.
+
+There are a large numbers of issues with ASM1051 devices in uas mode:
+
+1) They do not support REPORT SUPPORTED OPERATION CODES
+
+2) They use out of spec 8 byte status iu-s when they have no sense data,
+   switching to normal 16 byte status iu-s when they do have sense data.
+
+3) They hang / crash when combined with some disks, e.g. a Crucial M500 ssd.
+
+4) They hang / crash when stressed (through e.g. sg_reset --bus) with disks
+   with which then normally do work (once 1 & 2 are worked around).
+
+Where as in BOT mode they appear to work fine, so the best way forward with
+these devices is to just blacklist them for uas usage.
+
+Unfortunately this is easier said then done. as older versions of the ASM1053
+(which works fine) use the same usb-id as the ASM1051.
+
+When connected over USB-3 the 2 can be told apart by the number of streams
+they support. So this patch adds some less then pretty code to disable uas for
+the ASM1051. When connected over USB-2, simply disable uas alltogether for
+devices with the shared usb-id.
+
+Cc: stable@vger.kernel.org # 3.16
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/storage/uas-detect.h |   27 +++++++++++++++++++++++----
+ 1 file changed, 23 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/storage/uas-detect.h
++++ b/drivers/usb/storage/uas-detect.h
+@@ -59,10 +59,6 @@ static int uas_use_uas_driver(struct usb
+       unsigned long flags = id->driver_info;
+       int r, alt;
+-      usb_stor_adjust_quirks(udev, &flags);
+-
+-      if (flags & US_FL_IGNORE_UAS)
+-              return 0;
+       alt = uas_find_uas_alt_setting(intf);
+       if (alt < 0)
+@@ -72,6 +68,29 @@ static int uas_use_uas_driver(struct usb
+       if (r < 0)
+               return 0;
++      /*
++       * ASM1051 and older ASM1053 devices have the same usb-id, and UAS is
++       * broken on the ASM1051, use the number of streams to differentiate.
++       * New ASM1053-s also support 32 streams, but have a different prod-id.
++       */
++      if (udev->descriptor.idVendor == 0x174c &&
++                      udev->descriptor.idProduct == 0x55aa) {
++              if (udev->speed < USB_SPEED_SUPER) {
++                      /* No streams info, assume ASM1051 */
++                      flags |= US_FL_IGNORE_UAS;
++              } else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) {
++                      flags |= US_FL_IGNORE_UAS;
++              }
++      }
++
++      usb_stor_adjust_quirks(udev, &flags);
++
++      if (flags & US_FL_IGNORE_UAS) {
++              dev_warn(&udev->dev,
++                      "UAS is blacklisted for this device, using usb-storage instead\n");
++              return 0;
++      }
++
+       if (udev->bus->sg_tablesize == 0) {
+               dev_warn(&udev->dev,
+                       "The driver for the USB controller %s does not support scatter-gather which is\n",