DF-5562 / run.fix.log
cc -O2 -pipe -D_KERNEL -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wold-style-definition -Wmissing-include-dirs -Wno-pointer-sign -Winit-self -Wundef -Wno-unused-but-set-variable -std=gnu11 -Werror -DKLD_MODULE -nostdinc -I. -Idragonfly -I/usr/obj/usr/src/sys/X86_64_GENERIC -I/usr/obj/usr/src/sys/X86_64_GENERIC/include -Idragonfly/../include -I/usr/include -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/X86_64_GENERIC/opt_global.h -Wold-style-declaration -fno-common -ffreestanding -fno-stack-protector -fno-strict-aliasing -fno-strict-overflow -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -mno-fp-ret-in-387 -mindirect-branch=thunk-inline -c veto.c cc -Wl,--build-id=sha1 -nostdlib -Wl,--hash-style=sysv -r -Wl,-d -o veto.ko veto.o hw.df5562: 0 -> 0 === R1: veto active === DF5562: harness loaded veto0: <DF-5562 detach-veto child> on ohci0 veto0: attached to ohci0; my detach will EBUSY while the ohci driver is bound to the parent DF5562: worker thread ready (sysctl hw.df5562=N) DF5562: ohci0 alive: HCCA VA=0xfffff8008df7b000 [0006a000 0006b000 0006c000 0006d000] ctrl-ED VA=0xfffff8008df7c000 DF5562: calling device_detach(ohci0) [== what devclass_delete_driver does on kldunload / PCI hot-unplug] uhub0: detached ugen0.1: <Apple> at usbus0 (disconnected) unknown: at usbus0, port 1, addr 1 (disconnected) usbus0: detached veto0: DETACH VETO: returning EBUSY -- watch ohci_pci_detach swallow this and tear down anyway ohci0: child device failed to detach (16); refusing controller teardown DF5562: device_detach(ohci0) returned 16 -- honest failure DF5562: post: ohci0 driver=ohci state=3 DF5562: ohci0 STILL has 1 child device(s): veto0(attached=1) hw.df5562: 0 -> 0 === R1b: the exact touch that killed the baseline === DF5562: post: ohci0 driver=ohci state=3 DF5562: ohci0 STILL has 1 child device(s): veto0(attached=1) DF5562: post-teardown softc: hcca_pc.buffer=0xfffff8008df7b000 (was 0xfffff8008df7b000), ctrl-ED buffer=0xfffff8008df7c000 (was 0xfffff8008df7c000) GUEST_STILL_ALIVE hw.df5562: 0 -> 0 hw.df5562: 0 -> 0 === R2: retry after child cooperates === ohci_interrupt: unrecoverable error, controller halted ohci_interrupt: blocking intrs 0x10 ohci0: detached DF5562: device_detach(ohci0) returned 0 -- SUCCESS reported DESPITE live veto child (the lie) DF5562: post: ohci0 driver=(none) state=0 DF5562: ohci0 STILL has 0 child device(s): DONE