diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3537,8 +3537,10 @@ int bus_generic_resume_child(device_t dev, device_t child) { - DEVICE_RESUME(child); - child->flags &= ~DF_SUSPENDED; + if (child->flags & DF_SUSPENDED) { + DEVICE_RESUME(child); + child->flags &= ~DF_SUSPENDED; + } return (0); } @@ -3566,6 +3568,8 @@ * safer to bring down devices in the reverse order. */ TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, link) { + if (!device_is_attached(child)) + continue; error = BUS_SUSPEND_CHILD(dev, child); if (error != 0) { child = TAILQ_NEXT(child, link);