Skip to content

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

Draft
DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/platform-profile-without-acpi
Draft

DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/platform-profile-without-acpi

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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).

🤖 Generated with Claude Code

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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide

Copy link
Copy Markdown
Contributor

T6040 (J616s) row with this as kernel-aurora 7.3.0-44 (fedora-aurora#451 CI): it boots clean (0 AVC, 0 failed units), and as expected /sys/class/platform-profile stays empty on T6040, since the low-power ceiling is only matched for apple,t6041. Power Saver capping by aurora-power-budget is unchanged from fleet75: 24.8 vs 26.0 W all-core, with the same 2868/1800 MHz caps. Numbers:

@RyanTheTide

Copy link
Copy Markdown
Contributor

Follow-up to our T6040 row above: the empty /sys/class/platform-profile on the J616s is closed by #1906 together with aura#358 (merged), not by this PR. With both, the J616s registers low-power balanced performance from the loader-written apple,low-power-frequency-max-mhz = <2808>, and holds a busy P core at 2868 MHz in low-power, which matches macOS Low Power Mode (2867 MHz). Row and rebase notes: #1906 (comment). Nothing changes for this PR.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J714s (14-inch M5 Pro, T6050) hardware row on 4dfa5b6658331ccd3a8ea03fd04fff06b07ea2e9 (built as kernel-aurora 7.3.0-44.fc44.aurora.aarch64 in fedora-aurora#451 CI run 44732538812, # CONFIG_ACPI is not set, CONFIG_ACPI_PLATFORM_PROFILE=y, CONFIG_APPLE_CLPC=y): PASS.

Tested on an Arch Linux ARM rootfs running power-profiles-daemon 0.30 (powerprofilesctl), with the in-tree DTB (78e41752) and aura 82ee5d6f (MTE on, arm64.nomte absent, SEP writes enabled by default).

Platform profile verification

  • Class registration: /sys/class/platform-profile/platform-profile-0 registers with name=apple-clpc and choices='low-power balanced performance' while /sys/firmware/acpi/platform_profile is absent.
  • Profile cycle (balanced → power-saver → balanced → performance → balanced):
    • balanced: class balanced, CLPC profile: balanced (ceilings 0 / 0 / 0), smc high power: off, scaling_max_freq = cpuinfo_max_freq (4380 / 4380 / 4608 MHz on policy0 / policy6 / policy12).
    • power-saver: class low-power, CLPC profile: low-power (3589 mW, ceilings 2964 / 2964 / 2880 MHz), smc high power: off, scaling_max_freq capped at 2964 / 2964 / 2880 MHz (matching each policy's first step ≥ 2808 MHz).
    • performance: class performance, CLPC profile: performance (ceilings 0 / 0 / 0), smc high power: on (3 records sent), scaling_max_freq = cpuinfo_max_freq.
    • Returning to balanced: smc high power: off (4 records sent), ceilings 0 / 0 / 0.
  • Single-thread ceiling (cpu12 / policy12, low-power-top=2880 MHz): cur=2880 MHz (max=2880 MHz) in power-saver; cur=4608 MHz (max=4608 MHz) in balanced.
  • 30 s all-core load in power-saver (18 threads): CLPC reported profile: low-power power 14491 mW (44 new of 409 readings) ceilings (kHz): cpu0 1344000 cpu6 1344000 cpu12 1308000 (tracking the 15 W PHPC target).
  • Deep-sleep persistence: Restored to performance (smc high power: on (5 records sent)), ran 1/1 clean deep sleep via logind (30 s PMU RTC alarm, asleep_s=28.1, en_to_exit=5.99 s, 0 faults, 0 dark wakes). Post-wake /sys/class/platform-profile/platform-profile-0/profile stayed performance, CLPC profile: performance (ceilings 0 / 0 / 0), smc high power: on (5 records sent).

Regression checks

  • Docked boot & post-wake (eDP-1 3024×1964@120, Dell S2725QC 3840×2160@120, Samsung G81SF 3840×2160@240 via TB5 dock): 0 oops/MMU/DART/GPU/tag-check faults, 0 failed units, MTE on (18/18 CPUs), apple_sep ready (12 endpoints, xART writes enabled, 0 errors), 20/20 USB devices, Wi-Fi/BT, camera (90/90 frames pre- and post-wake), ANE (add128 20/20 exact), Vulkan (dEQP-VK.api.smoke 8/8 + gpubench compute.light rc=0), audio/AOP/6× tas2764 amps (0 faults), and 20 s FMA+GPU load (152.6 Gfma/s boot / 151.6 Gfma/s post-wake, peaks 4380/4380/4608 MHz) all clean.
  • Note: Fedora userspace bridge (tuned-ppd + aurora-power-budget / aurora-platform#35) is out of scope for this kernel-half run and tracked separately on fedora-aurora#451.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants