Linux ACPI
 help / color / mirror / Atom feed
From: Luke Jones <luke@ljones.dev>
To: Mark Pearson <mpearson-lenovo@squebb.ca>,
	Antheas Kapenekakis <lkml@antheas.dev>,
	"Limonciello, Mario" <mario.limonciello@amd.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Len Brown" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Hans de Goede" <hdegoede@redhat.com>,
	me@kylegospodneti.ch
Subject: Re: [PATCH 0/3] ACPI: platform_profile: fix legacy sysfs with multiple handlers
Date: Tue, 25 Feb 2025 10:51:09 +1300	[thread overview]
Message-ID: <633bbd2d5469db5595f66c9eb6ea3172ab7c56b7.camel@ljones.dev> (raw)
In-Reply-To: <1c0c988b-8fe6-4857-9556-6ac6880b76ff@app.fastmail.com>

On Mon, 2025-02-24 at 15:52 -0500, Mark Pearson wrote:
> Hi Antheas,
> 
> On Mon, Feb 24, 2025, at 2:50 PM, Antheas Kapenekakis wrote:
> > On the Asus Z13 (2025), a device that would need the amd-pmf quirk
> > that
> > was removed on the platform_profile refactor, we see the following
> > output
> > from the sysfs platform profile:
> > 
> > $ cat /sys/firmware/acpi/platform_profile_choices
> > balanced performance
> > 
> > I.e., the quiet profile is missing. Which is a major regression in
> > terms of
> > power efficiency and affects both tuned, and ppd (it also affected
> > my
> > software but I fixed that on Saturday). This would affect any
> > laptop that
> > loads both amd-pmf and asus-wmi (around 15 models give or take?).
> > 
> > The problem stems from the fact that asus-wmi uses quiet, and amd-
> > pmf uses
> > low-power. While it is not clear to me what the amd-pmf module is
> > supposed
> > to do here, and perhaps some autodetection should be done and make
> > it bail,
> > if we assume it should be kept, then there is a small refactor that
> > is
> > needed to maintain the existing ABI interface.
> > 
> > This is the subject of this patch series.
> > 
> > Essentially, we introduce the concept of a "secondary" handler.
> > Secondary
> > handlers work exactly the same, except for the fact they are able
> > to
> > receive all profile names through the sysfs interface. The
> > expectation
> > here would be that the handlers choose the closest appropriate
> > profile
> > they have, and this is what I did for the amd-pmf handler.
> > 
> > In their own platform_profile namespace, these handlers still work
> > normally
> > and only accept the profiles from their probe functions, with -
> > ENOSUP for
> > the rest.
> > 
> > In the absence of a primary handler, the options of all secondary
> > handlers
> > are unioned in the legacy sysfs, which prevents them from hiding
> > each
> > other's options.
> > 
> > With this patch series applied, the sysfs interface will look like
> > this:
> > 
> > $ cat /sys/firmware/acpi/platform_profile_choices
> > quiet balanced performance
> > 
> > And writing quiet to it results in the profile being applied to
> > both
> > platform profile handlers.
> > 
> > $ echo low-power > /sys/firmware/acpi/platform_profile
> > bash: echo: write error: Operation not supported
> > $ echo quiet > /sys/firmware/acpi/platform_profile
> > $ cat /sys/class/platform-profile/platform-profile-*/{name,profile}
> > asus-wmi
> > amd-pmf
> > quiet
> > quiet
> > 
> > Agreed ABI still works:
> > $ echo quiet > /sys/class/platform-profile/platform-profile-
> > 0/profile
> > $ echo quiet > /sys/class/platform-profile/platform-profile-
> > 1/profile
> > bash: echo: write error: Operation not supported
> > $ echo low-power > /sys/class/platform-profile/platform-profile-
> > 0/profile
> > bash: echo: write error: Operation not supported
> > $ echo low-power > /sys/class/platform-profile/platform-profile-
> > 1/profile
> > 
> 
> I understand where you're coming from with this implementation but my
> concern is this is making profiles more complicated - and they're
> already becoming hard to understand (and debug) for users.
> 
> I'm not a huge fan of multiple profile handlers, but can see why some
> people might want them and that they're a valid tool to have
> (especially given some of the limitations of what platform vendors
> themselves implement).
> 
> In patch #3 it states that 'It is the expectation that secondary
> handlers will pick the closest profile they have to what was sent'.
> I'm not convinced that is true, or desired.
> 
> e.g. Quiet and low-power are different things and can have different
> implementations. One is giving you as much power as possible with the
> fans running below a certain audible level; and one is giving you a
> system with as low-power consumption as possible, but still be
> usable. They're admittedly not very different in practice - but they
> can be different.
> 
> Would it be better here to ask AMD to implement a quiet profile
> (maybe it can be based on low-power, at least initially)?
> I think that would solve the ASUS issue and not introduce another
> layer of complexity.
> 
> Mark

Hi Mark,

I've supported over 80 different ASUS laptops in the last 6 years or
so, I can offer some insight.

Across the entire range (TUF, ROG, Vivobook, Zen) which implements some
form of "thermal throttle" as it is called in asus-wmi (which is what
is used by platform_profile) the difference between low-power and quiet
is very much nil - the "quiet" profile is only a name, and the TDP is
limited along with fans to match - so the result is "low-power".

As Mario suggests in his reply perhaps an alias would be best, or, as I
was going to do, simply rename the "quiet" profile in asus-wmi to "low-
power" as I already did but have not submitted yet due to a large train
of patches in progress. It's a single line change and nullifies the
entire issue and this series.

In any case asus handling of platform profile is something I have been
steadily working on for the last few months for both laptops and
handhelds and I will have a new patch series coming soon (version 7 of
previously submitted dealing with this).

This submitted series is a NACK from me.

Cheers,
Luke.



  parent reply	other threads:[~2025-02-24 21:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 19:50 [PATCH 0/3] ACPI: platform_profile: fix legacy sysfs with multiple handlers Antheas Kapenekakis
2025-02-24 19:50 ` [PATCH 1/3] ACPI: platform_profile: Add support for secondary handlers Antheas Kapenekakis
2025-02-24 19:50 ` [PATCH 2/3] ACPI: platform_profile: add all options to amd-pmf as a secondary handler Antheas Kapenekakis
2025-02-24 19:50 ` [PATCH 3/3] ACPI: platform_profile: Do not hide options missing in secondary handlers Antheas Kapenekakis
2025-02-27 17:48   ` kernel test robot
2025-02-24 20:27 ` [PATCH 0/3] ACPI: platform_profile: fix legacy sysfs with multiple handlers Mario Limonciello
2025-02-24 20:31   ` Antheas Kapenekakis
2025-02-24 20:52 ` Mark Pearson
2025-02-24 21:08   ` Antheas Kapenekakis
2025-02-24 21:51   ` Luke Jones [this message]
2025-02-24 21:58     ` Antheas Kapenekakis
2025-02-24 22:49       ` Armin Wolf
2025-02-24 22:55         ` Antheas Kapenekakis
2025-02-24 22:58           ` Antheas Kapenekakis
2025-02-25 20:22             ` Rafael J. Wysocki
2025-02-25 20:24               ` Antheas Kapenekakis
2025-02-26 20:03                 ` Rafael J. Wysocki
2025-02-26 22:15                   ` Antheas Kapenekakis
2025-02-25  1:34       ` Luke Jones
2025-02-25  2:26         ` Antheas Kapenekakis
2025-02-25 15:56           ` Armin Wolf
2025-02-25 16:27             ` Antheas Kapenekakis
2025-02-24 22:42     ` Armin Wolf

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=633bbd2d5469db5595f66c9eb6ea3172ab7c56b7.camel@ljones.dev \
    --to=luke@ljones.dev \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@antheas.dev \
    --cc=mario.limonciello@amd.com \
    --cc=me@kylegospodneti.ch \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@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