The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Janne Grunau <j@jannau.net>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Armin Wolf <W_Armin@gmx.de>,
	lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 1/2] ACPI: platform_profile: Add support for non-ACPI platforms
Date: Fri, 23 May 2025 18:29:17 +0200	[thread overview]
Message-ID: <20250523162917.GC2575813@robin.jannau.net> (raw)
In-Reply-To: <CAJZ5v0icRdTSToaKbdf=MdRin4NyB2MstUVaQo8VR6-n7DkVMQ@mail.gmail.com>

On Fri, May 23, 2025 at 04:39:59PM +0200, Rafael J. Wysocki wrote:
> On Thu, May 22, 2025 at 6:34 AM Armin Wolf <W_Armin@gmx.de> wrote:
> >
> > Am 21.05.25 um 22:17 schrieb Rafael J. Wysocki:
> >
> > > On Sun, May 18, 2025 at 8:51 PM Armin Wolf <W_Armin@gmx.de> wrote:
> > >> Currently the platform profile subsystem assumes that all supported
> > >> (i.e. ACPI-capable) platforms always run with ACPI being enabled.
> > >> However some ARM64 notebooks do not support ACPI and are instead
> > >> using devicetree for booting.
> > >>
> > >> Do not register the legacy sysfs interface on such devices as it
> > >> depends on the acpi_kobj (/sys/firmware/acpi/) being present. Users
> > >> are encouraged to use the new platform-profile class interface
> > >> instead.
> > > So how does it work in this case?
> > >
> > The platform profile subsystem also exposes a more modern class-based sysfs interface,
> > see Documentation/ABI/testing/sysfs-class-platform-profile for details.
> >
> > This interface does not depend on /sys/firmware/acpi being present, so userspace
> > programs can still control the platform profiles using the class-based interface.
> >
> > This will become very important once we have platform profile drivers not depending on
> > some sort of ACPI interface. I suspect that sooner or later some drivers for the embedded
> > controllers on ARM64 notebooks (devicetree!) will register with the platform profile subsystem.
> >
> > Apart from that this allows input drivers using platform_profile_cycle() to work on non-ACPI
> > platforms (like ARm64 devices using devicetree).
> 
> This driver though is located in drivers/acpi/ and depends on
> CONFIG_ACPI.  Moreover, the platform profile provider drivers need to
> select ACPI_PLATFORM_PROFILE so it gets built.  This means that there
> are no non-ACPI platform profile providers currently in the tree.
> 
> While the observation that the code in the driver, other than the
> legacy sysfs interface, doesn't really depend on ACPI is valid, if you
> want it to be used on systems without ACPI, it needs to be properly
> converted to a generic driver.
> 
> For now, it is better to simply make it fail to initialize without
> ACPI, so I'm going to apply this patch:
> 
> https://patchwork.kernel.org/project/linux-acpi/patch/20250522141410.31315-1-alexghiti@rivosinc.com/

That unfortunately does not help with the hid-lenovo regression. Commit
84c9d2a968c8 ("HID: lenovo: Support for ThinkPad-X12-TAB-1/2 Kbd Fn
keys") added a platform_profile_cycle() call and thus a dependency on
platform_profile. hid-lenovo is used for USB and Bluetooth devices and
not just for Lenovo laptop/tablet specific devices.
Above patch just avoids the warning splat but still prevents loading
hid-lenovo when ACPI is enabled in the kernel (like Distro kernels) on
a non-ACPI system. This breaks devices like "Lenovo ThinkPad Compact
Keyboard with TrackPoint" on such systems.

I will send a patch to remove platform_profile_cycle() call as short
term regression fix and tell the original author to to resubmit once the
platform_profile dependency on non-ACPI systems is worked out.

Janne

  reply	other threads:[~2025-05-23 16:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-18 18:51 [PATCH 1/2] ACPI: platform_profile: Add support for non-ACPI platforms Armin Wolf
2025-05-18 18:51 ` [PATCH 2/2] ACPI: bus: Bail out if acpi_kobj registration fails Armin Wolf
2025-05-23 14:56   ` Rafael J. Wysocki
2025-05-21 20:17 ` [PATCH 1/2] ACPI: platform_profile: Add support for non-ACPI platforms Rafael J. Wysocki
2025-05-22  4:34   ` Armin Wolf
2025-05-23 14:39     ` Rafael J. Wysocki
2025-05-23 16:29       ` Janne Grunau [this message]
2025-05-23 18:02         ` Rafael J. Wysocki

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=20250523162917.GC2575813@robin.jannau.net \
    --to=j@jannau.net \
    --cc=W_Armin@gmx.de \
    --cc=arnd@arndb.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.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