Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jan 2015 13:10:34 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276532 - head/sys/kern
Message-ID:  <201501021310.t02DAYhn001838@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Jan  2 13:10:33 2015
New Revision: 276532
URL: https://svnweb.freebsd.org/changeset/base/276532

Log:
  The "cnputs_mtx" mutex must be allowed to recurse. Debug prints and/or
  witness printouts in the console driver clients can cause this mutex
  to recurse by calls to "printf()" from witness for example. In
  particular this can happen if "debug.witness.skipspin=0" is set in the
  boot environment.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_cons.c

Modified: head/sys/kern/kern_cons.c
==============================================================================
--- head/sys/kern/kern_cons.c	Fri Jan  2 08:57:36 2015	(r276531)
+++ head/sys/kern/kern_cons.c	Fri Jan  2 13:10:33 2015	(r276532)
@@ -601,7 +601,13 @@ static void
 cn_drvinit(void *unused)
 {
 
-	mtx_init(&cnputs_mtx, "cnputs_mtx", NULL, MTX_SPIN | MTX_NOWITNESS);
+	/*
+	 * NOTE: Debug prints and/or witness printouts in console
+	 * driver clients can cause the "cnputs_mtx" mutex to
+	 * recurse. Make sure the "MTX_RECURSE" flags is set!
+	 */
+	mtx_init(&cnputs_mtx, "cnputs_mtx", NULL, MTX_SPIN |
+	    MTX_NOWITNESS | MTX_RECURSE);
 	use_cnputs_mtx = 1;
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501021310.t02DAYhn001838>