summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-02-15 10:50:26 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-02-21 04:27:09 -0800
commit00ac58809990a041b0ffff442398008b4c4e0adf (patch)
tree1dad711dc01c71d05d81575cb356d6921a4ad7e9
parent53ca6cfbdf3a54d574f140a3eaf926eb80a53697 (diff)
downloadchrome-ec-00ac58809990a041b0ffff442398008b4c4e0adf.tar.gz
pd: retry DR_SWAP after a WAIT
If the other side answers our DR_SWAP request with a WAIT message (as bizarre as it might be), we want to retry later rather than giving up. Set again the PD_FLAGS_CHECK_DR_ROLE flag in order to do so. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=fizz BUG=chromium:814098 TEST=do repeated cold reset on Fizz connected to the 'interesting' USB-C screen and see the DP alternate mode negotiated. Change-Id: Icfb9fa209ce8cbe3c42c1e6946b43464544bdaea Reviewed-on: https://chromium-review.googlesource.com/921141 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org>
-rw-r--r--common/usb_pd_protocol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index dda616d4b7..89885c3e84 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1353,8 +1353,11 @@ static void handle_ctrl_request(int port, uint16_t head,
#endif
case PD_CTRL_REJECT:
case PD_CTRL_WAIT:
- if (pd[port].task_state == PD_STATE_DR_SWAP)
+ if (pd[port].task_state == PD_STATE_DR_SWAP) {
+ if (type == PD_CTRL_WAIT) /* try again ... */
+ pd[port].flags |= PD_FLAGS_CHECK_DR_ROLE;
set_state(port, READY_RETURN_STATE(port));
+ }
#ifdef CONFIG_USBC_VCONN_SWAP
else if (pd[port].task_state == PD_STATE_VCONN_SWAP_SEND)
set_state(port, READY_RETURN_STATE(port));