Index: sys/dev/extres/regulator/regulator.c =================================================================== --- sys/dev/extres/regulator/regulator.c +++ sys/dev/extres/regulator/regulator.c @@ -190,16 +190,42 @@ int status, ret; int disable = 1; - REG_TOPO_SLOCK(); TUNABLE_INT_FETCH("hw.regulator.disable_unused", &disable); + if (!disable) + return; + REG_TOPO_SLOCK(); + + /* + * We unconditionally emit a notice that unused regulators are getting + * shutdown because this can cause issues if the FDT data is incorrect. + * Regulator shutdown happens right around mountroot time, so failures + * here can look like stalling to mountroot without the hint that + * something like this is happening.. + */ + printf("regulator: shutting down unused regulators\n"); TAILQ_FOREACH(entry, ®node_list, reglist_link) { - if (!entry->std_param.always_on && disable) { - if (bootverbose) - printf("regulator: shutting down %s\n", - entry->name); + if (!entry->std_param.always_on) { ret = regnode_status(entry, &status); - if (ret == 0 && status == REGULATOR_STATUS_ENABLED) - regnode_stop(entry, 0); + if (ret == 0 && status == REGULATOR_STATUS_ENABLED) { + if (bootverbose) + printf("regulator: shutting down %s... \n", + entry->name); + ret = regnode_stop(entry, 0); + if (bootverbose) { + /* + * Call out busy in particular, here, + * because it's not unexpected to fail + * shutdown if the regulator is simply + * in-use. + */ + if (ret == EBUSY) + printf("busy\n"); + else if (ret != 0) + printf("error (%d)\n", ret); + else + printf("ok\n"); + } + } } } REG_TOPO_UNLOCK();