summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-08-10 15:11:00 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-08-15 00:56:08 +0000
commit09fc609f16a0195ec7b925b6cdc5fa3960c3dcf3 (patch)
tree1fd6a0809ee97903e296439af0b27775f718eeb5
parent444bf5e44a3764c1517c0e69a49153020213943e (diff)
downloadchrome-ec-09fc609f16a0195ec7b925b6cdc5fa3960c3dcf3.tar.gz
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: I714d12cf2eeabfa4b80b04bda257b3c38a29f162 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Original-Change-Id: I6bc9ad01d45e6584a7a14b28806ae4872a22d98f Original-Signed-off-by: Aseda Aboagye <aaboagye@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/611320 Original-Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Original-Tested-by: Aseda Aboagye <aaboagye@chromium.org> Original-Reviewed-by: Shawn N <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/615003 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--common/usb_pd_protocol.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 1fe111727b..42cc8b7a2a 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2118,8 +2118,7 @@ void pd_task(void)
}
/* 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);