-
Notifications
You must be signed in to change notification settings - Fork 2
/
ASMedia-usb3-to-sata-bridges-quirks.txt
50 lines (45 loc) · 2.57 KB
/
ASMedia-usb3-to-sata-bridges-quirks.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Hans de Goede 2015-06-11 08:08:01 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1230336
Josh, I'm afraid it is not as simple as adding a quirk, the asmedia usb3<->sata bridges are very populair, and only the first generation has issues.
Unfortunately one usb-id is used for all generations, so we have this beautiful code in the kernel to figure out what to do:
/*
* ASMedia has a number of usb3 to sata bridge chips, at the time of
* this writing the following versions exist:
* ASM1051 - no uas support version
* ASM1051 - with broken (*) uas support
* ASM1053 - with working uas support, but problems with large xfers
* ASM1153 - with working uas support
*
* Devices with these chips re-use a number of device-ids over the
* entire line, so the device-id is useless to determine if we're
* dealing with an ASM1051 (which we want to avoid).
*
* The ASM1153 can be identified by config.MaxPower == 0,
* where as the ASM105x models have config.MaxPower == 36.
*
* Differentiating between the ASM1053 and ASM1051 is trickier, when
* connected over USB-3 we can look at the number of streams supported,
* ASM1051 supports 32 streams, where as early ASM1053 versions support
* 16 streams, newer ASM1053-s also support 32 streams, but have a
* different prod-id.
*
* (*) ASM1051 chips do work with UAS with some disks (with the
* US_FL_NO_REPORT_OPCODES quirk), but are broken with other disks
*/
if (le16_to_cpu(udev->descriptor.idVendor) == 0x174c &&
(le16_to_cpu(udev->descriptor.idProduct) == 0x5106 ||
le16_to_cpu(udev->descriptor.idProduct) == 0x55aa)) {
if (udev->actconfig->desc.bMaxPower == 0) {
/* ASM1153, do nothing */
} else 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) {
/* Possibly an ASM1051, disable uas */
flags |= US_FL_IGNORE_UAS;
} else {
/* ASM1053, these have issues with large transfers */
flags |= US_FL_MAX_SECTORS_240;
}
}
Note that this already checks for the usb-id used by the reporter's device.