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)
Dec 23 2023, 2:00 AM
Unknown Object (File)
Oct 3 2023, 12:59 AM
Unknown Object (File)
Aug 29 2023, 12:09 AM
Unknown Object (File)
Aug 13 2023, 6:26 AM
Unknown Object (File)
Aug 2 2023, 6:19 PM
Unknown Object (File)
Jun 29 2023, 7:04 AM
Unknown Object (File)
Jun 29 2023, 6:53 AM
Unknown Object (File)
Apr 8 2023, 12:00 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 27306

Event Timeline

sys/dev/extres/regulator/regulator.c
205

I would put that under if (bootverbose)

226

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

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

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.