Page MenuHomeFreeBSD

D22213.id63918.diff
No OneTemporary

D22213.id63918.diff

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, &regnode_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... ",
+ 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();

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 16, 2:42 AM (17 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31572582
Default Alt Text
D22213.id63918.diff (1 KB)

Event Timeline