From 44206e38bf6e3ddd6a628ceab0c2c982ca6660b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 26 Feb 2019 17:17:24 +0200 Subject: [PATCH] sb/intel/common: Fix SMBus block commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix regression after commit c38d543 sb/intel/common: SMBus complete_command() When evaluating HSTSTS register, BYTE_DONE bit must be excluded from transaction completion and error criteria. Change-Id: I49cc43d1fa58250988cc41b2ca747b9f1d7586d6 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/31622 Reviewed-by: Arthur Heymans Reviewed-by: Paul Menzel Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/southbridge/intel/common/smbus.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/southbridge/intel/common/smbus.c b/src/southbridge/intel/common/smbus.c index a842a61222..9ae01ad178 100644 --- a/src/southbridge/intel/common/smbus.c +++ b/src/southbridge/intel/common/smbus.c @@ -74,7 +74,10 @@ static int host_completed(u8 status) { if (status & SMBHSTSTS_HOST_BUSY) return 0; - status &= ~(SMBHSTSTS_SMBALERT_STS | SMBHSTSTS_INUSE_STS); + + /* These status bits do not imply completion of transaction. */ + status &= ~(SMBHSTSTS_BYTE_DONE | SMBHSTSTS_INUSE_STS | + SMBHSTSTS_SMBALERT_STS); return status != 0; } @@ -89,8 +92,9 @@ static int recover_master(int smbus_base, int ret) static int cb_err_from_stat(u8 status) { - /* Ignore the "In Use" status... */ - status &= ~(SMBHSTSTS_SMBALERT_STS | SMBHSTSTS_INUSE_STS); + /* These status bits do not imply errors. */ + status &= ~(SMBHSTSTS_BYTE_DONE | SMBHSTSTS_INUSE_STS | + SMBHSTSTS_SMBALERT_STS); if (status == SMBHSTSTS_INTR) return 0;