mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-16 18:11:22 +00:00
pd: fix bug in pd transmit retry mechanism
This fixes a bug in the PD transmit retry mechanism. In the retry mechanism, we were assuming that only a pd rx interrupt will wake up this event. But, there are other events that could potentially wake us up, so we need to check to make sure that pd rx started when we first wake up. BUG=chrome-os-partner:30135 BRANCH=none TEST=load onto samus and zinger. run "pd 0 flash rw_hash" a bunch of times manually from the console. Observe that we nearly always fail the first receive, but succeed on next try, which prevents us from dropping the negotiation. Change-Id: I5f7261176c151c3185d76aa374b9b83ac9df9a7d Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/213369 Reviewed-by: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
4ec6babda0
commit
7b1a0dc795
@@ -371,6 +371,14 @@ static int send_validate_message(int port, uint16_t header,
|
||||
if (task_wait_event(USB_PD_RX_TMOUT_US) ==
|
||||
TASK_EVENT_TIMER)
|
||||
continue;
|
||||
/*
|
||||
* Make sure we woke up due to rx recd, otherwise
|
||||
* we need to manually start
|
||||
*/
|
||||
if (!pd_rx_started(port)) {
|
||||
pd_rx_disable_monitoring(port);
|
||||
pd_rx_start(port);
|
||||
}
|
||||
} else {
|
||||
/* starting waiting for GoodCrc */
|
||||
pd_rx_start(port);
|
||||
|
||||
Reference in New Issue
Block a user