Commit 932bb668bb2464115f2d08abbed44e58cfce9536
Committed by
Marek Vasut
1 parent
c008faa773
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
usb: Read device descriptor after device is addressed for xHCI
For xHCI it is not possible to read a device descriptor before it has been assigned an address. That's why usb_setup_descriptor() was called with 'do_read' being false. But we really need try to read the device descriptor before starting any real communication with the default control endpoint. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Showing 1 changed file with 11 additions and 0 deletions Side-by-side Diff
common/usb.c
... | ... | @@ -1052,6 +1052,17 @@ |
1052 | 1052 | |
1053 | 1053 | mdelay(10); /* Let the SET_ADDRESS settle */ |
1054 | 1054 | |
1055 | + /* | |
1056 | + * If we haven't read device descriptor before, read it here | |
1057 | + * after device is assigned an address. This is only applicable | |
1058 | + * to xHCI so far. | |
1059 | + */ | |
1060 | + if (!do_read) { | |
1061 | + err = usb_setup_descriptor(dev, true); | |
1062 | + if (err) | |
1063 | + return err; | |
1064 | + } | |
1065 | + | |
1055 | 1066 | return 0; |
1056 | 1067 | } |
1057 | 1068 |