From owner-freebsd-current@FreeBSD.ORG Wed Sep 9 19:08:55 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BFE11065670; Wed, 9 Sep 2009 19:08:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2BDA08FC08; Wed, 9 Sep 2009 19:08:55 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id CC9BD46B2C; Wed, 9 Sep 2009 15:08:54 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 1FC708A01B; Wed, 9 Sep 2009 15:08:54 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 9 Sep 2009 14:53:50 -0400 User-Agent: KMail/1.9.7 References: <179b97fb0905301355n2a422e05j665fc3a551ce06f1@mail.gmail.com> <4AA7EAB2.5040403@googlemail.com> <200909091425.15003.jkim@FreeBSD.org> In-Reply-To: <200909091425.15003.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909091453.50771.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 09 Sep 2009 15:08:54 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Brandon Gooch , bzeeb+freebsd+lor@zabbadoz.net, Felix Stolba , Jung-uk Kim Subject: Re: LOR acpi_ibm module X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 09 Sep 2009 19:08:55 -0000 On Wednesday 09 September 2009 2:25:13 pm Jung-uk Kim wrote: > On Wednesday 09 September 2009 01:49 pm, Felix Stolba wrote: > > Brandon Gooch schrieb: > > > lock order reversal: > > > 1st 0xffffffff807cf200 sysctl lock (sysctl lock) @ > > > /usr/src/sys/kern/kern_sysctl.c:1608 > > > 2nd 0xffffffff80bf1de0 ACPI IBM extras (ACPI IBM extras) @ > > > /usr/src/sys/modules/acpi/acpi_ibm/../../../dev/acpi_support/acpi > > >_ibm.c:481 KDB: stack backtrace: > > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > > > _witness_debugger() at _witness_debugger+0x2e > > > witness_checkorder() at witness_checkorder+0x81e > > > _sx_xlock() at _sx_xlock+0x54 > > > acpi_ibm_sysctl() at acpi_ibm_sysctl+0x4f > > > sysctl_root() at sysctl_root+0xe3 > > > userland_sysctl() at userland_sysctl+0x158 > > > __sysctl() at __sysctl+0xaa > > > syscall() at syscall+0x1dd > > > Xfast_syscall() at Xfast_syscall+0xd0 > > > --- syscall (202, FreeBSD ELF64, __sysctl), rip = 0x80073769c, > > > rsp = 0x7fffffffda58, rbp = 0x4 --- > > > > I'm getting the same LOR at boot in 9.0-current (source from 7th of > > september). > > It is generally harmless but really annoying. Actually, we can just remove the pointless locking from attach to fix this I think. You don't need locking in attach while you are adding the sysctls, etc. since no other threads can "get" to the acpi_ibm data yet. This patch should fix the LOR: Index: acpi_ibm.c =================================================================== --- acpi_ibm.c (revision 196974) +++ acpi_ibm.c (working copy) @@ -356,8 +356,6 @@ } sc->ec_handle = acpi_get_handle(sc->ec_dev); - ACPI_SERIAL_BEGIN(ibm); - /* Get the sysctl tree */ sc->sysctl_ctx = device_get_sysctl_ctx(dev); sc->sysctl_tree = device_get_sysctl_tree(dev); @@ -404,8 +402,6 @@ "Thermal zones"); } - ACPI_SERIAL_END(ibm); - /* Handle notifies */ AcpiInstallNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY, acpi_ibm_notify, dev); -- John Baldwin