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]
Date:   Thu, 23 Nov 2023 17:30:23 +0200 (EET)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     SungHwan Jung <onenowy@...il.com>
cc:     Hans de Goede <hdegoede@...hat.com>,
        "Lee, Chun-Yi" <jlee@...e.com>, Jean Delvare <jdelvare@...e.com>,
        Guenter Roeck <linux@...ck-us.net>,
        platform-driver-x86@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>, linux-hwmon@...r.kernel.org
Subject: Re: [PATCH v3 2/2] platform/x86: acer-wmi: add fan speed monitoring
 for Predator PHN16-71

On Fri, 24 Nov 2023, SungHwan Jung wrote:

> Support CPU and GPU fan speed monitoring through WMI for Predator
> PHN16-71.
> 
> This patch depends on patch "platform/x86: acer-wmi: Add platform
> profile and mode key support for Predator PHN16-71"
> 
> "select ACPI_VIDEO" cause recursive dependency and it is not recommended
> to use "select" for visible symbol, "select" has changed to "depends on".
> 
> Signed-off-by: SungHwan Jung <onenowy@...il.com>
> ---
>  drivers/platform/x86/Kconfig    |  3 +-
>  drivers/platform/x86/acer-wmi.c | 98 ++++++++++++++++++++++++++++++++-
>  2 files changed, 99 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 7e69fdacc..33ddb644e 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -177,7 +177,8 @@ config ACER_WMI
>  	depends on INPUT
>  	depends on RFKILL || RFKILL = n
>  	depends on ACPI_WMI
> -	select ACPI_VIDEO
> +	depends on HWMON
> +	depends on ACPI_VIDEO
>  	select INPUT_SPARSEKMAP
>  	select LEDS_CLASS
>  	select NEW_LEDS
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index e3650dce0..f2f3b1c45 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
>  static const struct key_entry acer_wmi_keymap[] __initconst = {
> @@ -241,6 +244,7 @@ struct hotkey_function_type_aa {
>  #define ACER_CAP_TURBO_LED     BIT(8)
>  #define ACER_CAP_TURBO_FAN     BIT(9)
>  #define ACER_CAP_PLATFORM_PROFILE BIT(10)
> +#define ACER_CAP_FAN_SPEED_READ BIT(11)

It would be nice to align these with tabs.

> @@ -1722,6 +1727,25 @@ static int acer_gsensor_event(void)
>  	return 0;
>  }
>  
> +static int acer_get_fan_speed(int fan)
> +{
> +	if (quirks->predator_v4) {
> +		acpi_status status;
> +		u64 fanspeed;
> +
> +		status = WMI_gaming_execute_u64(
> +			ACER_WMID_GET_GAMING_SYS_INFO_METHODID,
> +			fan == 0 ? ACER_WMID_CMD_GET_PREDATOR_V4_CPU_FAN_SPEED :
> +				   ACER_WMID_CMD_GET_PREDATOR_V4_GPU_FAN_SPEED,
> +			&fanspeed);
> +
> +		if (ACPI_FAILURE(status))
> +			return -EIO;
> +		return fanspeed >> 8;

Define a named field using GENMASK() and use FIELD_GET() ?


-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ