summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-04-12 14:53:38 -0600
committerJett Rink <jettrink@chromium.org>2019-04-12 22:11:05 +0000
commit0f456193de59b6b6e1fb9c4b35a59c17d7343440 (patch)
tree8f94e47d546f31eb4bbd4bdaeae99d51c2a0dc8f
parent3eb986572c138b3f3699b2de36560e564f486c3b (diff)
downloadchrome-ec-0f456193de59b6b6e1fb9c4b35a59c17d7343440.tar.gz
ish: add temporary workaround for lost interrupt
While we figure out how to fix the root cause for missing interrupts, we can at least get ourselves out of the back scenario by proactively checking if there is a pending IOAPIC interrupt that the LAPIC does not know about. BRANCH=none BUG=b:129937881 TEST=ISH communication does not permanently lock up Change-Id: I766b2764748ae85b17992b3c0020ba7fb4e11693 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1566472 Reviewed-by: Mathew King <mathewk@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--core/minute-ia/interrupts.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/core/minute-ia/interrupts.c b/core/minute-ia/interrupts.c
index 7ab0be1eb7..cb81fed2ea 100644
--- a/core/minute-ia/interrupts.c
+++ b/core/minute-ia/interrupts.c
@@ -6,13 +6,14 @@
*/
#include "common.h"
-#include "util.h"
+#include "console.h"
+#include "hooks.h"
+#include "ia_structs.h"
#include "interrupts.h"
+#include "irq_handler.h"
#include "registers.h"
#include "task_defs.h"
-#include "irq_handler.h"
-#include "console.h"
-#include "ia_structs.h"
+#include "util.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_SYSTEM, outstr)
@@ -294,13 +295,14 @@ void handle_lapic_lvt_error(void)
/* Ack LVT ERROR exception */
REG32(LAPIC_ESR_REG) = 0;
- lapic_lvt_error_count++;
/*
* When IOAPIC has more than 1 interrupts in remote IRR state,
* LAPIC raises internal error.
*/
if (esr & LAPIC_ERR_RECV_ILLEGAL) {
+ lapic_lvt_error_count++;
+
/* Scan redirect table entries */
max_irq_entries = (read_ioapic_reg(IOAPIC_VERSION) >> 16) &
0xff;
@@ -319,11 +321,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);
}
- CPRINTF("LAPIC error ESR:0x%02x,count:%u IOAPIC pending count:%u\n",
- esr, lapic_lvt_error_count, ioapic_pending_count);
}
+/* 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);