From owner-freebsd-acpi@FreeBSD.ORG Fri Apr 19 22:51:27 2013 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC49788A; Fri, 19 Apr 2013 22:51:27 +0000 (UTC) (envelope-from ben@b1c1l1.com) Received: from lancer.b1c1l1.com (lancer.b1c1l1.com [IPv6:2607:f358:1a:1a:1000::]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2C42FD; Fri, 19 Apr 2013 22:51:27 +0000 (UTC) Received: by lancer.b1c1l1.com (Postfix) with ESMTPSA id DBA055C21; Fri, 19 Apr 2013 15:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=b1c1l1.com; s=default; t=1366411887; bh=bA/LBsR34QA9b7/j/oX8gV3/kug3WTUVJjGb06Ik2es=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=5/2fzQMBBN22OWJZ00neAVt+7TNHNhAWF4cmxu9nqbgr4TQU27q9P63rTTFXMyoM+ OqZ481YRAnTj7RCs1SGwaXZ/wiVOfL8NxKDjUPiP0J1VHteNFBAw1Ds5yqFn17+c6S CSBbH+8lAdoNhs4+APWhQP5+tM1oY0GscyHbyoPI= Date: Fri, 19 Apr 2013 15:51:18 -0700 From: Benjamin Lee To: John Baldwin Subject: Re: panic: acpi_pci_link_srs_from_crs: can't put non-ISA IRQ 20 in legacy IRQ resource type) Message-ID: <20130419155118.7bafe9fc@b1c1l1.com> In-Reply-To: <20130419152110.213c7fbb@b1c1l1.com> References: <20130418124940.47e3618a@b1c1l1.com> <201304191131.49433.jhb@freebsd.org> <20130419131849.7357c8f6@b1c1l1.com> <201304191726.31089.jhb@freebsd.org> <20130419152110.213c7fbb@b1c1l1.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.17; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/rwA=b0KcrRKP8AQ8c.pb2pJ"; protocol="application/pgp-signature" Cc: freebsd-acpi@freebsd.org X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 22:51:27 -0000 --Sig_/rwA=b0KcrRKP8AQ8c.pb2pJ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 19 Apr 2013 15:21:10 -0700, Benjamin Lee wrote: > On Fri, 19 Apr 2013 17:26:31 -0400, John Baldwin wrote: > > On Friday, April 19, 2013 4:18:49 pm Benjamin Lee wrote: > > > On Fri, 19 Apr 2013 11:31:49 -0400, John Baldwin wr= ote: > > > > On Thursday, April 18, 2013 3:49:40 pm Benjamin Lee wrote: > > > > > I have a system that panics on boot with 10-CURRENT and boots wit= h many > > > > > ACPI error messages and non-functional devices with 9.1-RELEASE. > > > > >=20 > > > > > Motherboard is Foxconn C51XEM2AA (NVIDIA nForce 590) desktop boar= d. > > > [...] > > > > > Even though 9.1-RELEASE boots successfully, devices such as the e= hci USB > > > > > controller and SATA controller do not work. > > > >=20 > > > > Ugh, your BIOS does unexpected things. It uses a _CRS for these pc= i link > > > > devices that uses a "short" IRQ resource, but uses an extended IRQ= =20 > > resource in > > > > _PRS (and expects an extended one in _SRS). We use _CRS as a templ= ate for=20 > > the > > > > resource to build. > > > >=20 > > > > Try this patch. It's a bit hackish, but it forces us to not use _C= RS as a > > > > template if _CRS uses a "short" IRQ resource, but the link supports= non- > > ISA > > > > IRQs. > > > [...] > > >=20 > > > Thanks, that fixed the panic and the system boots. Now it is > > > complaining about AE_AML_BAD_RESOURCE_LENGTH and still unable to route > > > IRQs, but it definitely looks better than the ACPI parsing errors in = 9: > > >=20 > > > pcib0: allocated type 3 (0xdffff000-0xdfffffff) for rid 10 of pci0:0:= 10:0 > > > pcib0: matched entry for 0.10.INTA (src \_SB_.PCI0.AUBA:0) > > > pci_link26: Picked IRQ 20 with weight 0 > > > pci_link26: Unable to route IRQs: AE_AML_BAD_RESOURCE_LENGTH > > >=20 > > > Full boot -v output: http://www.b1c1l1.com/media/debug/20130419-10-pa= tched- > > boot.txt.gz > >=20 > > Can you add some printfs to the places that return the=20 > > AE_AML_BAD_RESOURCE_LENGTH to see which one is being triggered? (Just = look=20 > > for that constant in sys/contrib/dev/acpica to find the possible places= .) >=20 > Is there a macro for dumping information about Resource or > Resource->Data? Here's what I have for now at > sys/contrib/dev/acpica/resources/rscalc.c line 237: >=20 > pcib0: matched entry for 0.10.INTA (src \_SB_.PCI0.AUBA:0) > pci_link26: Picked IRQ 20 with weight 0 > rscalc.c:237 > Resource->Type: 7 > Resource->Length: 0 > pci_link26: Unable to route IRQs: AE_AML_BAD_RESOURCE_LENGTH >=20 > All of the errors are from there and look identical (Type 7, Length 0). > Type 7 appears to be ACPI_RESOURCE_TYPE_END_TAG. This hack fixes everything (now the SATA controller works). It seems that the Resource->Length check might not be necessary for ACPI_RESOURCE_TYPE_END_TAG. blee@genesis /usr/src/sys/contrib/dev/acpica $ svn diff Index: components/resources/rscalc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- components/resources/rscalc.c (revision 249624) +++ components/resources/rscalc.c (working copy) @@ -234,6 +234,15 @@ =20 if (!Resource->Length) { + if (Resource->Type =3D=3D ACPI_RESOURCE_TYPE_END_TAG) { + TotalSize =3D AcpiGbl_AmlResourceSizes [Resource->Type]; + printf("TotalSize: %u\n", TotalSize); + if (TotalSize !=3D 0) { + printf("ACPI_RESOURCE_TYPE_END_TAG hack\n"); + *SizeNeeded =3D AmlSizeNeeded + TotalSize; + return_ACPI_STATUS (AE_OK); + } + } return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH); } =20 Index: components/resources/rslist.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- components/resources/rslist.c (revision 249624) +++ components/resources/rslist.c (working copy) @@ -203,6 +203,11 @@ =20 if (!Resource->Length) { + if (Resource->Type =3D=3D ACPI_RESOURCE_TYPE_END_TAG) { + printf("ACPI_RESOURCE_TYPE_END_TAG hack 2\n"); + return_ACPI_STATUS (AE_OK); + } + ACPI_ERROR ((AE_INFO, "Invalid zero length descriptor in resource list\n")); return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH); --=20 Benjamin Lee http://www.b1c1l1.com/ --Sig_/rwA=b0KcrRKP8AQ8c.pb2pJ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJRccptAAoJEHpz6H1iC6qDbf8P/imziMzhEbnH6yHQYHv1EAvY FX40jDjYFcF5uPFkzuqvzWxPg5xdEFNmrWgwYAhUMJQWRPrPHO71Mr4VCJMxJsSD LuMXxFzvVsbic2gDrKiqps+mvRpqWX0pBEPxA2+1aYD9NRruv5+HORmpwRhA3BrK 2RD43aKIcElf/IvOJ/cjARBXcET3IXg7Kls9IpqPjbMpdBMfTSQdOspoZm+BU4b6 YqOSx0JQrX4jGG3o2yPA9zq7dHiPaJk9MWofV0fXz+SRTrtBP8jQvoruCmJD6OL1 URMMKZdnnDQx/EQT7tKTgPDDcF99I+EHyllU3HkcYV6NLS9T7EcOJ8sjYiQUvBsN KSmn3rCmXq3Vg3v8uZD5pdZLvjPZtrQxHMqI2gLeOMq2+LEqHQoy9VIjc36wCCK3 rCw2oTQHIWpXahNf2VJHUxoDgEV22QBaqpl7WR6J+FN8ku8LXeOgjMKMC6MGAjNm X7DM1Wte4gJuf9PlAGvN7s8t2WSMcKwA+h2HNX/m8SejZnoInOsgjWnuauQA/Fzm V9cojomow32jzk8k5OBvq9/PDv19YwIdEtjZKemQxifvfOeT1Fw6lhjzp2xeXxuX fDeLv/Q3FI8rFWDEgDe+IwqmEKTm+uSlg/oZJxs20bygHJnN4bBupzhSmsYp6uvF 3CPktq11mzIDS42/IbHc =XzxK -----END PGP SIGNATURE----- --Sig_/rwA=b0KcrRKP8AQ8c.pb2pJ--