Page MenuHomeFreeBSD

cpufreq: Fix sysctl name conflict between hwpstate_intel and hwpstate_amd
AbandonedPublic

Authored by guest-seuros on Fri, Feb 6, 3:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 10, 10:10 PM
Unknown Object (File)
Tue, Feb 10, 8:09 PM
Unknown Object (File)
Sun, Feb 8, 2:24 PM
Subscribers

Details

Reviewers
cy
olce
Summary

Both hwpstate_intel.c and hwpstate_amd.c were registering the same sysctl name (machdep.hwpstate_pkg_ctrl), causing a "can't re-use a leaf" error when both drivers are compiled into the kernel via the cpufreq option.

Rename the sysctls to be vendor-specific:

  • machdep.hwpstate_pkg_ctrl => machdep.hwpstate_intel_pkg_ctrl
  • machdep.hwpstate_pkg_ctrl => machdep.hwpstate_amd_pkg_ctrl

This allows both drivers to coexist and makes the sysctl naming more explicit about which driver they control.

Diff Detail

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

Event Timeline

guest-seuros held this revision as a draft.

This looks like a breaking change. Not sure if the solution is to detect the cpu (since having both types in the same motherboard is not possible).

I'm already working on it. May be what ShengYi proposed in D54528 already, but I'm trying a different, somewhat simpler approach.

I don't think it's reasonable to change the name of a knob that has existed for a relatively long time (in the Intel case) without proper deprecation and warning.

Your approach is much more elegant..

Sorry for not doing another search before submitting. I had this change locally (before the diff was open).

Thanks.

Your approach is much more elegant..

Sorry for not doing another search before submitting. I had this change locally (before the diff was open).

Thanks.

No problem. That (unfortunately) happens from time to time, although here the changes are quite small, so hopefully there wasn't too much wasted effort.