From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 14 18:42:09 2013 Return-Path: Delivered-To: svn-src-stable-8@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 C60E4913; Fri, 14 Jun 2013 18:42:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9FDD911F5; Fri, 14 Jun 2013 18:42:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5EIg9cE030123; Fri, 14 Jun 2013 18:42:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5EIg9KV030121; Fri, 14 Jun 2013 18:42:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306141842.r5EIg9KV030121@svn.freebsd.org> From: John Baldwin Date: Fri, 14 Jun 2013 18:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251755 - stable/8/sys/dev/acpica X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 18:42:09 -0000 Author: jhb Date: Fri Jun 14 18:42:08 2013 New Revision: 251755 URL: http://svnweb.freebsd.org/changeset/base/251755 Log: MFC 249767: - Some BIOSes use an Extended IRQ resource descriptor in _PRS for a link that uses non-ISA IRQs but use a plain IRQ resource in _CRS. However, a non-ISA IRQ can't fit into a plain IRQ resource. If we encounter a link like this, build the resource buffer from _PRS instead of _CRS. - Set the correct size of the end tag in a resource buffer. Modified: stable/8/sys/dev/acpica/acpi.c stable/8/sys/dev/acpica/acpi_pci_link.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/acpica/ (props changed) Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Fri Jun 14 18:30:43 2013 (r251754) +++ stable/8/sys/dev/acpica/acpi.c Fri Jun 14 18:42:08 2013 (r251755) @@ -2198,7 +2198,7 @@ acpi_AppendBufferResource(ACPI_BUFFER *b return (AE_NO_MEMORY); rp = (ACPI_RESOURCE *)buf->Pointer; rp->Type = ACPI_RESOURCE_TYPE_END_TAG; - rp->Length = 0; + rp->Length = ACPI_RS_SIZE_MIN; } if (res == NULL) return (AE_OK); @@ -2248,7 +2248,7 @@ acpi_AppendBufferResource(ACPI_BUFFER *b /* And add the terminator. */ rp = ACPI_NEXT_RESOURCE(rp); rp->Type = ACPI_RESOURCE_TYPE_END_TAG; - rp->Length = 0; + rp->Length = ACPI_RS_SIZE_MIN; return (AE_OK); } Modified: stable/8/sys/dev/acpica/acpi_pci_link.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_pci_link.c Fri Jun 14 18:30:43 2013 (r251754) +++ stable/8/sys/dev/acpica/acpi_pci_link.c Fri Jun 14 18:42:08 2013 (r251755) @@ -99,6 +99,7 @@ struct link { 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 @@ link_add_crs(ACPI_RESOURCE *res, void *c ("%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_add_prs(ACPI_RESOURCE *res, void *c 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)