mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
To: rafael@kernel.org
Cc: "Len Brown" <lenb@kernel.org>, "Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Viresh Kumar" <viresh.kumar@linaro.org>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Maximilian Luz" <luzmaximilian@gmail.com>,
	"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
	"Mark Pearson" <mpearson-lenovo@squebb.ca>,
	"Derek J. Clark" <derekjohn.clark@gmail.com>,
	"Daniel Lezcano" <daniel.lezcano@kernel.org>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Lukasz Luba" <lukasz.luba@arm.com>,
	"Armin Wolf" <W_Armin@gmx.de>,
	"Jai Luthra" <jai.luthra@ideasonboard.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jack Wu" <jackbb_wu@compal.com>,
	"Mario Limonciello (AMD)" <superm1@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-pm@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v3 0/4] Make platform profiles firmware independent
Date: Mon, 9 Nov 2026 17:36:50 +0100	[thread overview]
Message-ID: <ed4aac63-ac58-4e2a-ae45-ebf4da158228@oss.qualcomm.com> (raw)
In-Reply-To: <20261024223501.1420953-1-daniel.lezcano@oss.qualcomm.com>


Hi,

sashiko validated this series

Is there any other comments for these changes I should take care of ?


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


  parent reply	other threads:[~2026-11-09 16:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 22:34 Daniel Lezcano
2026-10-24 22:34 ` [PATCH v3 1/4] platform profile: Extract the core from ACPI Daniel Lezcano
2026-10-24 22:34 ` [PATCH v3 2/4] platform profile: Complete class notifications and registration cleanup Daniel Lezcano
2026-10-24 22:34 ` [PATCH v3 3/4] platform profile: Document firmware-independent profile selection Daniel Lezcano
2026-10-24 22:34 ` [PATCH v3 4/4] platform profile: Make legacy ACPI aggregate interface optional Daniel Lezcano
2026-11-09 16:36 ` Daniel Lezcano [this message]
2026-11-09 16:46   ` [PATCH v3 0/4] Make platform profiles firmware independent Rafael J. Wysocki (Intel)
2026-11-09 17:39     ` Mario Limonciello
2026-11-09 19:37       ` Rafael J. Wysocki (Intel)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed4aac63-ac58-4e2a-ae45-ebf4da158228@oss.qualcomm.com \
    --to=daniel.lezcano@oss.qualcomm.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=W_Armin@gmx.de \
    --cc=corbet@lwn.net \
    --cc=daniel.lezcano@kernel.org \
    --cc=derekjohn.clark@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jackbb_wu@compal.com \
    --cc=jai.luthra@ideasonboard.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=luzmaximilian@gmail.com \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rui.zhang@intel.com \
    --cc=skhan@linuxfoundation.org \
    --cc=superm1@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®