From 666951e398c188d4016937d1c906ee07d771f987 Mon Sep 17 00:00:00 2001 From: kettenis Date: Fri, 21 May 2021 18:53:12 +0000 Subject: [PATCH] Avoid spinning on the kernel lock with interrupts disabled. ok patrick@ --- sys/arch/arm64/dev/agintc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arch/arm64/dev/agintc.c b/sys/arch/arm64/dev/agintc.c index 9cbe942fff4..fde4167ce72 100644 --- a/sys/arch/arm64/dev/agintc.c +++ b/sys/arch/arm64/dev/agintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agintc.c,v 1.32 2021/05/15 11:30:27 kettenis Exp $ */ +/* $OpenBSD: agintc.c,v 1.33 2021/05/21 18:53:12 kettenis Exp $ */ /* * Copyright (c) 2007, 2009, 2011, 2017 Dale Rahn * Copyright (c) 2018 Mark Kettenis @@ -925,9 +925,7 @@ agintc_run_handler(struct intrhand *ih, void *frame, int s) else arg = frame; - intr_enable(); handled = ih->ih_func(arg); - intr_disable(); if (handled) ih->ih_count.ec_count++; @@ -976,7 +974,9 @@ agintc_irq_handler(void *frame) return; s = agintc_splraise(ih->ih_ipl); + intr_enable(); agintc_run_handler(ih, frame, s); + intr_disable(); agintc_eoi(irq); agintc_splx(s); @@ -985,9 +985,11 @@ agintc_irq_handler(void *frame) pri = sc->sc_handler[irq].iq_irq_max; s = agintc_splraise(pri); + intr_enable(); TAILQ_FOREACH(ih, &sc->sc_handler[irq].iq_list, ih_list) { agintc_run_handler(ih, frame, s); } + intr_disable(); agintc_eoi(irq); agintc_splx(s); -- 2.20.1