From 3052da8bb3bc71200f272ccf3b40af0e7b798675 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 27 Oct 2007 14:54:43 +0000 Subject: [PATCH] Don't destroy an ACPI device_t for a PCI device and reassign the ACPI handle to the PCI device_t if the ACPI device_t is already attached to a driver. This happens on the Tablet TC1000 which for some reason includes two PCI-ISA bridges and treats the second bridge as an ACPI system resource device. Reviewed by: njl (a while ago) MFC after: 3 days --- sys/dev/acpica/acpi_pci.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c index ed22417c90f..607691c7091 100644 --- a/sys/dev/acpica/acpi_pci.c +++ b/sys/dev/acpica/acpi_pci.c @@ -208,8 +208,19 @@ acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child) */ child = acpi_get_device(handle); if (child != NULL) { - KASSERT(!device_is_alive(child), ("%s: deleting alive child %s", - __func__, device_get_nameunit(child))); + if (device_is_alive(child)) { + /* + * The TabletPC TC1000 has a second PCI-ISA bridge + * that has a _HID for an acpi_sysresource device. + * In that case, leave ACPI-CA's device data pointing + * at the ACPI-enumerated device. + */ + device_printf(child, + "Conflicts with PCI device %d:%d:%d\n", + pci_get_bus(pci_child), pci_get_slot(pci_child), + pci_get_function(pci_child)); + return; + } KASSERT(device_get_parent(child) == devclass_get_device(devclass_find("acpi"), 0), ("%s: child (%s)'s parent is not acpi0", __func__,