Re: [PATCH v3 0/4] Make platform profiles firmware independent
From: Rafael J. Wysocki (Intel)
Date: Mon Nov 09 2026 - 11:53:51 EST
On Mon, Nov 9, 2026 at 5:37 PM Daniel Lezcano
<daniel.lezcano@xxxxxxxxxxxxxxxx> wrote:
>
>
> Hi,
>
> sashiko validated this series
>
> Is there any other comments for these changes I should take care of ?
I'd love to see some feedback from someone having a vested interest in
this interface. Mario? Mark?
> On 10/25/26 00:34, Daniel Lezcano wrote:
> > Make platform profile selection independent of ACPI firmware.
> >
> > The provider API already uses struct device, profile enums and callbacks;
> > it does not require an ACPI handle or firmware node. However, the core is
> > built under drivers/acpi/, its Kconfig symbol depends implicitly on ACPI,
> > and initialization fails when ACPI is disabled, preventing non-ACPI
> > providers from using the existing firmware-independent class interface.
> >
> > This series moves the core to drivers/platform/profile/ and introduces
> > CONFIG_PLATFORM_PROFILE, updating all existing provider selectors. It
> > retains the tristate configuration and platform_profile module name.
> > Firmware-specific discovery and profile operations remain with providers.
> > The core can also be selected directly through its Kconfig prompt.
> >
> > An optional ACPI adapter obtains the legacy sysfs kobject and is linked
> > into the same module. The generic core contains no ACPI types or symbols
> > and initializes without ACPI support or with ACPI disabled at boot.
> > The existing /sys/firmware/acpi/platform_profile and
> > /sys/firmware/acpi/platform_profile_choices attributes remain available
> > on active ACPI systems.
> >
> > CONFIG_PLATFORM_PROFILE_LEGACY controls the backwards-compatible aggregate
> > sysfs interface. It defaults to enabled to preserve existing userspace.
> > Disabling it omits the legacy sysfs callbacks and ACPI adapter while
> > retaining class devices and kernel profile cycling. New userspace should
> > discover and control individual class devices instead.
> > The interface is deprecated, with removal intended after the 2028 LTS
> > kernel once userspace migration is complete. A shared pr_notice_once()
> > warns on legacy attribute access rather than on merely loading the core.
> > The default remains enabled while userspace adopts released class-device
> > support; this series does not claim that ecosystem migration is complete.
> >
> > The existing firmware-independent interface remains:
> >
> > /sys/class/platform-profile/platform-profile-X/name
> > /sys/class/platform-profile/platform-profile-X/choices
> > /sys/class/platform-profile/platform-profile-X/profile
> >
> > Non-ACPI userspace controls providers individually through these class
> > devices. Aggregate selection remains available through the legacy ACPI
> > attributes, and aggregate profile cycling remains available to kernel
> > callers. No new sysfs directory or userspace ABI is introduced.
> >
> > The original first patch, "Separate handler locking from sysfs lifetime",
> > fixing the handler access race and sysfs teardown locking issue, has been
> > sent separately as a standalone v3 fix. It is not included in this series.
> > The base tree used here already contains that fix.
> >
> > Patch 1 extracts the core and initializes it before built-in consumers.
> > Patch 2 completes class-device notifications and registration cleanup.
> > Patch 3 documents firmware-independent profile selection through class
> > devices. Patch 4 makes the legacy ACPI aggregate sysfs interface optional
> > and documents its deprecation.
> >
> > Validation performed during development (before this rebase):
> >
> > - ARM64 built-in core with CONFIG_ACPI=n: W=1 build and sparse.
> > - x86 modular core with CONFIG_ACPI=y: W=1 object build and sparse.
> > Both CONFIG_PLATFORM_PROFILE_LEGACY=y and =n are covered.
> > - Full x86 kernel link and QEMU boot with lockdep and list debugging,
> > with active ACPI and with acpi=off.
> > - Firmware-less providers exercising common and hidden choices,
> > profile reads/writes, invalid input, mixed profiles, cycling,
> > partial callback failures and POLLPRI on the class and legacy ACPI
> > interfaces. With acpi=off, class get/set, notifications and kernel
> > cycling are exercised. Both runs check that no new aggregate sysfs
> > directory is created.
> > - Concurrent sysfs I/O with two persistent providers while a third
> > provider is registered and removed 200 times, last-provider attribute
> > removal and repeated provider module reloads.
> > - QEMU with active ACPI and CONFIG_PLATFORM_PROFILE_LEGACY=n: verify
> > the legacy attributes are absent, class get/set and notifications
> > work, and kernel cycling and registration/removal stress pass.
> >
> > The provider API and profile names are unchanged. Aggregate writes retain
> > their sequential, non-transactional behavior: a failing callback does not
> > roll back providers already updated.
> >
> > Changes in v3:
> > - Send the original first patch fixing the handler access race and
> > sysfs lifetime locking separately as a standalone v3 fix, including
> > the requested profile_lock protection comment and Fixes tag.
> > - Reduce this series to the four remaining patches and renumber them.
> > - Rebase the remaining changes onto the current base, which already
> > contains the separately submitted locking fix.
> >
> > Changes in v2:
> > - Add the Fixes tag to patch 1 and explain how the mutex-guard conversion
> > reintroduced the teardown deadlock previously fixed in 041142d7d252,
> > and how class-device support subsequently extended the affected paths.
> > - Drop the proposed /sys/kernel/platform_profile/ aggregate interface
> > and its ABI documentation. Use the existing firmware-independent
> > /sys/class/platform-profile/platform-profile-X/ devices instead.
> > - Preserve aggregate selection through the legacy ACPI attributes and
> > retain internal aggregation for kernel profile cycling.
> > - Refocus patch 3 on class-device notifications for direct writes and
> > restoring aggregate visibility after failed registration.
> > - Update the Kconfig help and documentation to describe the existing
> > class interface and distinguish it from ACPI aggregate selection.
> > - Revalidate class controls and notifications with acpi=off, legacy
> > aggregation with ACPI active, and the absence of a new aggregate ABI.
> > - Add CONFIG_PLATFORM_PROFILE_LEGACY (default y) to make legacy aggregate
> > sysfs code optional, independently of class devices and kernel cycling.
> > - Mark the legacy ABI deprecated and describe removal after the 2028 LTS
> > kernel, conditional on userspace migration. Emit one shared notice on
> > legacy attribute access; retain the enabled default during migration.
> > - Move the legacy ACPI ABI documentation from testing/ to obsolete/,
> > document the replacement class attributes and update MAINTAINERS.
> >
> > Changes in v1:
> > - Initial series extracting the core from ACPI, separating handler
> > locking from sysfs lifetime operations and retaining the legacy ABI.
> > - Proposed a firmware-neutral aggregate sysfs interface alongside the
> > existing per-provider class devices (removed in v2).
> >
> > Daniel Lezcano (4):
> > platform profile: Extract the core from ACPI
> > platform profile: Complete class notifications and registration
> > cleanup
> > platform profile: Document firmware-independent profile selection
> > platform profile: Make legacy ACPI aggregate interface optional
> >
> > .../sysfs-platform_profile | 12 ++
> > .../ABI/testing/sysfs-class-platform-profile | 2 +-
> > .../userspace-api/sysfs-platform_profile.rst | 55 ++++++--
> > MAINTAINERS | 5 +
> > drivers/acpi/Kconfig | 3 -
> > drivers/acpi/Makefile | 1 -
> > drivers/cpufreq/Kconfig.x86 | 2 +-
> > drivers/platform/Kconfig | 35 +++++
> > drivers/platform/Makefile | 2 +
> > drivers/platform/profile/Makefile | 5 +
> > drivers/platform/profile/acpi.c | 15 +++
> > .../profile/core.c} | 122 ++++++++++++++----
> > drivers/platform/profile/profile.h | 17 +++
> > drivers/platform/surface/Kconfig | 6 +-
> > drivers/platform/x86/Kconfig | 10 +-
> > drivers/platform/x86/amd/pmf/Kconfig | 2 +-
> > drivers/platform/x86/dell/Kconfig | 4 +-
> > drivers/platform/x86/hp/Kconfig | 2 +-
> > drivers/platform/x86/lenovo/Kconfig | 6 +-
> > drivers/thermal/intel/int340x_thermal/Kconfig | 2 +-
> > include/linux/platform_profile.h | 3 +
> > 21 files changed, 255 insertions(+), 56 deletions(-)
> > rename Documentation/ABI/{testing => obsolete}/sysfs-platform_profile (70%)
> > create mode 100644 drivers/platform/profile/Makefile
> > create mode 100644 drivers/platform/profile/acpi.c
> > rename drivers/{acpi/platform_profile.c => platform/profile/core.c} (88%)
> > create mode 100644 drivers/platform/profile/profile.h
> >
> >
> > base-commit: 8244dc8f69f0e73cb1789355260b7d68bf5494e7
>