From 95b91a3039d87b44bbbab45c768a15d48048aef7 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Mon, 18 May 2015 04:06:38 +0000 Subject: Move the logic deciding whether to grab the kernel lock or not, deeper in the interrupt logic, making sure the lock is not taken for clock interrupts. Tested on aviion and luna88k. --- sys/arch/luna88k/luna88k/isr.c | 10 +++++++++- sys/arch/luna88k/luna88k/machdep.c | 13 ++----------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'sys/arch/luna88k') diff --git a/sys/arch/luna88k/luna88k/isr.c b/sys/arch/luna88k/luna88k/isr.c index 3e9fbaf9d57..0a53ed3731a 100644 --- a/sys/arch/luna88k/luna88k/isr.c +++ b/sys/arch/luna88k/luna88k/isr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isr.c,v 1.9 2010/12/21 14:56:24 claudio Exp $ */ +/* $OpenBSD: isr.c,v 1.10 2015/05/18 04:06:37 miod Exp $ */ /* $NetBSD: isr.c,v 1.5 2000/07/09 08:08:20 nisimura Exp $ */ /*- @@ -165,7 +165,15 @@ isrdispatch_autovec(int ipl) /* Give all the handlers a chance. */ LIST_FOREACH(isr, list, isr_link) { +#ifdef MULTIPROCESSOR + if (isr->isr_ipl < IPL_CLOCK) + __mp_lock(&kernel_lock); +#endif rc = (*isr->isr_func)(isr->isr_arg); +#ifdef MULTIPROCESSOR + if (isr->isr_ipl < IPL_CLOCK) + __mp_unlock(&kernel_lock); +#endif if (rc != 0) isr->isr_count.ec_count++; handled |= rc; diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c index ba74a8efda5..edf6f9cd92a 100644 --- a/sys/arch/luna88k/luna88k/machdep.c +++ b/sys/arch/luna88k/luna88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.116 2015/02/25 17:41:22 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.117 2015/05/18 04:06:37 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -868,17 +868,8 @@ luna88k_ext_int(struct trapframe *eframe) case 5: case 4: case 3: -#ifdef MULTIPROCESSOR - if (CPU_IS_PRIMARY(ci)) { - if (old_spl < IPL_SCHED) - __mp_lock(&kernel_lock); -#endif + if (CPU_IS_PRIMARY(ci)) isrdispatch_autovec(cur_int_level); -#ifdef MULTIPROCESSOR - if (old_spl < IPL_SCHED) - __mp_unlock(&kernel_lock); - } -#endif break; default: printf("%s: cpu%d level %d interrupt.\n", -- cgit v1.2.3