Page MenuHomeFreeBSD

acpi_cpu: Make disabling idle during suspend sysctl
Needs ReviewPublic

Authored by obiwac on Mon, Oct 12, 2:44 PM.
Tags
None
Referenced Files
F175848437: D60649.id189605.diff
Tue, Oct 13, 9:01 PM
F175793305: D60649.id189605.diff
Tue, Oct 13, 9:57 AM
F175793163: D60649.id189602.diff
Tue, Oct 13, 9:56 AM
F175769170: D60649.diff
Tue, Oct 13, 5:06 AM
F175765540: D60649.id189602.diff
Tue, Oct 13, 4:21 AM
F175744934: D60649.id189602.diff
Mon, Oct 12, 11:49 PM
F175739905: D60649.id.diff
Mon, Oct 12, 10:46 PM
Unknown Object (File)
Mon, Oct 12, 9:07 PM
Subscribers

Details

Reviewers
emaste
olce
Summary

This is a workaround for some old chipsets, but breaks suspend-to-idle.
Disable by default for now, but if this causes issues then we can make
this enabled by default and just only apply the workaround when doing
suspend-to-memory.

The commit that introduced this workaround was 3331373ce733 ("Disable
CPU idle states during suspend and reenable them during resume.").

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 78066
Build 74949: arc lint + arc unit

Event Timeline

share/man/man4/acpi.4
120–121

I kinda wanna refer to the commit that introduced this here, but there doesn't seem to be any precedent for doing this in manpages

sys/dev/acpica/acpi_cpu.c
576–577

this might be a little excessive... we could just always call enable_idle() regardless of whether or not the workaround is being applied, and then we wouldn't need SYSCTL_ADD_PROC() and acpi_cpu_disable_idle_on_suspend_sysctl(), but I don't know what the implications of setting ACPI_BITREG_BUS_MASTER_RLD for each resume is and I'd rather not do it needlessly.

share/man/man4/acpi.4
120–121

I'm not sure how useful a src commit reference would be to readers of the man page, but referencing the date or year of the commit and/or the FreeBSD version in which it first appeared could give some useful context IMO.

CTLTYPE_BOOL doesn't exist

Negative-sense sysctls can be confusing -- i.e., enable the disable sysctl to avoid idling CPUs upon suspend. That said, this sysctl is configuring the system to do something undesired/unusual, so I do like having 0 be the normal state. What about calling it something like "suspend_idle_workaround"?

Other than that comment seems reasonable

Negative-sense sysctls can be confusing -- i.e., enable the disable sysctl to avoid idling CPUs upon suspend.

Yeah but that's enabling a workaround that does something extra that wouldn't be done otherwise (i.e. explicitly disabling idle on suspend).

That said, this sysctl is configuring the system to do something undesired/unusual, so I do like having 0 be the normal state. What about calling it something like "suspend_idle_workaround"?

I find suspend_idle_workaround to be confusing as it doesn't really describe what this is doing, and might be confused with something relating to suspend-to-idle. I do like the current name but open to other suggestions

In that case what about just "idle_on_suspend" (or "enable_idle_on_suspend") with a default of 1

Idle on suspend sounds good to me iiuc

share/man/man4/acpi.4
120

You could simplify this a bit like so