summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-12-06 13:55:05 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-12-08 12:32:31 -0800
commita0bfd989d1045dd328543f2792df44209a090d33 (patch)
tree01d5a769b2ee376901b6a9b64504c248c477e747
parent26b1d8ae64e8354c445f687adad718cb00a7bc8a (diff)
downloadchrome-ec-a0bfd989d1045dd328543f2792df44209a090d33.tar.gz
npcx: hwtimer: Fix deadlock close to hwtimer wrap
__hw_clock_event_set() is not reentrant and may be called from both our event timer ISR and our hwtimer ISR when hwtimer is close to wrapping. Modify the interrupt priority of our hwtimer int to match our event timer int so that one cannot preempt the other. Originally the priority was changed to allow the hwtimer ISR to run first in case both are pending, but this condition can be handled cleanly and isn't a big concern. BUG=chrome-os-partner:60470 BRANCH=gru TEST=Pass 500 S/R cycles on kevin with hwtimer wrap rate sped up 300x (roughly equivalent to 150,000 real S/R cycles). Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ied466f14661f04c8662b5db709c0e3770a5bb200 Reviewed-on: https://chromium-review.googlesource.com/417060 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit ac28ec53b63a02c4d25e8a222d13595bc857fef0) Reviewed-on: https://chromium-review.googlesource.com/417112 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--chip/npcx/hwtimer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/npcx/hwtimer.c b/chip/npcx/hwtimer.c
index 58bcda17c5..206f5f219c 100644
--- a/chip/npcx/hwtimer.c
+++ b/chip/npcx/hwtimer.c
@@ -265,7 +265,7 @@ void __hw_clock_source_irq(void)
#endif
}
}
-DECLARE_IRQ(NPCX_IRQ_ITIM32, __hw_clock_source_irq, 0);
+DECLARE_IRQ(NPCX_IRQ_ITIM32, __hw_clock_source_irq, 2);
static void update_prescaler(void)
{