retimer: firmware update retry online
retimer: firmware update retry online

This CL implements error recovery for case as below.

In NDA ports retimer firmware update, when NVM is updated and issued
authentication, retimer takes about 5 seconds to come back. After
this, host can bring the port online. Online means EC disconnects
the USB mux and resumes PD port.

If user requests EC to put port online without waiting 5 seconds,
The operation will fail. The PD port couldn't get out of suspended
state. It's disabled.

This CL adds a deferred call to check if PD port is online successfully;
if not, retry online again to enable the PD port. Also if the port is
requested to be online but not resumed yet, except RESUME_PD, no other
host requests will be allowed. As soon as port is resumed, the port
can accept requestes again.

BUG=b:212235056 b:211790542
BRANCH=none
TEST=On Redrix NDA PD port,
echo 1 > offline
update NVM and authenticate; not waiting 5 seconds.
echo 0 > offline
The port failed to be online, after delay, deferred call is triggered.
Online is tried again; port is enabled.

Signed-off-by: Li Feng <0fd15d95d647a38d004d7ac9a3d0587bb1c98551@intel.com>
Change-Id: I7ec96a4dfb81e8ed2422e459a098defa4c8acf92
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3666378
Commit-Queue: Keith Short <f6d578f97033c25f1206cb57d52f358974c82954@chromium.org>
Reviewed-by: Keith Short <f6d578f97033c25f1206cb57d52f358974c82954@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec