public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Hridesh MG <hridesh699@gmail.com>,
	Mark Pearson <mpearson-lenovo@squebb.ca>
Cc: "Kurt Borja" <kuurtb@gmail.com>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	josh@joshuagrisham.com,
	"Derek J . Clark" <derekjohn.clark@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>,
	"Maximilian Luz" <luzmaximilian@gmail.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Lee Chun-Yi" <jlee@suse.com>,
	"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
	"Corentin Chary" <corentin.chary@gmail.com>,
	"Luke D . Jones" <luke@ljones.dev>,
	"Lyndon Sanche" <lsanche@lyndeno.ca>,
	"Ike Panhc" <ike.pan@canonical.com>,
	"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>,
	"Armin Wolf" <W_Armin@gmx.de>,
	"Colin Ian King" <colin.i.king@gmail.com>,
	"Alexis Belmonte" <alexbelm48@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Ai Chao" <aichao@kylinos.cn>, "Gergo Koteles" <soyer@irl.hu>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	linux-kernel@vger.kernel.org, Dell.Client.Kernel@dell.com,
	ibm-acpi-devel@lists.sourceforge.net
Subject: Re: [RFC PATCH 0/3] ACPI: platform_profile: Let drivers dynamically refresh choices
Date: Tue, 7 Jan 2025 09:51:18 -0600	[thread overview]
Message-ID: <2e71a4a9-6ec6-4ac7-8640-d80dcdfd7776@amd.com> (raw)
In-Reply-To: <CALiyAonc81o1FreDaWiik3XaqKYVf=wYHX+vaE2_1w66LhJTnA@mail.gmail.com>

On 1/7/2025 07:14, Hridesh MG wrote:
> On Tue, Jan 7, 2025 at 7:49 AM Mark Pearson <mpearson-lenovo@squebb.ca> wrote:
>>
>> Hi Kurt,
>>
>> On Sun, Jan 5, 2025, at 11:45 PM, Kurt Borja wrote:
>>> Hello,
>>>
>>> Some drivers may need to dynamically modify their selected `choices`.
>>> Such is the case of the acer-wmi driver, which implemented their own
>>> profile cycling method, because users expect different profiles to be
>>> available whether the laptop is on AC or not [1].
>>>
>>> These series would allow acer-wmi to simplify this custom cycling method
>>> to use platform_profile_cycle(), as it's already being proposed in these
>>> series [2]; without changing expected behaviors, by refreshing their
>>> selected choices on AC connect/disconnect events, which would also solve
>>> this discussion [3].
>>>
>>> Additionally, I think the platform_profile_ops approach would enable us
>>> to hide the platform_profile_handler in the future, and instead just pass
>>> the class device to get/set methods like the HWMON subsystem does.
>>>
>>> I think having this kind of flexibility is valuable. Let me know what you
>>> think!
>>>
>>
>> I personally would love to see how this would be used for the acer issue highlighted to see how it would work out. It feels like the series is short a patch :)
> 
> I do think that having this flexibility would be good, as i was
> considering manually clearing the set bits and calling platform_notify
> for the acer series, but in my specific case (for devices using the
> predator v4 interface) it was found that the hardware was responsive
> to all profiles regardless of AC/battery mode so it made sense to
> leave this kind of artificial limiting of profiles to the
> userspace--similar to how the Windows driver handles it through the
> Nitro Sense app.
> 
> I feel like users should have the power to utilize their hardware in
> the way they want it to, though if there is a compelling reason to
> limit the profiles then i'd be more than happy to add this to the
> series :)
> 
> 
> --
> Hridesh MG

I agree with Mark, this series is missing the patch that shows exactly 
how this would be used.  Furthermore; what exactly are the differences 
in choices between AC or DC?

To "userspace" I fail to understand how "balanced" is different from AC 
to DC for example.

If an implementation has differences for AC vs DC would it make more 
sense to have that abstraction in the "profile handlers" instead of the ops?

IE always have "low-power, balanced, performance" for choices. If the 
system is on AC the profile handler might do something different than on 
DC for a given state.

Another idea I had while thinking about this is that the platform 
profile core can have a sysfs file to indicate whether or not to "allow" 
power state sensitive values.

It could default to "1" and then it can send AC/DC events to the 
platform profile handlers when enabled.  If userspace prefers not to use 
it, then they can set it to 0 and then the profile handler would stop 
reacting.

  reply	other threads:[~2025-01-07 15:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06  4:45 [RFC PATCH 0/3] ACPI: platform_profile: Let drivers dynamically refresh choices Kurt Borja
2025-01-06  4:45 ` [RFC PATCH 1/3] ACPI: platform_profile: Add ops member to handlers Kurt Borja
2025-01-06  4:45 ` [RFC PATCH 2/3] ACPI: platform_profile: Add `choices` to platform_profile_ops Kurt Borja
2025-01-06  4:45 ` [RFC PATCH 3/3] ACPI: platform_profile: Add platform_profile_refresh_choices() Kurt Borja
2025-01-07  2:19 ` [RFC PATCH 0/3] ACPI: platform_profile: Let drivers dynamically refresh choices Mark Pearson
2025-01-07 13:14   ` Hridesh MG
2025-01-07 15:51     ` Mario Limonciello [this message]
2025-01-07 16:33       ` Hridesh MG
2025-01-07 16:47         ` Limonciello, Mario
2025-01-07 17:25           ` Kurt Borja
2025-01-07 17:28             ` Limonciello, Mario
2025-01-08  6:39               ` Kurt Borja

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=2e71a4a9-6ec6-4ac7-8640-d80dcdfd7776@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=W_Armin@gmx.de \
    --cc=aichao@kylinos.cn \
    --cc=alexbelm48@gmail.com \
    --cc=colin.i.king@gmail.com \
    --cc=corentin.chary@gmail.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=hmh@hmh.eng.br \
    --cc=hridesh699@gmail.com \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ike.pan@canonical.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jlee@suse.com \
    --cc=josh@joshuagrisham.com \
    --cc=kuurtb@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsanche@lyndeno.ca \
    --cc=luke@ljones.dev \
    --cc=luzmaximilian@gmail.com \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=soyer@irl.hu \
    --cc=u.kleine-koenig@baylibre.com \
    /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