Page MenuHomeFreeBSD

regulator: small enhancements to regulator_shutdown
ClosedPublic

Authored by kevans on Nov 1 2019, 1:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 20 2024, 1:09 PM
Unknown Object (File)
Sep 20 2024, 1:08 PM
Unknown Object (File)
Sep 8 2024, 8:46 PM
Unknown Object (File)
Sep 8 2024, 1:20 PM
Unknown Object (File)
Sep 8 2024, 1:13 AM
Unknown Object (File)
Sep 7 2024, 8:51 PM
Unknown Object (File)
Sep 4 2024, 10:20 AM
Unknown Object (File)
Aug 22 2024, 2:39 AM
Subscribers

Details

Summary

Highlights:

  • Exit early if we're not disabling unused regulators; there's no need to take the regulator topology lock and re-evaluate this every iteration, as it's not going to change.
  • Unconditionally emit a notice that we're disabling regulators so it doesn't look like we might just be taking a while to mountroot.
  • Don't emit a notice that we're shutting down a regulator if it's not enabled, to reduce noise.
  • Mention the outcome of the shutdown, to aide debugging and easily let developer/user collect list of regulators we actually shutdown to determine problematic one.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/extres/regulator/regulator.c
205 ↗(On Diff #63862)

I would put that under if (bootverbose)

226 ↗(On Diff #63862)

Maybe add "regulator: " in fronf of the text because just having a line with "ok" isn't really helpful.

sys/dev/extres/regulator/regulator.c
205 ↗(On Diff #63862)

The comment above explains why I didn't want to put it under bootverbose. It looks like a completely unrelated failure at the moment if you're not booting verbose because this happens right around mountroot, so this is the hint that you're not having filesystem issues.

226 ↗(On Diff #63862)

Whoops, I meant to strip the newline off the message above because this needs to be same line.

Chop off a newline to push status of regulator shutdown back onto the correct line with the name of the regulator.

Update to give and put the initial notice under bootverbose... I still don't like that we're potentially (and did, in the case that spawned this patch) shutting down regulators that make the system look like it just spontaneously lost power without emitting a notice, but I'd much prefer to get this patch in because the current situation makes it hard to debug.

This might need to grow a small DELAY after the "shutting down %s..." bootverbose message (if bootverbose) in case the regulator gets shutdown before we can actually print the message, but I'm still testing it to figure out why it's flakey.

This revision is now accepted and ready to land.Jan 11 2020, 3:13 PM
This revision was automatically updated to reflect the committed changes.