diff options
author | Mary Ruthven <mruthven@chromium.org> | 2022-09-13 11:31:05 -0500 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-05 01:51:05 +0000 |
commit | 1c9f5e8f0c0657ca9ac7cd1614c9c15d72527216 (patch) | |
tree | 2081c32bf450cdc63940de8faf2f7bc825521c12 /chip/g | |
parent | 0a17edcc6e9ea7522491a342fd5fc0a13fdc55ac (diff) | |
download | chrome-ec-1c9f5e8f0c0657ca9ac7cd1614c9c15d72527216.tar.gz |
rdd: fix rddkeepalive disable
After `rddkeepalive disable` ccd doesn't disconnect even if suzyq is
disconnected. It stays connected and the rdd_connect deferred call
constantly wakes cr50. This change fixes rddkeepalive. It cancels any
pending rdd_connect call and calls rdd_interrupt, so cr50 will start
using the actual rdd state.
BUG=b:186242173
TEST=manual
# Verify rddkeepalive works when suzyq is disconnected. After
# keepalive is disabled, cr50 enters sleep normally.
# Disconnect suzyq.
> rddkeepalive enable
Forcing Rdd detect keepalive
> [39.850055 Rdd connect]
[40.163909 CCD EXT enable]
[40.164722 USB PHY B]
[40.165802 CCD state: UARTAP UARTEC USBEC+TX]
>
> ccdstate
...
Rdd: connected
KeepAlive: enabled
...
> rddkeepalive disable
Using actual Rdd state
> [45.590282 Rdd disconnect]
[46.165451 CCD EXT disable]
[46.166255 CCD state:]
>
> ccdstate
...
Rdd: disconnected
KeepAlive: disabled
...
> 10- <==== Cycles twice a second.
# Verify rddkeepalive works when suzyq is connected. After
# keepalive is disabled, USB stays connected. There are no
# usb messages.
# Connect suzyq.
[211.541210 usb_reset, status 1028]
[211.601188 AC: R-]
[211.629741 SETAD 0x1a (26)]
>
> ccdstate
...
Rdd: connected
KeepAlive: disabled
...
> rddkeepalive ena
Forcing Rdd detect keepalive
> rddkeepalive dis
Using actual Rdd state
>
> ccdstate
...
Servo: connected
Rdd: connected
...
>
Change-Id: I5b55a84928aaef49c57f1512fcc886411b3fc118
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3894392
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
(cherry picked from commit 0bfa5127e984b7ec0760d98f98fbcaea96b22b61)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3929214
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
(cherry picked from commit 6809d15a3b01c132b2c9479bdab658a13f510a1c)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935295
Diffstat (limited to 'chip/g')
-rw-r--r-- | chip/g/rdd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chip/g/rdd.c b/chip/g/rdd.c index 9e7395639f..7620e55a49 100644 --- a/chip/g/rdd.c +++ b/chip/g/rdd.c @@ -245,6 +245,12 @@ static int command_rdd_keepalive(int argc, char **argv) /* Go back to actual hardware state */ ccprintf("Using actual Rdd state\n"); ccd_set_flag(CCD_FLAG_RDDKEEPALIVE_AT_BOOT, 0); + /* + * Cancel rdd_connect and call rdd_interrupt to use the + * actual state. + */ + hook_call_deferred(&rdd_connect_data, -1); + rdd_interrupt(); } return EC_SUCCESS; |