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: <342144b1-6380-dda7-b40e-a9090a9c6b90@linux.intel.com>
Date: Fri, 11 Apr 2025 18:13:57 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Antheas Kapenekakis <lkml@...heas.dev>
cc: platform-driver-x86@...r.kernel.org, linux-hwmon@...r.kernel.org, 
    linux-doc@...r.kernel.org, linux-pm@...r.kernel.org, 
    Guenter Roeck <linux@...ck-us.net>, Jean Delvare <jdelvare@...e.com>, 
    Jonathan Corbet <corbet@....net>, 
    Joaquin Ignacio Aramendia <samsagax@...il.com>, 
    Derek J Clark <derekjohn.clark@...il.com>, 
    Kevin Greenberg <kdgreenberg234@...tonmail.com>, 
    Joshua Tam <csinaction@...me>, Parth Menon <parthasarathymenon@...il.com>, 
    Eileen <eileen@...-netbook.com>, LKML <linux-kernel@...r.kernel.org>, 
    sre@...nel.org, linux@...ssschuh.net, Hans de Goede <hdegoede@...hat.com>, 
    mario.limonciello@....com
Subject: Re: [PATCH v8 10/14] platform/x86: oxpec: Move fan speed read to
 separate function

On Sat, 22 Mar 2025, Antheas Kapenekakis wrote:

> While not necessary for fixing the ABI hwmon issue, fan speed will be
> the only remaining value without a function. Therefore, finish the
> refactor by moving it to a separate function.
> 
> Reviewed-by: Derek J. Clark <derekjohn.clark@...il.com>
> Reviewed-by: Thomas Weißschuh <linux@...ssschuh.net>
> Signed-off-by: Antheas Kapenekakis <lkml@...heas.dev>
> ---
>  drivers/platform/x86/oxpec.c | 53 ++++++++++++++++++++----------------
>  1 file changed, 29 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/platform/x86/oxpec.c b/drivers/platform/x86/oxpec.c
> index 67bfd397802d1..5b84647569931 100644
> --- a/drivers/platform/x86/oxpec.c
> +++ b/drivers/platform/x86/oxpec.c
> @@ -599,6 +599,34 @@ static umode_t oxp_ec_hwmon_is_visible(const void *drvdata,
>  	}
>  }
>  
> +/* Fan speed read function */
> +static int oxp_pwm_fan_speed(long *val)
> +{
> +	switch (board) {
> +	case orange_pi_neo:
> +		return read_from_ec(ORANGEPI_SENSOR_FAN_REG, 2, val);
> +	case oxp_2:
> +	case oxp_x1:
> +		return read_from_ec(OXP_2_SENSOR_FAN_REG, 2, val);
> +	case aok_zoe_a1:
> +	case aya_neo_2:
> +	case aya_neo_air:
> +	case aya_neo_air_1s:
> +	case aya_neo_air_plus_mendo:
> +	case aya_neo_air_pro:
> +	case aya_neo_flip:
> +	case aya_neo_geek:
> +	case aya_neo_kun:
> +	case oxp_fly:
> +	case oxp_mini_amd:
> +	case oxp_mini_amd_a07:
> +	case oxp_mini_amd_pro:
> +		return read_from_ec(OXP_SENSOR_FAN_REG, 2, val);
> +	default:
> +		return -EOPNOTSUPP;
> +	}
> +}
> +
>  /* PWM input read/write functions */
>  static int oxp_pwm_input_write(long val)
>  {
> @@ -693,30 +721,7 @@ static int oxp_platform_read(struct device *dev, enum hwmon_sensor_types type,
>  	case hwmon_fan:
>  		switch (attr) {
>  		case hwmon_fan_input:
> -			switch (board) {
> -			case orange_pi_neo:
> -				return read_from_ec(ORANGEPI_SENSOR_FAN_REG, 2, val);
> -			case oxp_2:
> -			case oxp_x1:
> -				return read_from_ec(OXP_2_SENSOR_FAN_REG, 2, val);
> -			case aok_zoe_a1:
> -			case aya_neo_2:
> -			case aya_neo_air:
> -			case aya_neo_air_1s:
> -			case aya_neo_air_plus_mendo:
> -			case aya_neo_air_pro:
> -			case aya_neo_flip:
> -			case aya_neo_geek:
> -			case aya_neo_kun:
> -			case oxp_fly:
> -			case oxp_mini_amd:
> -			case oxp_mini_amd_a07:
> -			case oxp_mini_amd_pro:
> -				return read_from_ec(OXP_SENSOR_FAN_REG, 2, val);
> -			default:
> -				break;
> -			}
> -			break;
> +			return oxp_pwm_fan_speed(val);
>  		default:
>  			break;
>  		}
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ