mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Mohamed Ghanmi <mohamed.ghanmi@supcom.tn>, Armin Wolf <W_Armin@gmx.de>
Cc: corentin.chary@gmail.com, luke@ljones.dev,
	srinivas.pandruvada@linux.intel.com,
	ilpo.jarvinen@linux.intel.com, Michael@phoronix.com,
	casey.g.bowman@intel.com, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] platform/x86: asus-wmi: Fix inconsistent use of thermal policies
Date: Sat, 26 Oct 2024 12:59:10 +0200	[thread overview]
Message-ID: <5310edec-7f18-48f8-b733-145fec39d0aa@redhat.com> (raw)
In-Reply-To: <ZxzIMsffFj2lvScb@laptop>

Hi,

On 26-Oct-24 12:45 PM, Mohamed Ghanmi wrote:
> On Fri, Oct 25, 2024 at 09:15:14PM +0200, Armin Wolf wrote:
>> When changing the thermal policy using the platform profile API,
>> a Vivobook thermal policy is stored in throttle_thermal_policy_mode.
>>
>> However everywhere else a normal thermal policy is stored inside this
>> variable, potentially confusing the platform profile.
>>
>> Fix this by always storing normal thermal policy values inside
>> throttle_thermal_policy_mode and only do the conversion when writing
>> the thermal policy to hardware.
>>
>> Fixes: bcbfcebda2cb ("platform/x86: asus-wmi: add support for vivobook fan profiles")
>> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
>> ---
>>  drivers/platform/x86/asus-wmi.c | 64 +++++++++++----------------------
>>  1 file changed, 21 insertions(+), 43 deletions(-)
> 
> the original patch that i submitted did actually have the remapping
> of the different fan profiles in the throttle_thermal_policy_write() methods 
> because it was the cleaner solution [1]. however after having a discussion with luke, 
> he shared that he might be planning to remove the throttle_thermal_policy sysfs interface 
> in favour of platform_profiles [2] because of a refactoring he had been working on.
> 
> currently to control fan profiles through this driver you could use
> either /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy
> (redundant and might get removed in the future) or through platform profiles which is the
> better way of doing things.
> 
> for the reasons mentionned above, I decided to keep
> throttle_therma_policy_write() unchanged and to move the remapping logic
> to the asus_wmi_platform_profile_set(). this adopts the approach of
> having a logical mapping stored in asus_wmi struct that has to be
> converted to a physical mapping whenever needed [3].
> 
> so, if luke thinks that this won't cause any merge conflicts with his
> work [4] then i see no problem with this approach even though it might cause an
> order change when calling throttle_thermal_policy_switch_next()

Talking about throttle_thermal_policy_switch_next() we also
have platform_profile_cycle() and since asus-wmi supports
platform-profiles now I'm wondering if it would not be better
to simply completely drop throttle_thermal_policy_switch_next()
and call platform_profile_cycle() instead?

This will also keep the cycle order the same for "normal" vs
vivo even after Armin's patch.

Anyways I'll go and apply patch 1/2 to pdx86/fixes since that one is
obviously correct and fixes th Lunar Lake performance issues.

And we can keep discussing what to do wrt 2/2 and maybe also drop
throttle_thermal_policy_switch_next() if favor of
platform_profile_cycle().

Regards,

Hans






> 
> Best Regards,
> Mohamed G.
> 
> Link: https://lore.kernel.org/platform-driver-x86/20240421194320.48258-2-mohamed.ghanmi@supcom.tn/ # [1]
> Link: https://lore.kernel.org/platform-driver-x86/4de768c5-aae5-4fda-a139-a8b73c8495a1@app.fastmail.com/ # [2]
> Link: https://lore.kernel.org/platform-driver-x86/ZnlEuiP4Dgqpf51C@laptop/ # [3]
> Link: https://lore.kernel.org/platform-driver-x86/20240930000046.51388-1-luke@ljones.dev/ # [4] 
> 


  reply	other threads:[~2024-10-26 10:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25 19:15 [PATCH 0/2] platform/x86: asus-wmi: Fix thermal profile handling Armin Wolf
2024-10-25 19:15 ` [PATCH 1/2] platform/x86: asus-wmi: Fix thermal profile initialization Armin Wolf
2024-10-26  4:23   ` srinivas pandruvada
2024-10-25 19:15 ` [PATCH 2/2] platform/x86: asus-wmi: Fix inconsistent use of thermal policies Armin Wolf
2024-10-26  9:56   ` Hans de Goede
2024-10-26 11:49     ` Armin Wolf
2024-10-26 10:45   ` Mohamed Ghanmi
2024-10-26 10:59     ` Hans de Goede [this message]
2024-10-26 11:55       ` Armin Wolf
2024-10-26 11:53     ` Armin Wolf
2024-10-26  4:09 ` [PATCH 0/2] platform/x86: asus-wmi: Fix thermal profile handling srinivas pandruvada
2024-10-29  1:19   ` Bowman, Casey G
2024-10-26  9:53 ` Hans de Goede

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=5310edec-7f18-48f8-b733-145fec39d0aa@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=Michael@phoronix.com \
    --cc=W_Armin@gmx.de \
    --cc=casey.g.bowman@intel.com \
    --cc=corentin.chary@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=mohamed.ghanmi@supcom.tn \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.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

all inboxes | Powered by JetHome®