From 8d6da80f34cab49cd773e462d9720a210d4ce471 Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Thu, 10 Aug 2017 15:11:00 -0700 Subject: [PATCH] usb_pd_protocol: Req SNK Cap if not received yet. In the SRC_READY state, we'll only request sink caps if we haven't received them yet and only if its the first transition to the state. However, we also don't send any PD traffic in that state if there's an incoming message in order to prevent a collision. This could create a scenario where upon entry to the SRC_READY state, a message is incoming. When this occurs, we never request the sink caps. This commit simply removes the condition that we may only request sink caps on the first transition to the SRC_READY state. BUG=b:64037926 BRANCH=gru TEST=Flash kevin; Connect to a DR port partner; Verify that sink caps are requested even after the first transition to the SRC_READY state. Change-Id: I6bc9ad01d45e6584a7a14b28806ae4872a22d98f Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/611320 Commit-Ready: Aseda Aboagye Tested-by: Aseda Aboagye Reviewed-by: Shawn N --- common/usb_pd_protocol.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 0526aaaf65..a0dcff6e85 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -2162,8 +2162,7 @@ void pd_task(void *u) } /* Send get sink cap if haven't received it yet */ - if (pd[port].last_state != pd[port].task_state && - !(pd[port].flags & PD_FLAGS_SNK_CAP_RECVD)) { + if (!(pd[port].flags & PD_FLAGS_SNK_CAP_RECVD)) { if (++snk_cap_count <= PD_SNK_CAP_RETRIES) { /* Get sink cap to know if dual-role device */ send_control(port, PD_CTRL_GET_SINK_CAP);