--- a/sys/bus/firewire/fwohci_pci.c +++ b/sys/bus/firewire/fwohci_pci.c @@ -342,12 +342,24 @@ fwohci_pci_detach(device_t self) { fwohci_softc_t *sc = device_get_softc(self); + int err; crit_enter(); if (sc->bsr) fwohci_stop(sc, self); - bus_generic_detach(self); + /* + * Never tear our own resources down (and never force-delete the + * firewire child) while a child driver is still attached and vetoed + * the detach: the controller, IRQ and DMA rings must stay valid. + */ + err = bus_generic_detach(self); + if (err) { + device_printf(self, "could not detach firewire child, %d\n", + err); + crit_exit(); + return (err); + } if (sc->fc.bdev) { device_delete_child(self, sc->fc.bdev); sc->fc.bdev = NULL;