Page MenuHomeFreeBSD

D22213.id.diff
No OneTemporary

D22213.id.diff

Index: head/sys/dev/extres/regulator/regulator.c
===================================================================
--- head/sys/dev/extres/regulator/regulator.c
+++ head/sys/dev/extres/regulator/regulator.c
@@ -191,16 +191,36 @@
int status, ret;
int disable = 1;
- REG_TOPO_SLOCK();
TUNABLE_INT_FETCH("hw.regulator.disable_unused", &disable);
+ if (!disable)
+ return;
+ REG_TOPO_SLOCK();
+
+ if (bootverbose)
+ 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, 12:36 PM (11 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31598787
Default Alt Text
D22213.id.diff (1 KB)

Event Timeline