diff options
author | jhb <jhb@FreeBSD.org> | 2013-04-22 15:51:06 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-04-22 15:51:06 +0000 |
commit | d02e1b36465a2517156de473b270f17a1a408408 (patch) | |
tree | c2d3c4188e64d309f9a2a15c6a09acd3cbc5f1a3 /sys/dev/acpica | |
parent | 4373fbb501b6b8d794e42adb82c98df282ba17f7 (diff) | |
download | FreeBSD-src-d02e1b36465a2517156de473b270f17a1a408408.zip FreeBSD-src-d02e1b36465a2517156de473b270f17a1a408408.tar.gz |
- 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.
Tested by: Benjamin Lee <ben@b1c1l1.com>
MFC after: 2 weeks
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi.c | 4 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pci_link.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index f0c750f..da252c4 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2334,7 +2334,7 @@ acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res) 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); @@ -2384,7 +2384,7 @@ acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res) /* 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); } diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index 1a1ae4d..3b853b6 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -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 *context) ("%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 *context) 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) |