Call VbExEcRunningRW to set IN_RW flag

CL:693008 changed check_ac_active so that we ask CR50 to verify EC
is in RO. While this is the right decision, on some platforms ECs
can't reset EC_IN_RW. This causes check_ec_active to set IN_RW
wrongly when EC is in RO after reboot.

This patch replaces VbExTrustEC with VbExEcRunningRW. If RW is
owned it may say it's in RO. Then, the software sync will proceed
and flash RW while the EC is running RW copy.

It also removes redundant checks for VbExTrustEC() when deciding
whether to allow developer mode to be enabled from the INSERT
screen. The INSERT screen can only be reached by manual recovery,
which resets the EC, we don't need to check again before going to

TEST=make runtests

Change-Id: Ide722146ca8683411dd9072a39387aa9531f6cfc
Signed-off-by: Daisuke Nojiri <>
(cherry picked from commit e5e03c6d50fd4c4a0cd95b68eeb52f0c8e98bfc6)
Reviewed-by: Scott Collyer <>
Commit-Queue: Aaron Durbin <>
Tested-by: Aaron Durbin <>
Trybot-Ready: Aaron Durbin <>
5 files changed