summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2018-09-26 17:57:38 -0700
committerCommit Bot <commit-bot@chromium.org>2019-09-19 00:25:38 +0000
commit03b79d7297a9d564ebf495556c3d9d692e69c96f (patch)
treef2ce903455e03ccdcfae17146f2d3908150f25b7
parent7c1810d36c453f785e1586bb44d4df2fe0ba435d (diff)
downloadchrome-ec-03b79d7297a9d564ebf495556c3d9d692e69c96f.tar.gz
usb_pd_protocol: Add a 3ms delay between polling ALERT#.
In order to prevent tasks from being starved and eventually a watchdog reset, add a short 3ms sleep to give other tasks a chance to run. BUG=b:115452695 BRANCH=firmware-nocturne-10984.B TEST=Flash nocturne; plug in hoho on port 0 and blackcat on port 1, verify that EC does not watchdog reset. Change-Id: Ia81770e1cf4191205153aa3919290f6a5440ddf2 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1247638 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> (cherry picked from commit 720f1078aca231939147e9ed7c8b4ef3bfe84e89) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1812358 Reviewed-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com>
-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 5ffdf6c77d..3dffb393ea 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2659,8 +2659,11 @@ void pd_interrupt_handler_task(void *p)
* PD_PROCESS_INTERRUPT to check if we missed anything.
*/
while ((tcpc_get_alert_status() & port_mask) &&
- pd_is_port_enabled(port))
+ pd_is_port_enabled(port)) {
tcpc_alert(port);
+ /* Give other tasks a chance to run. */
+ usleep(3*MSEC);
+ }
}
}
}