Page MenuHomeFreeBSD

acpi: Create cppc_notify sysctl before it is checked
ClosedPublic

Authored by thj on Oct 21 2022, 3:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 9:54 AM
Unknown Object (File)
Sat, Apr 13, 2:56 PM
Unknown Object (File)
Jan 7 2024, 1:33 PM
Unknown Object (File)
Dec 20 2023, 7:47 AM
Unknown Object (File)
Dec 13 2023, 8:15 AM
Unknown Object (File)
Nov 11 2023, 4:47 PM
Unknown Object (File)
Nov 9 2023, 4:30 PM
Unknown Object (File)
Oct 31 2023, 11:12 AM

Details

Summary

Comment #74 on the original issue points out that we are creating/checking
the sysctl after we have configured the notifications on the core.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253288#c74

Move the sysctl creation up to so it is created when the cpu tree is created.
This makes the cppc_notify field only available globally, but I prefer this, it
makes it easier to disable this workaround and it is unlikely that mixing
enabling/disabling these notifications per core is going to make buggy SMMs
happy.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

thj requested review of this revision.Oct 21 2022, 3:57 PM
thj created this revision.

I think the old sysctl was also already global and not per-CPU (just affects the log message I think)

This revision is now accepted and ready to land.Oct 21 2022, 6:57 PM

Thanks a lot for this, @thj! I can confirm that this change does indeed help with my hardware. I've tested it, I've been using this patch for a few hours now without any system hanging.

Also, using the debug patch I posted in bug #253288 it looks like messages ordering is now correct, i.e., first we get the sysctl creation.

However, there's another interesting thing I'm seeing that I can't explain, but I'm new to ACPI and FreeBSD kernel code. What I see occasionally is that is sometimes the sysctl creation occurs twice. Here's an example:

$ dmesg | grep DEBUG
cpu0: ==> DEBUG init cppc_notify: 1
cpu0: ==> DEBUG: OK
cpu1: ==> DEBUG: OK
cpu2: ==> DEBUG: OK
cpu3: ==> DEBUG: OK
cpu0: ==> DEBUG init cppc_notify: 1
cpu0: ==> DEBUG: OK
cpu1: ==> DEBUG: OK
cpu2: ==> DEBUG: OK
cpu3: ==> DEBUG: OK

My theory (which I haven't tested it thoroughly, so it can be wrong) is that this tends to happen when a do a simple reboot command. If I do a full shutdown, the next boot will show only a single set, i.e:

cpu0: ==> DEBUG init cppc_notify: 1
cpu0: ==> DEBUG: OK
cpu1: ==> DEBUG: OK
cpu2: ==> DEBUG: OK
cpu3: ==> DEBUG: OK

Maybe that's how it works, just yet another BIOS annoyance, but I thought I should mention it here.

Again, thanks!