From: Mohamed Ghanmi <mohamed.ghanmi@supcom.tn>
To: Armin Wolf <W_Armin@gmx.de>
Cc: corentin.chary@gmail.com, luke@ljones.dev,
srinivas.pandruvada@linux.intel.com, hdegoede@redhat.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 11:45:06 +0100 [thread overview]
Message-ID: <ZxzIMsffFj2lvScb@laptop> (raw)
In-Reply-To: <20241025191514.15032-3-W_Armin@gmx.de>
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()
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]
next prev parent reply other threads:[~2024-10-26 10:45 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 [this message]
2024-10-26 10:59 ` Hans de Goede
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=ZxzIMsffFj2lvScb@laptop \
--to=mohamed.ghanmi@supcom.tn \
--cc=Michael@phoronix.com \
--cc=W_Armin@gmx.de \
--cc=casey.g.bowman@intel.com \
--cc=corentin.chary@gmail.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luke@ljones.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.