diff options
author | Nicolas Boichat <drinkcat@google.com> | 2017-04-25 11:58:18 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-02 20:24:17 -0700 |
commit | 520bd3f6ad2098e6969dd353350e2e2281f28989 (patch) | |
tree | 3df6052d988c8024b2c31904c534d29f3e3e108e /driver | |
parent | c388d3e27877c1e3b1b2f078cd320d604509087d (diff) | |
download | chrome-ec-520bd3f6ad2098e6969dd353350e2e2281f28989.tar.gz |
chip/stm32/usb: More reliable implementation of usb_wake
Current usb_wake was sleeping between setting and clearing RESUME
bit, which is unprecise.
Instead, we count ESOF interrupts in usb_interrupt to detect when
to clear RESUME.
It is also important that usb_wake does not block, as the calling
task (e.g. keyboard scanning) must continue to service events while
the USB device is resuming.
BRANCH=none
BUG=b:35587173
TEST=Connect hammer, force autosuspend using:
DEVICE=$(dirname $(grep 5022 /sys/bus/usb/devices/*/idProduct))
echo 500 > $DEVICE/power/autosuspend_delay_ms
echo auto > $DEVICE/power/control
Wait a second, type something quickly, verify that no keys are lost.
Change-Id: I53b46cce5a4adb0ee4c4a7e9f935c00f7f321636
Reviewed-on: https://chromium-review.googlesource.com/490129
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'driver')
0 files changed, 0 insertions, 0 deletions