Module Name:    src
Committed By:   martin
Date:           Sat Aug 29 17:02:36 UTC 2020

Modified Files:
        src/sys/arch/alpha/alpha [netbsd-9]: prom.c

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #1069):

        sys/arch/alpha/alpha/prom.c: revision 1.52

Make sure init_prom_interface() only runs once, otherwise we initialize
a mutex twice, and that upsets LOCKDEBUG.  But instead of seeing a
proper message about it, the output happens before the PROM console
interfcace is initialized, we would end up with a translation fault
back into SRM.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.4.1 src/sys/arch/alpha/alpha/prom.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/prom.c
diff -u src/sys/arch/alpha/alpha/prom.c:1.50 src/sys/arch/alpha/alpha/prom.c:1.50.4.1
--- src/sys/arch/alpha/alpha/prom.c:1.50	Mon Sep  3 16:29:22 2018
+++ src/sys/arch/alpha/alpha/prom.c	Sat Aug 29 17:02:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.50 2018/09/03 16:29:22 riastradh Exp $ */
+/* $NetBSD: prom.c,v 1.50.4.1 2020/08/29 17:02:36 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1994, 1995, 1996 Carnegie Mellon University
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.50 2018/09/03 16:29:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: prom.c,v 1.50.4.1 2020/08/29 17:02:36 martin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -78,6 +78,11 @@ prom_lev1map(void)
 void
 init_prom_interface(struct rpb *rpb)
 {
+	static bool prom_interface_initialized;
+
+	if (prom_interface_initialized)
+		return;
+
 	struct crb *c;
 
 	c = (struct crb *)((char *)rpb + rpb->rpb_crb_off);
@@ -86,6 +91,7 @@ init_prom_interface(struct rpb *rpb)
 	prom_dispatch_v.routine = c->crb_v_dispatch->entry_va;
 
 	mutex_init(&prom_lock, MUTEX_DEFAULT, IPL_HIGH);
+	prom_interface_initialized = true;
 }
 
 void

Reply via email to