Skip to content

Commit

Permalink
usb gadget hal: Increase disconnect timeout
Browse files Browse the repository at this point in the history
Increase disconnect timeout from 10ms to 100ms for the host ports which
dont strictly adhere to the spec to sense disconnect.

This is a work around given that some of the root ports dont detect
it. From the USB 2.0 spec guidelines, the disconnect should be
detected in 2.5us.

From the USB 2.0 spec (pg 186)
Time to detect a disconnect event
at a hub’s downstream facing port
TDDIS Section 7.1.7.3 2 2.5 µs


Bug: 110412433
Test: Walleye entering accessory mode in USB 3.0 with IOGear cable
and USB 3.0 host.

Change-Id: I8d8f62dc1a7bcbc9c7727c51cad7f3cb07ba6b50
(cherry picked from commit 28ad0a9)
  • Loading branch information
Badhri Jagan Sridharan authored and android-build-team Robot committed Oct 5, 2018
1 parent eabf8fc commit 78ed42a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usb/UsbGadget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ constexpr int BUFFER_SIZE = 512;
constexpr int MAX_FILE_PATH_LENGTH = 256;
constexpr int EPOLL_EVENTS = 10;
constexpr bool DEBUG = false;
constexpr int DISCONNECT_WAIT_US = 10000;
constexpr int DISCONNECT_WAIT_US = 100000;

#define BUILD_TYPE "ro.build.type"
#define GADGET_PATH "/config/usb_gadget/g1/"
Expand Down

0 comments on commit 78ed42a

Please sign in to comment.