Index: dev/acpica/acpi_pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_pci.c,v retrieving revision 1.2 diff -u -r1.2 acpi_pci.c --- dev/acpica/acpi_pci.c 4 Sep 2002 03:13:15 -0000 1.2 +++ dev/acpica/acpi_pci.c 12 Sep 2002 20:52:49 -0000 @@ -79,7 +79,7 @@ DEVMETHOD(device_attach, acpi_pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, pci_resume), /* Bus interface */ DEVMETHOD(bus_print_child, pci_print_child), Index: dev/pci/pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/pci/pci.c,v retrieving revision 1.200 diff -u -r1.200 pci.c --- dev/pci/pci.c 4 Sep 2002 03:53:21 -0000 1.200 +++ dev/pci/pci.c 14 Sep 2002 14:30:03 -0000 @@ -88,7 +88,7 @@ DEVMETHOD(device_attach, pci_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, pci_resume), /* Bus interface */ DEVMETHOD(bus_print_child, pci_print_child), @@ -746,7 +746,7 @@ pcicfgregs *cfg = &dinfo->cfg; struct resource_list *rl = &dinfo->resources; struct pci_quirk *q; - int b, i, f, s; + int b, i, irq, f, s; b = cfg->bus; s = cfg->slot; @@ -762,14 +762,16 @@ } if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { -#ifdef __ia64__ /* - * Re-route interrupts on ia64 so that we can get the - * I/O SAPIC interrupt numbers (the BIOS leaves legacy - * PIC interrupt numbers in the intline registers). + * Try to re-route interrupts. Sometimes the BIOS or + * firmware may leave bogus values in these registers. + * If the re-route fails, then just stick with what we + * have. */ - cfg->intline = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin); -#endif + irq = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin); + if (PCI_INTERRUPT_VALID(irq)) { + cfg->intline = irq; + } resource_list_add(rl, SYS_RES_IRQ, 0, cfg->intline, cfg->intline, 1); } @@ -1408,3 +1410,36 @@ return (0); } + +int +pci_resume(device_t dev) +{ + int numdevs; + int i; + device_t *children; + device_t child; + struct pci_devinfo *dinfo; + pcicfgregs *cfg; + + device_get_children(dev, &children, &numdevs); + + for (i = 0; i < numdevs; i++) { + child = children[i]; + + dinfo = device_get_ivars(child); + cfg = &dinfo->cfg; + if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { + cfg->intline = PCIB_ROUTE_INTERRUPT(device_get_parent(dev), + child, cfg->intpin); + if (PCI_INTERRUPT_VALID(cfg->intline)) { + pci_write_config(child, PCIR_INTLINE, + cfg->intline, 1); + } + } + } + + free(children, M_TEMP); + + return (bus_generic_resume(dev)); +} + Index: dev/pci/pci_private.h =================================================================== RCS file: /home/ncvs/src/sys/dev/pci/pci_private.h,v retrieving revision 1.4 diff -u -r1.4 pci_private.h --- dev/pci/pci_private.h 4 Sep 2002 03:13:16 -0000 1.4 +++ dev/pci/pci_private.h 12 Sep 2002 20:55:39 -0000 @@ -68,5 +68,6 @@ size_t size); void pci_print_verbose(struct pci_devinfo *dinfo); int pci_freecfg(struct pci_devinfo *dinfo); +int pci_resume(device_t dev); #endif /* _PCI_PRIVATE_H_ */