Skip to content

soc: apple: clpc: offer platform profiles in kernels without ACPI - #3995

Merged
DjDeveloperr merged 1 commit into
mainfrom
djdev/platform-profile-without-acpi-v2
Dec 2, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
djdev/platform-profile-without-acpi-v2

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What: Build ACPI_PLATFORM_PROFILE when ACPI is off, so apple-clpc registers its platform profiles on the distribution kernels (Fedora, alarm and NixOS all build with # CONFIG_ACPI is not set). This replaces #2549 with the same tree. Only the commit message changes: it drops an AI co-author trailer.
Tested: #2549's rows ran this exact tree (601aaff4): the 14-inch M5 Pro J714s passed with powerprofilesctl switching profiles, and so did a K114s (T6050) with the same config as Fedora's kernel. Kconfig resolution over the alarm, Fedora and NixOS configs: exactly one line differs in each, the new CONFIG_ACPI_PLATFORM_PROFILE=y.
Risk: two-way door · kernels built without ACPI. Every Mac whose CLPC has a low-power ceiling (from the driver's table or the boot loader's apple,low-power-frequency-max-mhz) or High Power mode gains power profiles: T6050, T6041, T8132 and others. The rest get an empty platform-profile class directory.
Not yet: none. The second generation is the M4 mini (J773g, T8132) at 4369a646: it does register a profile, and it switched through all three (#3995 (comment)).

Details

The M5 Pro (J714s) release gate found no /sys/class/platform-profile on Aurora Edge (kernel-aurora 7.3.0-43, e0ee46a). The lab kernel has the class. Without it, powerprofilesctl and the GNOME and KDE power-mode controls have nothing to switch.

Root cause. The distribution configs (Fedora, alarm and NixOS) all build with # CONFIG_ACPI is not set. ACPI_PLATFORM_PROFILE was defined inside if ACPI in drivers/acpi/Kconfig, and its object was built only from drivers/acpi/, which drivers/Makefile enters only with CONFIG_ACPI. So APPLE_CLPC's select ACPI_PLATFORM_PROFILE if ACPI did nothing there. IS_REACHABLE(CONFIG_ACPI_PLATFORM_PROFILE) in apple_clpc_probe() was then false, and the driver silently skipped devm_platform_profile_register(). The lab kernel starts from defconfig, which has CONFIG_ACPI=y. Since 1d9f65e the class also registers on a device tree boot, so the lab kernel has profiles. A distro config line could not have fixed this, because Kconfig drops the symbol while ACPI is off.

Change

  • The ACPI_PLATFORM_PROFILE symbol (promptless, select-only) now sits outside if ACPI.
  • drivers/Makefile builds acpi/platform_profile.o when ACPI is off, the same way drivers/ras builds amd/fmpm.o. With ACPI on, nothing changes.
  • platform_profile.c reads acpi_kobj only with CONFIG_ACPI. Without it there is no legacy /sys/firmware/acpi interface, and the class interface works as before.
  • APPLE_CLPC selects the symbol unconditionally. IS_REACHABLE stays in place for COMPILE_TEST architectures that do not source drivers/acpi/Kconfig.
  • asahi.config requests CONFIG_ACPI_PLATFORM_PROFILE=y. Each distro's validate-config.py then fails the build if Kconfig ever drops it again.

Checks

  • Kconfig only, no build. olddefconfig with LLVM=1 over alarm's committed config, Fedora's config + fedora.config, and NixOS's kernel/config + nixos.config. Before this change: # CONFIG_ACPI is not set and no ACPI_PLATFORM_PROFILE in any of the three. After it: exactly one line differs in each resolved config, the new CONFIG_ACPI_PLATFORM_PROFILE=y. alarm and Fedora validate-config.py pass with the new asahi.config line.
  • Not compiled locally. This repo's CI runs host tests only. The fedora-aurora draft that pins this head gives the package build.

Other registrants. The other platform-profile drivers in the tree are amd-pstate, surface_platform_profile, int340x soc_slider and the x86 platform drivers (acer-wmi, amd-pmf, asus-wmi, bitland-mifs-wmi, alienware-wmi-wmax, dell-pc, hp-wmi, inspur, ideapad-laptop, thinkpad_acpi, lenovo wmi-gamezone, samsung-galaxybook). All of them depend on X86 or ACPI, so none can build in these arm64 configs. Within apple-clpc, only T6050 (any machine) and T6041 (M4 Max) set low_power_khz. T8140 (the Neo), T8132, T8142 and T8152 register no profile. On those machines the change adds an empty class directory and nothing else.

Base. The branch is e0ee46a, the Edge kernel, plus this one commit. A 7.3.0-44 Edge rebuild can pin this head and differ from the CTS-qualified 7.3.0-43 only by this change. The touched files are unchanged between e0ee46a and the integration/aurora tip, so it merges cleanly.

Distro drafts.

Fedora needs one more piece before profiles are useful there. tuned-ppd's acpi plugin writes only /sys/firmware/acpi/platform_profile, and aurora-power-budget stands aside once apple-clpc registers. So Fedora needs a bridge to the class device first (details in #451).

Distribution kernels build without ACPI. ACPI_PLATFORM_PROFILE sat under
`if ACPI` and was built only inside drivers/acpi/, so APPLE_CLPC's
`select ACPI_PLATFORM_PROFILE if ACPI` did nothing there and the driver
skipped devm_platform_profile_register(): no /sys/class/platform-profile
on the M5 Pro.

The class needs nothing from ACPI. Define the symbol outside `if ACPI`,
build platform_profile.o without ACPI too, select it unconditionally,
and request it in asahi.config so a distribution build fails loudly if
it is ever dropped again.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners December 2, 2026 20:43
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 4369a646: not ready yet

Check Detail
CI at head running running: apple-build, host-tests, KUnit plan
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head ok comment at 4369a646
Conflicts ok none
PR text ok Risk: two-way · kernels built without ACPI. T6050 and T6041 (M4 Max) gain power profiles; other Macs get an empty platform-profile class directory.

Areas: area:platform

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4369a64 against its base and verified the full tree matches #2549. Arm64 sources the ACPI Kconfig with ACPI disabled, Kbuild selects exactly one platform-profile object in either configuration, and the no-ACPI code has no reference to acpi_kobj. The carried J714s and K114s rows cover profile registration and switching on this tree.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 4369a64622c2 once a no-regression boot on a second generation (J773g or J700) passes at this head and CI finishes. No blocking findings.

Checked

  • git rev-parse 4369a646^{tree} is 601aaff45196d4409734bc5ed6e15d8283cad892, the same as #2549's 4dfa5b66^{tree}, and both have the same merge base e0ee46a1. So the J714s row (#2549, comment 7066988691) and the K114s row (comment 7259129712) ran this exact tree, and both passed.
  • The one commit is authored and signed off by Diljit Singh. There is no Co-Authored-By, Assisted-by or "Generated with" line in the commit or the body.
  • No constants from reverse engineering: the change is Kconfig, Makefile and a CONFIG_ACPI guard around acpi_kobj.
  • With ACPI off, drivers/Makefile builds acpi/platform_profile.o. With ACPI on, drivers/acpi/Makefile builds it as before, and the ifndef CONFIG_ACPI keeps it from being listed twice. Without ACPI, platform_profile_legacy_kobj() returns NULL, so the legacy /sys/firmware/acpi files are never created and the class interface works as before.
  • Since e0ee46a1, main has changed asahi.config and drivers/soc/apple/Kconfig (Bluetooth and DRM config lines, the panel-notch symbols). None of it touches the CLPC or platform-profile lines, and GitHub's merge ref is clean.

Local checks (pc, arm64, LLVM, this head)

  • asahi config (ACPI on, as the lab kernel): make W=1 drivers/acpi/platform_profile.o drivers/soc/apple/clpc.o builds with 0 warnings.
  • The same config with ACPI off (as the distribution kernels): CONFIG_ACPI_PLATFORM_PROFILE=y comes from APPLE_CLPC=y, and both objects build with W=1 and 0 warnings. make -n drivers/ builds only platform_profile.o from drivers/acpi/ and links it into drivers/built-in.a.
  • checkpatch.pl on 4369a64: 0 errors, 0 warnings.
  • Host tests (the host-tests.yml container, run-host-tests.py): 437/437 passed.
  • Hosted apple-build, host-tests and KUnit plan are still queued.

Still owed: a boot of this head on J773g or J700 (they register no profile) showing the empty /sys/class/platform-profile and no regression: 0 failed units, 0 AVC denials, 0 new kernel errors.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J773g (M4 mini, T8132, 27.2) 4369a64622c2 PASS (7.3.0-j773g-comp5 on main b47fc630, boot_id=3a101384-2cfc-4aa6-835b-6d4f9a3692b5): booted with # CONFIG_ACPI is not set and CONFIG_ACPI_PLATFORM_PROFILE=y; /sys/class/platform-profile/platform-profile-0 (apple-clpc, choices=low-power balanced performance, default balanced) present and verified live low-power -> performance -> balanced transitions while /sys/firmware/acpi/ is absent; 0 probe errors, 0 WARN/Oops, 0 failed units, gpubench-vk compute.light valid=true.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@DjDeveloperr
DjDeveloperr merged commit 1da28cf into main Dec 2, 2026
9 of 12 checks passed
@DjDeveloperr
DjDeveloperr deleted the djdev/platform-profile-without-acpi-v2 branch December 2, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:platform Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants