summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-03-07 01:37:59 (GMT)
committerChromeBot <chrome-bot@google.com>2013-03-07 04:20:39 (GMT)
commita2efa2c918e04af96aa7cc2cf33c7c400e81bbba (patch)
treec06363b6596511fde325dd33fe5a2024fe446861
parent084ef0ff3a15ad6c9c0c841186bfa92b4e71d832 (diff)
downloaddepthcharge-firmware-spring-3824.B.tar.gz
depthcharge-firmware-spring-3824.B.tar.xz
lib_sysinfo.cpu_khz is probably different from timer clock, so when calculating timeout we should always use timer_hz(). BRANCH=none BUG=none TEST=manual: USE=depthcharge emerge-link depthcharge Change-Id: I056b8a4ac0484ffe6ad408926439152e3bb5a590 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://gerrit-int.chromium.org/33405 Tested-by: Hung-Te Lin <hungte@google.com> Reviewed-by: Gabe Black <gabeblack@google.com> Commit-Queue: Hung-Te Lin <hungte@google.com>
-rw-r--r--src/drivers/ec/chromeos/mkbp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/ec/chromeos/mkbp.c b/src/drivers/ec/chromeos/mkbp.c
index 9dbb28e..6ef461f 100644
--- a/src/drivers/ec/chromeos/mkbp.c
+++ b/src/drivers/ec/chromeos/mkbp.c
@@ -125,7 +125,7 @@ static int ec_command(struct mkbp_dev *dev, uint8_t cmd, int cmd_version,
return ret;
if (timer_value() - start >
- MKBP_CMD_TIMEOUT_MS * lib_sysinfo.cpu_khz) {
+ MKBP_CMD_TIMEOUT_MS * (timer_hz() / 1000)) {
printf("%s: Command %#02x timeout",
__func__, cmd);
return -EC_RES_TIMEOUT;