Module Name:    src
Committed By:   rin
Date:           Thu Apr 15 00:19:52 UTC 2021

Modified Files:
        src/sys/arch/alpha/alpha: interrupt.c

Log Message:
Contrary to comment here, nowadays hardclock() and statclock() should be
called with cpu_intr_p() is turning on, if used from the interrupt context.

Otherwise, entropy_enter() is used instead of entropy_enter_intr(), which
results in KASSERT() failure.

Therefore, bump ci_intrdepth for clock interrupt. Remove stale comment also.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/alpha/alpha/interrupt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/alpha/interrupt.c
diff -u src/sys/arch/alpha/alpha/interrupt.c:1.92 src/sys/arch/alpha/alpha/interrupt.c:1.93
--- src/sys/arch/alpha/alpha/interrupt.c:1.92	Sat Oct 10 03:05:04 2020
+++ src/sys/arch/alpha/alpha/interrupt.c	Thu Apr 15 00:19:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.92 2020/10/10 03:05:04 thorpej Exp $ */
+/* $NetBSD: interrupt.c,v 1.93 2021/04/15 00:19:52 rin Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.92 2020/10/10 03:05:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.93 2021/04/15 00:19:52 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -212,12 +212,7 @@ interrupt(unsigned long a0, unsigned lon
 		break;
 		
 	case ALPHA_INTR_CLOCK:	/* clock interrupt */
-		/*
-		 * We don't increment the interrupt depth for the
-		 * clock interrupt, since it is *sampled* from
-		 * the clock interrupt, so if we did, all system
-		 * time would be counted as interrupt time.
-		 */
+		atomic_inc_ulong(&ci->ci_intrdepth);
 		sc->sc_evcnt_clock.ev_count++;
 		ci->ci_data.cpu_nintr++;
 		if (platform.clockintr) {
@@ -242,6 +237,7 @@ interrupt(unsigned long a0, unsigned lon
 			    schedhz != 0)
 				schedclock(ci->ci_curlwp);
 		}
+		atomic_dec_ulong(&ci->ci_intrdepth);
 		break;
 
 	case ALPHA_INTR_ERROR:	/* Machine Check or Correctable Error */

Reply via email to