Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/subr_autoconf.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/subr_autoconf.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.241 retrieving revision 1.242 diff -u -p -r1.241 -r1.242 --- src/sys/kern/subr_autoconf.c 2016/03/28 09:50:40 1.241 +++ src/sys/kern/subr_autoconf.c 2016/06/19 09:35:06 1.242 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_autoconf.c,v 1.241 2016/03/28 09:50:40 skrll Exp $ */ +/* $NetBSD: subr_autoconf.c,v 1.242 2016/06/19 09:35:06 bouyer Exp $ */ /* * Copyright (c) 1996, 2000 Christopher G. Demetriou @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.241 2016/03/28 09:50:40 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.242 2016/06/19 09:35:06 bouyer Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -1876,14 +1876,20 @@ config_detach_all(int how) static struct shutdown_state s; device_t curdev; bool progress = false; + int flags; if ((how & (RB_NOSYNC|RB_DUMP)) != 0) return false; + if ((how & RB_POWERDOWN) == RB_POWERDOWN) + flags = DETACH_SHUTDOWN | DETACH_POWEROFF; + else + flags = DETACH_SHUTDOWN; + for (curdev = shutdown_first(&s); curdev != NULL; curdev = shutdown_next(&s)) { aprint_debug(" detaching %s, ", device_xname(curdev)); - if (config_detach(curdev, DETACH_SHUTDOWN) == 0) { + if (config_detach(curdev, flags) == 0) { progress = true; aprint_debug("success."); } else