summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-12-10 18:38:16 +0100
committerFelix Held <felix-coreboot@felixheld.de>2021-12-15 22:38:31 +0000
commit1105fe89131c3841378f44d584acda674f91db28 (patch)
tree131c58e2441caaf6645e4ebe3b553898e4bab447 /src/soc/amd
parenta3930dafd42e10f2003148b0acf8cb28265eaba0 (diff)
soc/amd/common/block/spi/fch_spi_ctrl: handle failure in execute_command
When wait_for_ready returned a timeout, execute_command still ended up returning success. Fix this be returning a failure in this case. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Id012e74e26065c12d003793322dcdd448df758b0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/60119 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/spi/fch_spi_ctrl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/soc/amd/common/block/spi/fch_spi_ctrl.c b/src/soc/amd/common/block/spi/fch_spi_ctrl.c
index aad8de7f69..33e1139d69 100644
--- a/src/soc/amd/common/block/spi/fch_spi_ctrl.c
+++ b/src/soc/amd/common/block/spi/fch_spi_ctrl.c
@@ -97,9 +97,10 @@ static int execute_command(void)
spi_write8(SPI_CMD_TRIGGER, SPI_CMD_TRIGGER_EXECUTE);
- if (wait_for_ready())
- printk(BIOS_ERR,
- "FCH_SC Error: Timeout executing command\n");
+ if (wait_for_ready()) {
+ printk(BIOS_ERR, "FCH_SC Error: Timeout executing command\n");
+ return -1;
+ }
dump_state(SPI_DUMP_STATE_AFTER_CMD);