Repository navigation
soc: apple: clpc: offer platform profiles in kernels without ACPI - #2549
DjDeveloperr wants to merge 1 commit into
Conversation
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>
|
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 |
|
Follow-up to our T6040 row above: the empty |
|
J714s (14-inch M5 Pro, T6050) hardware row on Tested on an Arch Linux ARM rootfs running Platform profile verification
Regression checks
|
The M5 Pro (J714s) release gate found no
/sys/class/platform-profileon 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_PROFILEwas defined insideif ACPIindrivers/acpi/Kconfig, and its object was built only fromdrivers/acpi/, whichdrivers/Makefileenters only withCONFIG_ACPI. So APPLE_CLPC'sselect ACPI_PLATFORM_PROFILE if ACPIdid nothing there.IS_REACHABLE(CONFIG_ACPI_PLATFORM_PROFILE)inapple_clpc_probe()was then false, and the driver silently skippeddevm_platform_profile_register(). The lab kernel starts from defconfig, which hasCONFIG_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
ACPI_PLATFORM_PROFILEsymbol (promptless, select-only) now sits outsideif ACPI.drivers/Makefilebuildsacpi/platform_profile.owhen ACPI is off, the same waydrivers/rasbuildsamd/fmpm.o. With ACPI on, nothing changes.platform_profile.creadsacpi_kobjonly withCONFIG_ACPI. Without it there is no legacy/sys/firmware/acpiinterface, and the class interface works as before.IS_REACHABLEstays in place for COMPILE_TEST architectures that do not sourcedrivers/acpi/Kconfig.asahi.configrequestsCONFIG_ACPI_PLATFORM_PROFILE=y. Each distro'svalidate-config.pythen fails the build if Kconfig ever drops it again.Checks
olddefconfigwith LLVM=1 over alarm's committed config, Fedora'sconfig+fedora.config, and NixOS'skernel/config+nixos.config. Before this change:# CONFIG_ACPI is not setand noACPI_PLATFORM_PROFILEin any of the three. After it: exactly one line differs in each resolved config, the newCONFIG_ACPI_PLATFORM_PROFILE=y. alarm and Fedoravalidate-config.pypass with the new asahi.config line.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 onceapple-clpcregisters. So Fedora needs a bridge to the class device first (details in #451).🤖 Generated with Claude Code