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
This commit is contained in:
Hans Petter Selasky 2015-01-02 13:10:33 +00:00
parent f515135ff9
commit 2029b6c9e6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276532

View File

@ -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;
}