summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-05-07 10:51:11 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-08 06:21:02 +0000
commit9e5b6e3be99c6064ab76354998b52a43b7d61a31 (patch)
treeb2e53ffbc610f098d2d76276ed550464f119a571
parent974de474ad4c4c86721ae6c4448875b85dc3234b (diff)
downloadchrome-ec-9e5b6e3be99c6064ab76354998b52a43b7d61a31.tar.gz
PD: Skip pd_prepare_sysjump if PD tasks haven't started
Currently, pd_prepare_sysjump is skipped when VBOOT_EFS2 is defined. Even if VBOOT_EFS2 is enabled, late sysjump can happen when secdata kernel is missing or a communication error happens. This patch makes EC skip pd_prepare_sysjump only when PD tasks haven't started. This workaround was first added by crrev.com/c/233751. THere is no associated bug. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1072743 BRANCH=none TEST=Verified USB devices are enumerated on Trembyle. Change-Id: I5946fd97fb20b24b9cbcb12aca3bc293651e224f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2188112 Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--common/system.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/system.c b/common/system.c
index 610363a61a..d64c9c3643 100644
--- a/common/system.c
+++ b/common/system.c
@@ -501,9 +501,13 @@ static void jump_to_image(uintptr_t init_addr)
* RO, EC won't jump to RW, pd_prepare_sysjump is not needed. Even if
* PD is enabled because the device is not write protected, EFS2 jumps
* to RW before PD tasks start. So, there is no states to clean up.
+ *
+ * Even if EFS2 is enabled, late sysjump can happen when secdata
+ * kernel is missing or a communication error happens. So, we need to
+ * check whether PD tasks have started (instead of VBOOT_EFS2, which
+ * is static).
*/
- if (!IS_ENABLED(CONFIG_VBOOT_EFS2) &&
- IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP))
+ if (task_start_called() && IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP))
/* Note: must be before i2c module is locked down */
pd_prepare_sysjump();