From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Kurt Borja <kuurtb@gmail.com>
Cc: Armin Wolf <W_Armin@gmx.de>, Hans de Goede <hdegoede@redhat.com>,
platform-driver-x86@vger.kernel.org,
Dell.Client.Kernel@dell.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 03/12] platform/x86: alienware-wmi-wmax: Improve internal AWCC API
Date: Mon, 31 Mar 2025 19:06:36 +0300 (EEST) [thread overview]
Message-ID: <663611d4-3def-248e-1db7-54be7202677f@linux.intel.com> (raw)
In-Reply-To: <D8S7MF97YEGI.21PR2NBB42QRS@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3527 bytes --]
On Fri, 28 Mar 2025, Kurt Borja wrote:
> On Fri Mar 28, 2025 at 11:51 AM -03, Ilpo Järvinen wrote:
> > On Thu, 13 Mar 2025, Kurt Borja wrote:
> >
> >> Inline all AWCC WMI helper methods and directly return the newly
> >> introduced __awcc_wmi_command() helper to simplify implementation.
> >>
> >> Drop awcc_thermal_control() in favor of awcc_op_activate_profile().
> >>
> >> Add awcc_op_get_resource_id(), awcc_op_get_current_profile() and a new
> >> failure code.
> >>
> >> Reviewed-by: Armin Wolf <W_Armin@gmx.de>
> >> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> >> ---
> >> drivers/platform/x86/dell/alienware-wmi-wmax.c | 150 +++++++++++++++----------
> >> 1 file changed, 91 insertions(+), 59 deletions(-)
> >>
> >> diff --git a/drivers/platform/x86/dell/alienware-wmi-wmax.c b/drivers/platform/x86/dell/alienware-wmi-wmax.c
> >> index 80aefba5b22d6b4ac18aeb2ca356f8c911150abd..b9dbfdc8096c571722b3c7ac3e73989e235e2eb9 100644
> >> --- a/drivers/platform/x86/dell/alienware-wmi-wmax.c
> >> +++ b/drivers/platform/x86/dell/alienware-wmi-wmax.c
> >> @@ -32,6 +32,7 @@
> >> #define AWCC_THERMAL_MODE_GMODE 0xAB
> >>
> >> #define AWCC_FAILURE_CODE 0xFFFFFFFF
> >> +#define AWCC_FAILURE_CODE_2 0xFFFFFFFE
> >> #define AWCC_THERMAL_TABLE_MASK GENMASK(7, 4)
> >> #define AWCC_THERMAL_MODE_MASK GENMASK(3, 0)
> >> /* Some IDs have a BIT(8) flag that we ignore */
> >> @@ -443,8 +444,7 @@ const struct attribute_group wmax_deepsleep_attribute_group = {
> >> };
> >>
> >> /*
> >> - * Thermal Profile control
> >> - * - Provides thermal profile control through the Platform Profile API
> >> + * AWCC Helpers
> >> */
> >> static bool is_awcc_thermal_profile_id(u8 code)
> >> {
> >> @@ -463,72 +463,107 @@ static bool is_awcc_thermal_profile_id(u8 code)
> >> return false;
> >> }
> >>
> >> -static int awcc_thermal_information(struct wmi_device *wdev, u8 operation,
> >> - u8 arg, u32 *out_data)
> >> +static int __awcc_wmi_command(struct wmi_device *wdev, u32 method_id,
> >> + struct wmax_u32_args *args, u32 *out)
> >
> > Why did you put __ into the name?
> >
> > Some people oppose __ prefix altogether, I don't entirely agree with their
> > stance but I don't really understand what the underscores here signify.
> >
> > Normally I see __ being used in three main cases:
> > - non-__ variant does some locking around the call too the __ func (though
> > many funcs use _locked postfix these days).
> > - func is "dangerous" and caller has to really know what he/she is
> > doing / be careful for some reason.
> > - non-__ variant exists and somebody cannot come up better name for the
> > internally called function (not very good use case, IMHO)
>
> Oh - I didn't know. Andy also mentioned this prefix is used for
> non-atomic versions of some functions like __set_bit().
I mentioned locking which relates to atomicity, however, here you don't
have two variants, one without locking and the other with it so it becomes
very non-obvious what __ means. (I know you posted v7 without it, so
this is just a clarifying comment.)
> > I don't see any of those apply here, this looks just an ordinary wrapper
> > function, thus the question.
>
> I did it to indicate it's a "private" method, so it's not used directly.
> But ofc that's not the convention here, so I'll drop it.
We have "static" for that. And it's called by something anyway or it would
be dead code :-).
--
i.
next prev parent reply other threads:[~2025-03-31 16:06 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 14:29 [PATCH v6 00/12] platform/x86: alienware-wmi-wmax: HWMON support + DebugFS + Improvements Kurt Borja
2025-03-13 14:29 ` [PATCH v6 01/12] platform/x86: alienware-wmi-wmax: Rename thermal related symbols Kurt Borja
2025-03-28 14:02 ` Ilpo Järvinen
2025-03-13 14:29 ` [PATCH v6 02/12] platform/x86: alienware-wmi-wmax: Refactor is_awcc_thermal_mode() Kurt Borja
2025-03-28 14:17 ` Ilpo Järvinen
2025-03-28 21:10 ` Kurt Borja
2025-03-13 14:29 ` [PATCH v6 03/12] platform/x86: alienware-wmi-wmax: Improve internal AWCC API Kurt Borja
2025-03-28 14:51 ` Ilpo Järvinen
2025-03-28 21:16 ` Kurt Borja
2025-03-31 16:06 ` Ilpo Järvinen [this message]
2025-03-13 14:29 ` [PATCH v6 04/12] platform/x86: alienware-wmi-wmax: Modify supported_thermal_profiles[] Kurt Borja
2025-03-13 14:30 ` [PATCH v6 05/12] platform/x86: alienware-wmi-wmax: Improve platform profile probe Kurt Borja
2025-03-28 15:03 ` Ilpo Järvinen
2025-03-28 21:18 ` Kurt Borja
2025-03-13 14:30 ` [PATCH v6 06/12] platform/x86: alienware-wmi-wmax: Add support for the "custom" thermal profile Kurt Borja
2025-03-28 15:05 ` Ilpo Järvinen
2025-03-13 14:30 ` [PATCH v6 07/12] platform/x86: alienware-wmi-wmax: Add HWMON support Kurt Borja
2025-03-13 14:30 ` [PATCH v6 08/12] platform/x86: alienware-wmi-wmax: Add support for manual fan control Kurt Borja
2025-03-28 16:15 ` Ilpo Järvinen
2025-03-13 14:30 ` [PATCH v6 09/12] platform/x86: alienware-wmi-wmax: Add a DebugFS interface Kurt Borja
2025-03-28 16:18 ` Ilpo Järvinen
2025-03-28 21:25 ` Kurt Borja
2025-03-13 14:30 ` [PATCH v6 10/12] Documentation: wmi: Improve and update alienware-wmi documentation Kurt Borja
2025-03-13 14:30 ` [PATCH v6 11/12] Documentation: admin-guide: laptops: Add documentation for alienware-wmi Kurt Borja
2025-03-28 16:22 ` Ilpo Järvinen
2025-03-13 14:30 ` [PATCH v6 12/12] Documentation: ABI: Add sysfs platform and debugfs ABI " Kurt Borja
2025-03-17 0:32 ` [PATCH v6 00/12] platform/x86: alienware-wmi-wmax: HWMON support + DebugFS + Improvements Armin Wolf
2025-03-25 20:14 ` Kurt Borja
2025-03-26 8:34 ` Ilpo Järvinen
2025-03-26 14:11 ` 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=663611d4-3def-248e-1db7-54be7202677f@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=W_Armin@gmx.de \
--cc=hdegoede@redhat.com \
--cc=kuurtb@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.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 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.