Always lock the kernel lock with non-MP-safe interrupt handlers.
authorvisa <visa@openbsd.org>
Tue, 23 Jan 2018 14:47:21 +0000 (14:47 +0000)
committervisa <visa@openbsd.org>
Tue, 23 Jan 2018 14:47:21 +0000 (14:47 +0000)
Suggested by kettenis@

sys/arch/loongson/loongson/loongson3_intr.c
sys/arch/octeon/dev/octcit.c
sys/arch/octeon/dev/octciu.c

index 445c36d..a94dd42 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: loongson3_intr.c,v 1.5 2017/02/19 09:53:37 visa Exp $ */
+/*     $OpenBSD: loongson3_intr.c,v 1.6 2018/01/23 14:47:21 visa Exp $ */
 
 /*
  * Copyright (c) 2016 Visa Hankala
@@ -416,7 +416,7 @@ loongson3_intr(uint32_t pending, struct trapframe *frame)
                        if (ih->ih_flags & IH_MPSAFE)
                                need_lock = 0;
                        else
-                               need_lock = ih->ih_level < IPL_CLOCK;
+                               need_lock = 1;
                        if (need_lock)
                                __mp_lock(&kernel_lock);
 #endif
@@ -492,7 +492,7 @@ loongson3_ht_intr(uint32_t pending, struct trapframe *frame)
                        if (ih->ih_flags & IH_MPSAFE)
                                need_lock = 0;
                        else
-                               need_lock = ih->ih_level < IPL_CLOCK;
+                               need_lock = 1;
                        if (need_lock)
                                __mp_lock(&kernel_lock);
 #endif
index fef4663..785cafa 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: octcit.c,v 1.4 2017/12/27 13:16:53 visa Exp $ */
+/*     $OpenBSD: octcit.c,v 1.5 2018/01/23 14:47:21 visa Exp $ */
 
 /*
  * Copyright (c) 2017 Visa Hankala
@@ -431,7 +431,7 @@ octcit_intr(uint32_t hwpend, struct trapframe *frame)
                if (ISSET(ih->ih_flags, IH_MPSAFE))
                        need_lock = 0;
                else
-                       need_lock = ih->ih_level < IPL_CLOCK;
+                       need_lock = 1;
                if (need_lock)
                        __mp_lock(&kernel_lock);
 #endif
index 179e21f..6014d06 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: octciu.c,v 1.8 2017/11/03 16:19:25 visa Exp $ */
+/*     $OpenBSD: octciu.c,v 1.9 2018/01/23 14:47:21 visa Exp $ */
 
 /*
  * Copyright (c) 2000-2004 Opsycon AB  (www.opsycon.se)
@@ -480,7 +480,7 @@ octciu_intr_bank(struct octciu_softc *sc, struct intrbank *bank,
                        if (ih->ih_flags & IH_MPSAFE)
                                need_lock = 0;
                        else
-                               need_lock = ih->ih_level < IPL_CLOCK;
+                               need_lock = 1;
                        if (need_lock)
                                __mp_lock(&kernel_lock);
 #endif