Commit 932bb668bb2464115f2d08abbed44e58cfce9536

Authored by Bin Meng
Committed by Marek Vasut
1 parent c008faa773

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

... ... @@ -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