From owner-freebsd-current@freebsd.org Tue Aug 13 13:31:53 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF21EAF956 for ; Tue, 13 Aug 2019 13:31:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 467DCD5y7Xz3LwV; Tue, 13 Aug 2019 13:31:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8021C2603E1; Tue, 13 Aug 2019 15:31:50 +0200 (CEST) Subject: Re: Boot still broken from r349133-r349160 - Was re:(Problem with USB after r349133) To: Scott Long , Nick Wolff Cc: "Clay Daniels Jr." , "Rodney W. Grimes" , lausts@acm.org, freebsd-current@freebsd.org, Jung-uk Kim References: <201907300011.x6U0BO8w046636@gndrsh.dnsmgr.net> From: Hans Petter Selasky Message-ID: <98c2c54e-6d77-4cca-78d5-fcffeb65b80c@selasky.org> Date: Tue, 13 Aug 2019 15:31:09 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 467DCD5y7Xz3LwV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.96 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; SUSPICIOUS_RECIPS(1.50)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-3.19)[ip: (-9.35), ipnet: 88.99.0.0/16(-4.74), asn: 24940(-1.83), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; FREEMAIL_CC(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 13 Aug 2019 13:31:54 -0000 Hi, After tearing ACPI apart, there appears to be an issue like following: 1) AcpiUtAcquireMutex() doesn't support recursion, but also fails to report an error when such a condition is occurring. Here is the backtrace of the illegal mutex recursion. > AcpiUtAcquireMutex() at AcpiUtAcquireMutex+0x1fc/frame 0xffffffff834815d0 > AcpiWalkNamespace() at AcpiWalkNamespace+0x8a/frame 0xffffffff83481640 > AcpiNsInitializeObjects() at AcpiNsInitializeObjects+0x9b/frame 0xffffffff834816c0 > AcpiExLoadTableOp() at AcpiExLoadTableOp+0x21c/frame 0xffffffff83481730 > AcpiExOpcode_6A_0T_1R() at AcpiExOpcode_6A_0T_1R+0x22e/frame 0xffffffff83481790 > AcpiDsExecEndOp() at AcpiDsExecEndOp+0x1dc/frame 0xffffffff83481830 > AcpiPsParseLoop() at AcpiPsParseLoop+0x75a/frame 0xffffffff83481880 > AcpiPsParseAml() at AcpiPsParseAml+0xfd/frame 0xffffffff834818d0 > AcpiPsExecuteMethod() at AcpiPsExecuteMethod+0x27d/frame 0xffffffff83481940 > AcpiNsEvaluate() at AcpiNsEvaluate+0x336/frame 0xffffffff834819b0 > AcpiEvaluateObject() at AcpiEvaluateObject+0x223/frame 0xffffffff83481a10 > AcpiEvaluateObjectTyped() at AcpiEvaluateObjectTyped+0xe0/frame 0xffffffff83481aa0 > acpi_EvaluateOSC() at acpi_EvaluateOSC+0xef/frame 0xffffffff83481b90 > acpi_cpu_attach() at acpi_cpu_attach+0x432/frame 0xffffffff83481cb0 > DEVICE_ATTACH() at DEVICE_ATTACH+0x87/frame 0xffffffff83481cf0 > device_attach() at device_attach+0xb9/frame 0xffffffff83481d80 > device_probe_and_attach() at device_probe_and_attach+0x106/frame 0xffffffff83481dc0 > bus_generic_attach() at bus_generic_attach+0x2c/frame 0xffffffff83481df0 > acpi_probe_children() at acpi_probe_children+0x77/frame 0xffffffff83481e30 > acpi_attach() at acpi_attach+0xbfe/frame 0xffffffff83482050 > DEVICE_ATTACH() at DEVICE_ATTACH+0x87/frame 0xffffffff83482090 > device_attach() at device_attach+0xb9/frame 0xffffffff83482120 > device_probe_and_attach() at device_probe_and_attach+0x106/frame 0xffffffff83482160 > bus_generic_attach() at bus_generic_attach+0x2c/frame 0xffffffff83482190 > nexus_acpi_attach() at nexus_acpi_attach+0x59/frame 0xffffffff834821b0 > DEVICE_ATTACH() at DEVICE_ATTACH+0x87/frame 0xffffffff834821f0 > device_attach() at device_attach+0xb9/frame 0xffffffff83482280 > device_probe_and_attach() at device_probe_and_attach+0x106/frame 0xffffffff834822c0 > bus_generic_new_pass() at bus_generic_new_pass+0xb5/frame 0xffffffff83482300 > BUS_NEW_PASS() at BUS_NEW_PASS+0x87/frame 0xffffffff83482340 > bus_set_pass() at bus_set_pass+0x8f/frame 0xffffffff83482360 > root_bus_configure() at root_bus_configure+0xe/frame 0xffffffff83482370 > configure() at configure+0x11/frame 0xffffffff83482390 > mi_startup() at mi_startup+0x2dc/frame 0xffffffff834823f0 > btext() at btext+0x2c > ACPI Error: AE_ALREADY_ACQUIRED, During WalkNamespace (20190703/nsinit-232) The illegal mutex recursion ends up leaking a lock, which later on causes a boot deadlock due to accesses to ACPI hanging forever. 2) This patch works around the issue. > diff --git a/sys/contrib/dev/acpica/components/utilities/utmutex.c b/sys/contrib/dev/acpica/components/utilities/utmutex.c > index 4853bf5c3a6..33a67a731c6 100644 > --- a/sys/contrib/dev/acpica/components/utilities/utmutex.c > +++ b/sys/contrib/dev/acpica/components/utilities/utmutex.c > @@ -378,6 +378,16 @@ AcpiUtAcquireMutex ( > > ThisThreadId = AcpiOsGetThreadId (); > > + if (AcpiGbl_MutexInfo[MutexId].ThreadId == ThisThreadId) > + { > + ACPI_ERROR ((AE_INFO, > + "Mutex [%s] already acquired by this thread [%u]", > + AcpiUtGetMutexName (MutexId), > + (UINT32) ThisThreadId)); > + > + return (AE_ALREADY_ACQUIRED); > + } > + > #ifdef ACPI_MUTEX_DEBUG > { > UINT32 --HPS On 2019-08-01 15:58, Scott Long wrote: > I’m 99% sure that the boot breakage is due to this commit: > > Author: jkim > Date: Tue Jul 9 18:02:36 2019 > New Revision: 349863 > URL: https://svnweb.freebsd.org/changeset/base/349863 > > Log: > MFV: r349861 > > Import ACPICA 20190703. > > I have two systems now that are affected, and both of them > are “fixed” by reverting this. I don’t know the root cause yet, > see my email to the svn-src-all mailing list. >