summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2022-09-13 11:31:05 -0500
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-14 03:18:44 +0000
commit0bfa5127e984b7ec0760d98f98fbcaea96b22b61 (patch)
tree9581520cdc93caa86c69fb5d7145966b39c61b3c
parent9e31a10eccea4ff5d757af2fc4e54be5a8816334 (diff)
downloadchrome-ec-0bfa5127e984b7ec0760d98f98fbcaea96b22b61.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>
-rw-r--r--chip/g/rdd.c6
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;