aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/uas-detect.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/storage/uas-detect.h')
-rw-r--r--drivers/usb/storage/uas-detect.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index 503ac5c8d80f..8a6f371ed6e7 100644
--- 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_interface *intf,
59 unsigned long flags = id->driver_info; 59 unsigned long flags = id->driver_info;
60 int r, alt; 60 int r, alt;
61 61
62 usb_stor_adjust_quirks(udev, &flags);
63
64 if (flags & US_FL_IGNORE_UAS)
65 return 0;
66 62
67 alt = uas_find_uas_alt_setting(intf); 63 alt = uas_find_uas_alt_setting(intf);
68 if (alt < 0) 64 if (alt < 0)
@@ -72,6 +68,29 @@ static int uas_use_uas_driver(struct usb_interface *intf,
72 if (r < 0) 68 if (r < 0)
73 return 0; 69 return 0;
74 70
71 /*
72 * ASM1051 and older ASM1053 devices have the same usb-id, and UAS is
73 * broken on the ASM1051, use the number of streams to differentiate.
74 * New ASM1053-s also support 32 streams, but have a different prod-id.
75 */
76 if (le16_to_cpu(udev->descriptor.idVendor) == 0x174c &&
77 le16_to_cpu(udev->descriptor.idProduct) == 0x55aa) {
78 if (udev->speed < USB_SPEED_SUPER) {
79 /* No streams info, assume ASM1051 */
80 flags |= US_FL_IGNORE_UAS;
81 } else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) {
82 flags |= US_FL_IGNORE_UAS;
83 }
84 }
85
86 usb_stor_adjust_quirks(udev, &flags);
87
88 if (flags & US_FL_IGNORE_UAS) {
89 dev_warn(&udev->dev,
90 "UAS is blacklisted for this device, using usb-storage instead\n");
91 return 0;
92 }
93
75 if (udev->bus->sg_tablesize == 0) { 94 if (udev->bus->sg_tablesize == 0) {
76 dev_warn(&udev->dev, 95 dev_warn(&udev->dev,
77 "The driver for the USB controller %s does not support scatter-gather which is\n", 96 "The driver for the USB controller %s does not support scatter-gather which is\n",