mkbp: handle multiple writes of interrupt

We need to handle the case of multiple tasks trying to set the mkbp
interrupt while the host command task is trying to clear it. The setting
of the interrupt may also take a while and we need to ensure that we
synchronize correct after a longer delay.

BRANCH=none
BUG=b:129159505
TEST=passing CTS sensor run (except test 133 nullptr) with this change
TEST=pass CTS sensor run on eSPI-based system
TEST=pass CTS sensor run on GPIO-based system

Change-Id: I056b72c1210d7525c29a8555f97e6f09d773d12f
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1560229
Tested-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
2 files changed