lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tprks7flnquxt2zqu5zavdpgmsrgh6gmvfrexeom25jbm6fjmi@2fnholyv2c35>
Date: Thu, 5 Dec 2024 09:56:59 -0300
From: Kurt Borja <kuurtb@...il.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Dell.Client.Kernel@...l.com, Hans de Goede <hdegoede@...hat.com>, 
	LKML <linux-kernel@...r.kernel.org>, mario.limonciello@....com, platform-driver-x86@...r.kernel.org, 
	w_armin@....de
Subject: Re: [RFC PATCH 17/21] alienware-wmi: Drop thermal methods dependency
 on quirks

On Thu, Dec 05, 2024 at 01:14:43PM +0200, Ilpo Järvinen wrote:
> On Wed, 4 Dec 2024, Kurt Borja wrote:
> 
> > Make the `gmode` condition on AWCC WMI devices part of the device's
> > state container, and refactor "platform_profile" methods accordingly.
> > 
> > Signed-off-by: Kurt Borja <kuurtb@...il.com>
> > ---
> >  drivers/platform/x86/dell/alienware-wmi.c | 13 +++++++------
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c
> > index fa21a50d66bd..7137995d5983 100644
> > --- a/drivers/platform/x86/dell/alienware-wmi.c
> > +++ b/drivers/platform/x86/dell/alienware-wmi.c
> > @@ -407,6 +407,7 @@ struct awcc_priv {
> >  	struct wmi_device *wdev;
> >  	struct platform_profile_handler pp_handler;
> >  	enum wmax_thermal_mode supported_thermal_profiles[PLATFORM_PROFILE_LAST];
> > +	bool has_gmode;
> >  };
> >  
> >  struct alienfx_priv {
> > @@ -1044,7 +1045,7 @@ static int thermal_profile_set(struct platform_profile_handler *pprof,
> >  
> >  	priv = container_of(pprof, struct awcc_priv, pp_handler);
> >  
> > -	if (quirks->gmode) {
> > +	if (priv->has_gmode) {
> >  		u32 gmode_status;
> >  		int ret;
> >  
> > @@ -1070,7 +1071,7 @@ static int thermal_profile_set(struct platform_profile_handler *pprof,
> >  				    priv->supported_thermal_profiles[profile]);
> >  }
> >  
> > -static int create_thermal_profile(struct wmi_device *wdev)
> > +static int create_thermal_profile(struct wmi_device *wdev, bool has_gmode)
> >  {
> >  	struct awcc_priv *priv;
> >  	u32 out_data;
> > @@ -1115,7 +1116,8 @@ static int create_thermal_profile(struct wmi_device *wdev)
> >  	if (bitmap_empty(priv->pp_handler.choices, PLATFORM_PROFILE_LAST))
> >  		return -ENODEV;
> >  
> > -	if (quirks->gmode) {
> > +	if (has_gmode) {
> > +		priv->has_gmode = true;
> >  		priv->supported_thermal_profiles[PLATFORM_PROFILE_PERFORMANCE] =
> >  			WMAX_THERMAL_MODE_GMODE;
> >  
> > @@ -1130,8 +1132,7 @@ static int create_thermal_profile(struct wmi_device *wdev)
> >  
> >  static void remove_thermal_profile(void)
> >  {
> > -	if (quirks->thermal)
> > -		platform_profile_remove();
> > +	platform_profile_remove();
> 
> Did you intend to make this change in this patch?
> 
> I'm unable to confirm why the if () could now be removed and how it is 
> related to other parts of this patch.

This is indeed should not be part of this patch.

In patch 08/21 wmax_wmi_remove() checks for quirks->thermal before
calling remove_thermal_profile() so the this check is safe to drop.

> 
> >  }
> >  
> >  /*
> > @@ -1339,7 +1340,7 @@ static int wmax_wmi_probe(struct wmi_device *wdev, const void *context)
> >  	};
> >  
> >  	if (quirks->thermal)
> > -		ret = create_thermal_profile(wdev);
> > +		ret = create_thermal_profile(wdev, quirks->gmode);
> >  	else if (quirks->num_zones > 0)
> >  		ret = alienfx_wmi_init(&pdata);
> >  
> > 
> 
> -- 
>  i.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ