diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2021-06-02 17:25:55 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-22 08:24:09 +0000 |
commit | d3eb33b4df2ca5a1d2124f2b38326a8a0f111eb4 (patch) | |
tree | bfbdc017ff09666cfae52c2c948858e5e14cf949 | |
parent | 3de0312ead5e6103f481ca01d162a6b4a126fc52 (diff) | |
download | chrome-ec-d3eb33b4df2ca5a1d2124f2b38326a8a0f111eb4.tar.gz |
it8xxx2/irq: wait until two equal interrupt values are read
This CL ensures that CPU won't get an IRQ number which is in generating.
BRANCH=none
BUG=b:179206540, b:189534384
TEST=No panic of unhandled irq.
Change-Id: I934fc9ba7aeef520f5e275e8889722c7357c77f1
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2935652
Reviewed-by: Eric Yilun Lin <yllin@google.com>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Tested-by: Eric Yilun Lin <yllin@google.com>
(cherry picked from commit 3e0527c720dd6b407a0e1431fe74ca033f669cf6)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2977862
-rw-r--r-- | chip/it83xx/irq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chip/it83xx/irq.c b/chip/it83xx/irq.c index dd2b936f55..945f1909de 100644 --- a/chip/it83xx/irq.c +++ b/chip/it83xx/irq.c @@ -85,7 +85,11 @@ int chip_get_ec_int(void) /* Determine interrupt number */ ec_int -= 16; #else /* defined(CHIP_FAMILY_IT8XXX2) RISCV core */ - ec_int = IT83XX_INTC_AIVCT - 0x10; + /* wait until two equal interrupt values are read */ + do { + ec_int = IT83XX_INTC_AIVCT; + } while (ec_int != IT83XX_INTC_AIVCT); + ec_int -= 0x10; /* Unsupported EC INT number. */ if (chip_get_intc_group(ec_int) >= 16) return -1; |