macppc: dec_rearm: don't disable interrupts around atomic operations
authorcheloha <cheloha@openbsd.org>
Sat, 4 Feb 2023 23:17:05 +0000 (23:17 +0000)
committercheloha <cheloha@openbsd.org>
Sat, 4 Feb 2023 23:17:05 +0000 (23:17 +0000)
We don't need to disable interrupts around ppc_mtdec().  The
underlying operation, mtdec, is atomic.

Link: https://marc.info/?l=openbsd-tech&m=167494864124073&w=2
ok gkoehler@

sys/arch/macppc/macppc/clock.c

index 18b2522..cbffc4a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.53 2023/02/04 19:19:36 cheloha Exp $      */
+/*     $OpenBSD: clock.c,v 1.54 2023/02/04 23:17:05 cheloha Exp $      */
 /*     $NetBSD: clock.c,v 1.1 1996/09/30 16:34:40 ws Exp $     */
 
 /*
@@ -247,16 +247,13 @@ void
 dec_rearm(void *unused, uint64_t nsecs)
 {
        uint32_t cycles;
-       int s;
 
        if (nsecs > dec_nsec_max)
                nsecs = dec_nsec_max;
        cycles = (nsecs * dec_nsec_cycle_ratio) >> 32;
        if (cycles > UINT32_MAX >> 1)
                cycles = UINT32_MAX >> 1;
-       s = ppc_intr_disable();
        ppc_mtdec(cycles);
-       ppc_intr_enable(s);
 }
 
 void