Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 May 2013 11:27:33 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        devel@stasyan.com, Rainer Hurling <rhurlin@gwdg.de>, "O. Hartmann" <ohartman@zedat.fu-berlin.de>
Cc:        freebsd-current@freebsd.org
Subject:   Re: kernel panic with _autoload_ nvidia driver
Message-ID:  <20130506072733.GP15182@FreeBSD.org>
In-Reply-To: <1367820738.1648.7.camel@thor.walstatt.dyndns.org> <5185FD5D.1090502@gwdg.de> <20130505100100.62750v3fqplti0t8@webmail01.providersolutions.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline

On Sun, May 05, 2013 at 10:01:00AM +0400, devel@stasyan.com wrote:
d>        Hello !
d> 
d>    This problems appears about 4-6 months ago after updating of -CURRENT host.
d> Unable to boot host with nvidia_load="YES" in loader.conf because panic.
d> But when nvidia driver loads manually via kldload, everything OK.
d> Nvidia driver version is 310.44 at this moment, but problem was and on  
d> earlier version too.
d> 
d> Here is output of debugging (full version at  
d> http://www.stasyan.com/devel/kern_crash_nvidia_autoload.txt)

Can you please try the attached patch to kernel?

-- 
Totus tuus, Glebius.

--+QahgC5+KEYLbs62
Content-Type: text/x-diff; charset=koi8-r
Content-Disposition: attachment; filename="kern_sysctl.c.diff"

Index: kern/kern_sysctl.c
===================================================================
--- kern/kern_sysctl.c	(revision 249327)
+++ kern/kern_sysctl.c	(working copy)
@@ -1406,7 +1406,7 @@ static int
 sysctl_root(SYSCTL_HANDLER_ARGS)
 {
 	struct sysctl_oid *oid;
-	int error, indx, lvl;
+	int error, indx, lvl, giantlocked;
 
 	SYSCTL_ASSERT_XLOCKED();
 
@@ -1488,10 +1488,13 @@ sysctl_root(SYSCTL_HANDLER_ARGS)
 	oid->oid_running++;
 	SYSCTL_XUNLOCK();
 
-	if (!(oid->oid_kind & CTLFLAG_MPSAFE))
+	if (!(oid->oid_kind & CTLFLAG_MPSAFE)) {
+		giantlocked = 1;
 		mtx_lock(&Giant);
+	} else
+		giantlocked = 0;
 	error = oid->oid_handler(oid, arg1, arg2, req);
-	if (!(oid->oid_kind & CTLFLAG_MPSAFE))
+	if (giantlocked)
 		mtx_unlock(&Giant);
 
 	KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error);

--+QahgC5+KEYLbs62--



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