From owner-freebsd-acpi@FreeBSD.ORG Fri Apr 19 17:48:47 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 28A09714 for ; Fri, 19 Apr 2013 17:48:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id C266E884 for ; Fri, 19 Apr 2013 17:48:46 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 244EEB917; Fri, 19 Apr 2013 12:29:04 -0400 (EDT) From: John Baldwin To: freebsd-acpi@freebsd.org Subject: Re: panic: acpi_pci_link_srs_from_crs: can't put non-ISA IRQ 20 in legacy IRQ resource type) Date: Fri, 19 Apr 2013 11:31:49 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <20130418124940.47e3618a@b1c1l1.com> In-Reply-To: <20130418124940.47e3618a@b1c1l1.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201304191131.49433.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 19 Apr 2013 12:29:04 -0400 (EDT) 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 17:48:47 -0000 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 with many > ACPI error messages and non-functional devices with 9.1-RELEASE. > > Motherboard is Foxconn C51XEM2AA (NVIDIA nForce 590) desktop board. > > Here is the panic on 10-CURRENT: > > 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 > panic: acpi_pci_link_srs_from_crs: can't put non-ISA IRQ 20 in legacy IRQ resource type > cpuid = 0 > KDB: enter: panic > [ thread pid 0 tid 100000 ] > Stopped at kdb_enter+0x3e: movq $0,kdb_why > db> bt > Tracing pid 0 tid 100000 td 0xffffffff814f9810 > kdb_enter() at kdb_enter+0x3e/frame 0xffffffff818344a0 > vpanic() at vpanic+0x146/frame 0xffffffff818344e0 > kassert_panic() at kassert_panic+0x136/frame 0xffffffff81834550 > acpi_pci_link_route_irqs() at acpi_pci_link_route_irqs+0x2b6/frame 0xffffffff81834600 > acpi_pci_link_route_interrupt() at acpi_pci_link_route_interrupt+0x422/frame 0xffffffff818346a0 > acpi_pcib_route_interrupt() at acpi_pcib_route_interrupt+0x4cd/frame 0xffffffff81834700 > pci_assign_interrupt() at pci_assign_interrupt+0xef/frame 0xffffffff81834790 > pci_add_resources() at pci_add_resources+0x653/frame 0xffffffff81834840 > pci_add_children() at pci_add_children+0x18a/frame 0xffffffff818348a0 > acpi_pci_attach() at acpi_pci_attach+0xd5/frame 0xffffffff818348f0 > device_attach() at device_attach+0x396/frame 0xffffffff81834940 > bus_generic_attach() at bus_generic_attach+0x4a/frame 0xffffffff81834960 > acpi_pcib_attach() at acpi_pcib_attach+0x24d/frame 0xffffffff818349b0 > acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x299/frame 0xffffffff81834a00 > device_attach() at device_attach+0x396/frame 0xffffffff81834a50 > bus_generic_attach() at bus_generic_attach+0x4a/frame 0xffffffff81834a70 > acpi_attach() at acpi_attach+0xdd6/frame 0xffffffff81834b30 > device_attach() at device_attach+0x396/frame 0xffffffff81834b80 > bus_generic_attach() at bus_generic_attach+0x4a/frame 0xffffffff81834ba0 > nexus_acpi_attach() at nexus_acpi_attach+0x76/frame 0xffffffff81834bd0 > device_attach() at device_attach+0x396/frame 0xffffffff81834c20 > bus_generic_new_pass() at bus_generic_new_pass+0x116/frame 0xffffffff81834c50 > bus_set_pass() at bus_set_pass+0x8f/frame 0xffffffff81834c80 > configure() at configure+0xa/frame 0xffffffff81834c90 > mi_startup() at mi_startup+0x118/frame 0xffffffff81834cb0 > btext() at btext+0x2c > > And here is an example of the ACPI error messages on 9.1-RELEASE: > > 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 > ACPI Error: Field [INZ6] at 56 exceeds Buffer [NULL] size 48 (bits) (20110527/ds > opcode-254) > ACPI Error: Method parse/execution failed [\_SB_.PCI0.SRSA] (Node 0xfffffe0002d9 > 8b00), AE_AML_BUFFER_LIMIT (20110527/psparse-560) > ACPI Error: Method parse/execution failed [\_SB_.PCI0.AUBA._SRS] (Node 0xfffffe0 > 002d9d400), AE_AML_BUFFER_LIMIT (20110527/psparse-560) > pci_link26: Unable to route IRQs: AE_AML_BUFFER_LIMIT > > Even though 9.1-RELEASE boots successfully, devices such as the ehci USB > controller and SATA controller do not work. Ugh, your BIOS does unexpected things. It uses a _CRS for these pci link devices that uses a "short" IRQ resource, but uses an extended IRQ resource in _PRS (and expects an extended one in _SRS). We use _CRS as a template for the resource to build. Try this patch. It's a bit hackish, but it forces us to not use _CRS as a template if _CRS uses a "short" IRQ resource, but the link supports non-ISA IRQs. Index: /home/jhb/work/freebsd/svn/head/sys/dev/acpica/acpi_pci_link.c =================================================================== --- /home/jhb/work/freebsd/svn/head/sys/dev/acpica/acpi_pci_link.c (revision 249553) +++ /home/jhb/work/freebsd/svn/head/sys/dev/acpica/acpi_pci_link.c (working copy) @@ -99,6 +99,7 @@ uint8_t l_bios_irq; uint8_t l_irq; uint8_t l_initial_irq; + UINT32 l_crs_type; int l_res_index; int l_num_irqs; int *l_irqs; @@ -236,6 +237,7 @@ ("%s: array boundary violation", __func__)); link = &req->sc->pl_links[req->link_index]; link->l_res_index = req->res_index; + link->l_crs_type = res->Type; req->link_index++; req->res_index++; @@ -364,6 +366,14 @@ link->l_isa_irq = FALSE; } } + + /* + * If this is not an ISA IRQ but _CRS used a non-extended + * IRQ descriptor, don't use _CRS as a template for _SRS. + */ + if (!req->sc->pl_crs_bad && !link->l_isa_irq && + link->l_crs_type == ACPI_RESOURCE_TYPE_IRQ) + req->sc->pl_crs_bad = TRUE; break; default: if (req->in_dpf == DPF_IGNORE) -- John Baldwin