This diff fixes a panic seen on Dell PEx9xx servers with the new ACPI PCI 
mapping.
The _INI code was resetting the _ADR to 0xFFFFFFFF on some systems if the PCI 
bus
does not exist.  This caused the pci_make_tag to panic as dev/fn were 0xFFFF.

The second change is in acpiprt.. a panic was put in place to detect mismatch
between the old and new methods of determining the _PRT bus.  I noticed on the
PEx9xx that the old code is getting an incorrect bus # (0) when it should be -1.

Please test this on server platforms (Dell Rxxx, Txxx) and report dmesg if you 
see 'bus mismatch'


acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 4 (PEX2)
acpiprt2 at acpi0: bus 5 (UPST)
acpiprt3 at acpi0: bus 6 (DWN1)
acpiprt4 at acpi0: bus 8 (DWN2)
acpiprt5 at acpi0: bus 1 (PEX3)
acpiprt6 at acpi0: bus 0 (PE2P)\\_SB_.PCI0.PEX3.PE2P._PRT: bus mismatch, new:-1 
old:0
acpiprt7 at acpi0: bus 10 (PEX4)
acpiprt8 at acpi0: bus 12 (PEX6)
acpiprt9 at acpi0: bus 13 (PXHA)
acpiprt10 at acpi0: bus 14 (PXHB)
acpiprt11 at acpi0: bus 2 (SBEX)
acpiprt12 at acpi0: bus 16 (COMP)

Index: acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.174
diff -u -p -u -p -b -r1.174 acpi.c
--- acpi.c      9 Jul 2010 12:27:02 -0000       1.174
+++ acpi.c      9 Jul 2010 20:02:27 -0000
@@ -606,6 +606,10 @@ acpi_getpci(struct aml_node *node, void 
                aml_nodename(node));
 
        /* Check if PCI device exists */
+       if (pci->dev > 0x1F || pci->fun > 7) {
+               free(pci, M_DEVBUF);
+               return (1);
+       }
        tag = pci_make_tag(pc, pci->bus, pci->dev, pci->fun);
        reg = pci_conf_read(pc, tag, PCI_ID_REG);
        if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID) {
Index: acpiprt.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpiprt.c,v
retrieving revision 1.39
diff -u -p -u -p -b -r1.39 acpiprt.c
--- acpiprt.c   8 Jul 2010 20:56:31 -0000       1.39
+++ acpiprt.c   9 Jul 2010 19:48:13 -0000
@@ -114,7 +114,7 @@ acpiprt_attach(struct device *parent, st
                printf("%s: bus mismatch, new:%d old:%d\n",
                        aml_nodename(sc->sc_devnode),
                        nbus, sc->sc_bus);
-               panic("aiiiee..");
+               sc->sc_bus = nbus;
        }
 
        if (aml_evalnode(sc->sc_acpi, sc->sc_devnode, 0, NULL, &res)) {

Reply via email to