From 0e3a53ee3801d4c462146d80a86c606d77b20c9e Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Mon, 27 Jun 2016 18:05:31 -0700 Subject: [PATCH] tpm: spi: fix stopwatch implementation bug Stopwatch expiration check was expiring immediately, this patch fixes the bug. BRANCH=none BUG=chrome-os-partner:50645 TEST=SPI TPM initialization does not fail any more. Change-Id: I942ff694a237306eab60834c2cd5096775bfe8b8 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/356591 Reviewed-by: Aaron Durbin --- src/drivers/tpm/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/tpm/spi.c b/src/drivers/tpm/spi.c index 55ea21f3..acc2e998 100644 --- a/src/drivers/tpm/spi.c +++ b/src/drivers/tpm/spi.c @@ -45,7 +45,7 @@ static void stopwatch_init_usecs_expire(struct stopwatch *sw, long us) static int stopwatch_expired(struct stopwatch *sw) { - return timer_us(sw->start > sw->expires); + return timer_us(sw->start) > sw->expires; } /* -- 2.11.0