diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-04-03 10:29:42 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-04-03 10:29:42 +0000 |
commit | 782d6441c3bcd32f321956417866ea11c536917c (patch) | |
tree | 36e3b5451440fc913d61a212b54e237c090f056f /sys/arch | |
parent | 600a4e22f21648e2f14df5928bc4ccfb8868ec6e (diff) |
Remove tests for "processing" which was never set. It attempted to
protect against multiple entries of a function that handled pending
soft interrupts. This seems to have been a mistake made when converting
code that used simple lock in the 80321 code which got reused in armv7.
arm softintr_dispatch() already has mutexes around invoked callbacks
which should be enough. Make the pxa2x0 code work the same way which
removes the last remaining simple lock use on arm.
ok patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm/xscale/i80321_intr.c | 10 | ||||
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_intr.c | 24 | ||||
-rw-r--r-- | sys/arch/armv7/armv7/intr.c | 11 |
3 files changed, 4 insertions, 41 deletions
diff --git a/sys/arch/arm/xscale/i80321_intr.c b/sys/arch/arm/xscale/i80321_intr.c index d77944d6891..85c213ae095 100644 --- a/sys/arch/arm/xscale/i80321_intr.c +++ b/sys/arch/arm/xscale/i80321_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i80321_intr.c,v 1.17 2016/01/31 00:14:50 jsg Exp $ */ +/* $OpenBSD: i80321_intr.c,v 1.18 2016/04/03 10:29:41 jsg Exp $ */ /* * Copyright (c) 2006 Dale Rahn <drahn@openbsd.org> @@ -174,18 +174,12 @@ i80321intc_calc_mask(void) void i80321intc_do_pending(void) { - static int processing = 0; int oldirqstate, spl_save; oldirqstate = disable_interrupts(PSR_I); spl_save = current_ipl_level; - if (processing == 1) { - restore_interrupts(oldirqstate); - return; - } - #define DO_SOFTINT(si, ipl) \ if ((softint_pending & i80321intc_smask[current_ipl_level]) & \ SI_TO_IRQBIT(si)) { \ @@ -205,8 +199,6 @@ i80321intc_do_pending(void) DO_SOFTINT(SI_SOFT, IPL_SOFT); } while (softint_pending & i80321intc_smask[current_ipl_level]); - - processing = 0; restore_interrupts(oldirqstate); } diff --git a/sys/arch/arm/xscale/pxa2x0_intr.c b/sys/arch/arm/xscale/pxa2x0_intr.c index 0743c9643e5..9c959b19c04 100644 --- a/sys/arch/arm/xscale/pxa2x0_intr.c +++ b/sys/arch/arm/xscale/pxa2x0_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_intr.c,v 1.27 2016/01/31 00:14:50 jsg Exp $ */ +/* $OpenBSD: pxa2x0_intr.c,v 1.28 2016/04/03 10:29:41 jsg Exp $ */ /* $NetBSD: pxa2x0_intr.c,v 1.5 2003/07/15 00:24:55 lukem Exp $ */ /* @@ -48,7 +48,6 @@ #include <machine/bus.h> #include <machine/intr.h> -#include <machine/lock.h> #include <arm/xscale/pxa2x0reg.h> #include <arm/xscale/pxa2x0var.h> @@ -448,17 +447,12 @@ pxa2x0_init_interrupt_masks(void) void pxa2x0_do_pending(void) { - static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED; int oldirqstate, spl_save; - if (__cpu_simple_lock_try(&processing) == 0) - return; + oldirqstate = disable_interrupts(PSR_I); spl_save = current_spl_level; - oldirqstate = disable_interrupts(PSR_I); - -#if 1 #define DO_SOFTINT(si,ipl) \ if ((softint_pending & pxa2x0_imask[current_spl_level]) & \ SI_TO_IRQBIT(si)) { \ @@ -477,24 +471,10 @@ pxa2x0_do_pending(void) DO_SOFTINT(SI_SOFTCLOCK, IPL_SOFTCLOCK); DO_SOFTINT(SI_SOFT, IPL_SOFT); } while( softint_pending & pxa2x0_imask[current_spl_level] ); -#else - while( (si = find_first_bit(softint_pending & pxa2x0_imask[current_spl_level])) >= 0 ){ - softint_pending &= ~SI_TO_IRQBIT(si); - if (current_spl_level < ipl) - pxa2x0_setipl(ipl); - restore_interrupts(oldirqstate); - softintr_dispatch(si); - oldirqstate = disable_interrupts(PSR_I); - pxa2x0_setipl(spl_save); - } -#endif - - __cpu_simple_unlock(&processing); restore_interrupts(oldirqstate); } - #undef splx void splx(int ipl) diff --git a/sys/arch/armv7/armv7/intr.c b/sys/arch/armv7/armv7/intr.c index b096bed7542..5227ae9d46f 100644 --- a/sys/arch/armv7/armv7/intr.c +++ b/sys/arch/armv7/armv7/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.4 2016/01/31 00:14:50 jsg Exp $ */ +/* $OpenBSD: intr.c,v 1.5 2016/04/03 10:29:41 jsg Exp $ */ /* * Copyright (c) 2011 Dale Rahn <drahn@openbsd.org> * @@ -165,18 +165,10 @@ void arm_do_pending_intr(int pcpl) { struct cpu_info *ci = curcpu(); - static int processing = 0; int oldirqstate; oldirqstate = disable_interrupts(PSR_I); - if (processing == 1) { - /* Don't use splx... we are here already! */ - arm_intr_func.setipl(pcpl); - restore_interrupts(oldirqstate); - return; - } - #define DO_SOFTINT(si, ipl) \ if ((ci->ci_ipending & arm_smask[pcpl]) & \ SI_TO_IRQBIT(si)) { \ @@ -196,7 +188,6 @@ arm_do_pending_intr(int pcpl) /* Don't use splx... we are here already! */ arm_intr_func.setipl(pcpl); - processing = 0; restore_interrupts(oldirqstate); } |