From owner-freebsd-current@FreeBSD.ORG Mon May 6 07:27:52 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB7F19A for ; Mon, 6 May 2013 07:27:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 668FD6B2 for ; Mon, 6 May 2013 07:27:51 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r467RX5U071119; Mon, 6 May 2013 11:27:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r467RX4Y071118; Mon, 6 May 2013 11:27:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 6 May 2013 11:27:33 +0400 From: Gleb Smirnoff To: devel@stasyan.com, Rainer Hurling , "O. Hartmann" Subject: Re: kernel panic with _autoload_ nvidia driver Message-ID: <20130506072733.GP15182@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <1367820738.1648.7.camel@thor.walstatt.dyndns.org> <5185FD5D.1090502@gwdg.de> <20130505100100.62750v3fqplti0t8@webmail01.providersolutions.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 07:27:52 -0000 --+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--