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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <id64ds3aixtcpscvzhq6q5hd3ofyuqgdp5vk55jnlbattgxt7n@mq3qyxj74w37>
Date: Wed, 8 Jan 2025 08:34:28 -0500
From: Kurt Borja <kuurtb@...il.com>
To: Hridesh MG <hridesh699@...il.com>
Cc: Hans de Goede <hdegoede@...hat.com>, 
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>, Armin Wolf <W_Armin@....de>, platform-driver-x86@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH v3 2/5] platform/x86: acer-wmi: use new helper function
 for setting overclocks

On Wed, Jan 08, 2025 at 02:15:24PM +0530, Hridesh MG wrote:
> Migrate the OC handling in acer_toggle_turbo() to the new helper
> function for issuing the SetGamingMiscSetting WMI call.
> 
> Signed-off-by: Hridesh MG <hridesh699@...il.com>

Reviewed-by: Kurt Borja <kuurtb@...il.com>

> ---
>  drivers/platform/x86/acer-wmi.c | 26 +++++++++++++++++++-------
>  1 file changed, 19 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 97eabb0ec42781a27e6a00ce0df4c8a815c1b817..f662e3740408f70e1e921a90fe75ce441fd239d0 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -119,7 +119,14 @@ enum acer_wmi_predator_v4_sensor_id {
>  	ACER_WMID_SENSOR_GPU_TEMPERATURE	= 0x0A,
>  };
>  
> +enum acer_wmi_predator_v4_oc {
> +	ACER_WMID_OC_NORMAL			= 0x0000,
> +	ACER_WMID_OC_TURBO			= 0x0002,
> +};
> +
>  enum acer_wmi_gaming_misc_setting {
> +	ACER_WMID_MISC_SETTING_OC_1			= 0x0005,
> +	ACER_WMID_MISC_SETTING_OC_2			= 0x0007,
>  	ACER_WMID_MISC_SETTING_PLATFORM_PROFILE		= 0x000B,
>  };
>  
> @@ -1530,9 +1537,6 @@ static acpi_status WMID_gaming_set_u64(u64 value, u32 cap)
>  	case ACER_CAP_TURBO_FAN:
>  		method_id = ACER_WMID_SET_GAMING_FAN_BEHAVIOR;
>  		break;
> -	case ACER_CAP_TURBO_OC:
> -		method_id = ACER_WMID_SET_GAMING_MISC_SETTING_METHODID;
> -		break;
>  	default:
>  		return AE_BAD_PARAMETER;
>  	}
> @@ -1891,8 +1895,12 @@ static int acer_toggle_turbo(void)
>  		WMID_gaming_set_fan_mode(0x1);
>  
>  		/* Set OC to normal */
> -		WMID_gaming_set_u64(0x5, ACER_CAP_TURBO_OC);
> -		WMID_gaming_set_u64(0x7, ACER_CAP_TURBO_OC);
> +		if (has_cap(ACER_CAP_TURBO_OC)) {
> +			WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_1,
> +						     ACER_WMID_OC_NORMAL);
> +			WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_2,
> +						     ACER_WMID_OC_NORMAL);
> +		}
>  	} else {
>  		/* Turn on turbo led */
>  		WMID_gaming_set_u64(0x10001, ACER_CAP_TURBO_LED);
> @@ -1901,8 +1909,12 @@ static int acer_toggle_turbo(void)
>  		WMID_gaming_set_fan_mode(0x2);
>  
>  		/* Set OC to turbo mode */
> -		WMID_gaming_set_u64(0x205, ACER_CAP_TURBO_OC);
> -		WMID_gaming_set_u64(0x207, ACER_CAP_TURBO_OC);
> +		if (has_cap(ACER_CAP_TURBO_OC)) {
> +			WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_1,
> +						     ACER_WMID_OC_TURBO);
> +			WMID_gaming_set_misc_setting(ACER_WMID_MISC_SETTING_OC_2,
> +						     ACER_WMID_OC_TURBO);
> +		}
>  	}
>  	return turbo_led_state;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ