Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern timecounter(9): Zero the next pointer after tc_detach.



details:   https://anonhg.NetBSD.org/src/rev/87fc278c178b
branches:  trunk
changeset: 379487:87fc278c178b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jun 02 21:34:58 2021 +0000

description:
timecounter(9): Zero the next pointer after tc_detach.

This reverts it to a state where tc_init works again.

diffstat:

 sys/kern/kern_tc.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 6e5f964b5bc9 -r 87fc278c178b sys/kern/kern_tc.c
--- a/sys/kern/kern_tc.c        Wed Jun 02 17:56:40 2021 +0000
+++ b/sys/kern/kern_tc.c        Wed Jun 02 21:34:58 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.61 2021/04/08 06:20:47 simonb Exp $ */
+/* $NetBSD: kern_tc.c,v 1.62 2021/06/02 21:34:58 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.61 2021/04/08 06:20:47 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.62 2021/06/02 21:34:58 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ntp.h"
@@ -698,10 +698,13 @@ tc_detach(struct timecounter *target)
                 * before retrying.
                 */
                if (l == NULL) {
-                       return 0;
+                       break;
                }
                (void)kpause("tcdetach", false, mstohz(10), NULL);
        }
+
+       tc->tc_next = NULL;
+       return 0;
 }
 
 /* Report the frequency of the current timecounter. */



Home | Main Index | Thread Index | Old Index