summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-07-30 16:37:22 +0000
committerCommit Bot <commit-bot@chromium.org>2020-07-31 15:06:27 +0000
commit11b600f96ccaf3f78dde52b72c48041019a50228 (patch)
tree8e7e1ab941b52db2fda9e4006ba8b8d5491f78e1 /driver
parent583fb37a3169cca8345799dbdd5ee7fde2f24dd1 (diff)
downloadchrome-ec-11b600f96ccaf3f78dde52b72c48041019a50228.tar.gz
Reland "TCPCI: Check for failed i2c write before using alert register"
This reverts commit 87d418f357867ab863b1c090214b94c2a56929e2. Reason for revert: strago is now removed from EC ToTas of 08df256be2 Original change's description: > Revert "TCPCI: Check for failed i2c write before using alert register" > > This reverts commit ef356b8e6b9fcf665e67a9599323ad0af74eea08. > > Reason for revert: broke many postsubmit builders. > BUG=chromium:1109110 > > Original change's description: > > TCPCI: Check for failed i2c write before using alert register > > > > If the read to the alert register fails, bail on the alert processing > > since there is no valid data to work with. > > > > BRANCH=None > > BUG=b:161765813,b:160973127 > > TEST=on waddledoo, ensure non-error path still works > > > > Signed-off-by: Diana Z <dzigterman@chromium.org> > > Change-Id: I69fff30967132da29d34a41b5a9c4631afb0545d > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2313421 > > Reviewed-by: Denis Brockus <dbrockus@chromium.org> > > Bug: b:161765813 > Bug: b:160973127 > Change-Id: Ia82f61db7c465f380296e0239206219e4283b231 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2317327 > Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org> > Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> > Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> > Tested-by: Nicolas Boichat <drinkcat@chromium.org> Bug: chromium:1109110 Bug: b:161765813 Bug: b:160973127 Change-Id: Idb87f9bebf3ca62f7b2ae7b8ea96d616308610c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2329739 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/tcpci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index ac39c9865a..80f2a134f1 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -1113,7 +1113,10 @@ void tcpci_tcpc_alert(int port)
uint32_t pd_event = 0;
/* Read the Alert register from the TCPC */
- tcpm_alert_status(port, &alert);
+ if (tcpm_alert_status(port, &alert)) {
+ CPRINTS("C%d: Failed to read alert register", port);
+ return;
+ }
/* Get Extended Alert register if needed */
if (alert & TCPC_REG_ALERT_ALERT_EXT)