diff options
author | Todd Broch <tbroch@chromium.org> | 2014-12-11 15:57:53 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-22 21:50:00 +0000 |
commit | f993fe3c66fe55421a9dc6a87f582a7c826c3dab (patch) | |
tree | da31325b933b5796affb5b4d9609fde2f8917aa4 /board/hoho | |
parent | 4b6148c52604eff49920fd64021b7617b49bfcde (diff) | |
download | chrome-ec-f993fe3c66fe55421a9dc6a87f582a7c826c3dab.tar.gz |
pd: vdm: Handle VDM requests only through state machine.
Previously, handle_vdm_requests could dispatch another VDM message
via send_validate_message prior to main task returning to vdm state machine
(pd_vdm_send_state_machine). While it hasn't been problematic to-date it would
make honoring VDM specific timers or PDO priority difficult.
CL changes behavior so that if VDM being handled requires another VDM to be sent
its copied to the one entry queue (queue_vdm) where it will be
serviced upon VDM state machine entry later.
With this simplification, CL expands interlocks between PDO & VDO.
VDOs are only sent when source/sink is in the ready state & no
incoming packet is on the CC line. PDOs aren't sent when the VDM
state machine is busy.
CL also simplifies VDM console output to come only from request handler which
could save a few bytes.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:30645
TEST=manual,
1. dingdong/hoho still enter mode.
2. Can still update fw.
Change-Id: I2fe8643a6975205b2d0f510f4f1baf2d74c1e190
Reviewed-on: https://chromium-review.googlesource.com/235680
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'board/hoho')
-rw-r--r-- | board/hoho/usb_pd_policy.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/board/hoho/usb_pd_policy.c b/board/hoho/usb_pd_policy.c index 195aaacb25..204fb0d70f 100644 --- a/board/hoho/usb_pd_policy.c +++ b/board/hoho/usb_pd_policy.c @@ -232,21 +232,17 @@ const struct svdm_response svdm_rsp = { static int pd_custom_vdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload) { - int cmd = PD_VDO_CMD(payload[0]); int rsize; if (PD_VDO_VID(payload[0]) != USB_VID_GOOGLE || !gfu_mode) return 0; - CPRINTF("VDM/%d [%d] %08x\n", cnt, cmd, payload[0]); - *rpayload = payload; rsize = pd_custom_flash_vdm(port, cnt, payload); if (!rsize) return 0; - CPRINTS("DONE"); /* respond (positively) to the request */ payload[0] |= VDO_SRC_RESPONDER; |