summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2016-11-03 18:46:19 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2016-12-05 11:31:43 +0000
commit86800045f84b2e19ee0f3afc9004468daed4dc60 (patch)
tree46c5bff7c46cd72758bf4ee98ef2f79556211c3f
parent65fb80d4d1b937a33999b9d19d75de90afa19f6e (diff)
downloadchrome-ec-86800045f84b2e19ee0f3afc9004468daed4dc60.tar.gz
host_command_pd: reduce to 5msec delay in between PD interrupt handling
Since PD task are highest priority, the 50msec delay between was intended allow other tasks to execute if PD has continuous interrupt. With two separate TCPC handled by host_command_pd task, interrupt from one TCPC will block the interrupt handling of another TCPC by this 50msec and cause error in the PD negotiation. Reduced to 5msec to ensure TCPC interrupt is handled as soon as possible while allow other tasks to execute if needed. BUG=chrome-os-partner:59061 BUG=chrome-os-partner:59938 BUG=chrome-os-partner:60563 BUG=chrome-os-partner:60575 BRANCH=none TEST=Verify zinger can negotiate to 20V, hoho can get display. Also tested with faking PD interrupt always asserted to check for watchdog reset. TEST=On elm, connect Apple HDMI adapter (FW 1.58) with HDMI+power already connected, both power and display work. TEST=On elm, connect j5create adapter, then HDMI, then power => no crash TEST=On elm, S5, connect Huawei dock with HDMI+power already connected, after boot, both power and display work. Change-Id: I9b71277a3d65923f1f5bbfd744b3399e34fd0e6c Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/407542 Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Scott Collyer <scollyer@chromium.org> (cherry picked from commit 72d72ea0089ab27fadc7b9bf81829c1646e20847) Reviewed-on: https://chromium-review.googlesource.com/416089 Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Trybot-Ready: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Rong Chang <rongchang@chromium.org>
-rw-r--r--common/host_command_pd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/host_command_pd.c b/common/host_command_pd.c
index fbfad43918..c3fc385216 100644
--- a/common/host_command_pd.c
+++ b/common/host_command_pd.c
@@ -198,7 +198,8 @@ static void pd_exchange_status(uint32_t ec_state)
#endif
if (!first_exchange)
- usleep(50*MSEC);
+ /* Delay to prevent task starvation */
+ usleep(5*MSEC);
first_exchange = 0;
} while (pd_get_alert());
#endif /* USB_TCPM_WITH_OFF_CHIP_TCPC */