diff options
author | Leifu Zhao <leifu.zhao@intel.com> | 2019-04-14 21:05:26 +0800 |
---|---|---|
committer | Jett Rink <jettrink@chromium.org> | 2019-04-17 13:33:39 +0000 |
commit | 8841b815c195aadacb8f0f6e625041c3427bbd97 (patch) | |
tree | 687341e1f645eb7d21d75d200c93815eccf71a53 | |
parent | db914dee3b0718ad791765f70ee9be1223ca0d84 (diff) | |
download | chrome-ec-8841b815c195aadacb8f0f6e625041c3427bbd97.tar.gz |
ish: add missing EOI in LAPIC error irq handler
The LAPIC LVT error irq handler missed EOI to LAPIC at the end
of the handler.
BUG=b:129937881
BRANCH=none
TEST=tested on arcada
Signed-off-by: Leifu Zhao <leifu.zhao@intel.com>
Change-Id: I890271729c5ab1d622016c32e83a8068914f69de
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1567105
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
-rw-r--r-- | core/minute-ia/interrupts.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/core/minute-ia/interrupts.c b/core/minute-ia/interrupts.c index cb81fed2ea..d41ae836c9 100644 --- a/core/minute-ia/interrupts.c +++ b/core/minute-ia/interrupts.c @@ -242,6 +242,14 @@ uint32_t get_current_interrupt_vector(void) static uint32_t lapic_lvt_error_count; static uint32_t ioapic_pending_count; +static uint32_t last_esr; + +static void print_lpaic_lvt_error(void) +{ + CPRINTS("LAPIC error ESR 0x%02x: %u; IOAPIC pending: %u", last_esr, + lapic_lvt_error_count, ioapic_pending_count); +} +DECLARE_DEFERRED(print_lpaic_lvt_error); /* * Get LAPIC ISR, TMR, or IRR vector bit. @@ -321,14 +329,14 @@ void handle_lapic_lvt_error(void) } } } - CPRINTF("LAPIC error ESR:0x%02x,count:%u IOAPIC pending " - "count:%u\n", - esr, lapic_lvt_error_count, ioapic_pending_count); } + if (esr) { + /* Don't print in interrupt context because it is too slow */ + last_esr = esr; + hook_call_deferred(&print_lpaic_lvt_error_data, 0); + } } -/* TODO(b/129937881): Remove periodic check once root cause is determined */ -DECLARE_HOOK(HOOK_TICK, handle_lapic_lvt_error, HOOK_PRIO_DEFAULT); /* LAPIC LVT error is not an IRQ and can not use DECLARE_IRQ() to call. */ void _lapic_error_handler(void); @@ -342,6 +350,7 @@ __asm__ ( "push %eax\n" "call handle_lapic_lvt_error\n" "pop %esp\n" + "movl $0x00, (0xFEE000B0)\n" /* Set EOI for LAPIC */ ASM_LOCK_PREFIX "subl $1, __in_isr\n" "popa\n" "iret\n" @@ -370,7 +379,8 @@ void init_interrupts(void) for (; p < __irq_data_end; p++) set_interrupt_gate(IRQ_TO_VEC(p->irq), p->routine, IDT_DESC_FLAGS); - /* Setup gate for LAPIC_LVT_ERROR vector */ + /* Setup gate for LAPIC_LVT_ERROR vector; clear any remnant error. */ + REG32(LAPIC_ESR_REG) = 0; set_interrupt_gate(LAPIC_LVT_ERROR_VECTOR, _lapic_error_handler, IDT_DESC_FLAGS); |