Page MenuHomeFreeBSD

hwpstate_amd: Detect ACPI _CPC object to enable CPPC
Needs ReviewPublic

Authored by aokblast on Wed, Jun 24, 6:24 PM.
Tags
None
Referenced Files
F162842528: D57825.id180619.diff
Fri, Jul 17, 12:28 PM
Unknown Object (File)
Tue, Jul 14, 11:49 PM
Unknown Object (File)
Tue, Jul 14, 4:23 PM
Unknown Object (File)
Mon, Jul 6, 4:14 AM
Unknown Object (File)
Fri, Jul 3, 9:58 AM
Unknown Object (File)
Fri, Jul 3, 5:05 AM
Unknown Object (File)
Thu, Jul 2, 11:20 PM
Unknown Object (File)
Thu, Jul 2, 10:40 PM
Subscribers

Details

Reviewers
olce
Summary

We find some devices' CPU with CPPC support breaks the autonomous mode.
However, without Kernel Governer, making CPU stay in highest_performace
largely increase the CPU power consumption. As a concession, we enforace
ACPI _CPC check to enable CPPC by default. Also, provide a sysctl to
disable this check.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74245
Build 71128: arc lint + arc unit

Event Timeline

Looks good. One suggestion in an inline comment. Only thing now is the dependency on the CPPC lib, I'll review the other revisions and come back to here.

sys/x86/cpufreq/hwpstate_amd.c
1059–1062

I'd wrap the block around the ACPI check in a if ((sc->flags & HWPFL_USE_CPPC) != 0) to avoid calling acpi_cppc_ctx_init() at all if CPUID already indicates the feature is not supported. Doing so also delineates a bit more the assignment to sc->cppc.ctx, which wasn't that visible at first.

So, as I feared, the CPC parsing library needs significant work.

In the interest of moving this revision forward sooner, I'd suggest breaking the dependency to D55474 by, instead of calling acpi_cppc_ctx_init(), directly evaluating whether _CPC exists in the ACPI namespace (under #ifdef DEV_ACPI), possibly by calling a helper defined in our ACPI code.

Looks good. One suggestion in an inline comment. Only thing now is the dependency on the CPPC lib, I'll review the other revisions and come back to here.

sys/x86/cpufreq/hwpstate_amd.c
1059–1062

It is required as we use this context to check if we need to enter autonomous mode.