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]
Date:   Wed, 15 Mar 2023 19:26:26 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Lorenz Brun <lorenz@...n.one>
Cc:     Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: pwm-fan: set usage_power on PWM state

On Thu, Mar 09, 2023 at 02:10:08AM +0100, Lorenz Brun wrote:
> PWM fans are controlled solely by the duty cycle of the PWM signal, they
> do not care about the exact timing. Thus set usage_power to true to
> allow less flexible hardware to work as a PWM source for fan control.
> 

This doesn't seem to be used anywhere else. I do not understand the
rationale, and I do not understand the practical impact of this change.
This needs to be confirmed by someone who understands what the flag is
supposed to be used for, its impact, and if it is indeed appropriate
in this context.

Also, since in practice there is no such "less flexible hardware"
in the upstream kernel, please describe the use case in more detail.
The only pwm driver that supports usage_power is pwm-pca9685,
and that driver uses the flag for EMI reasons, not because it is
"less flexible hardware". I am not inclined to accept such a change
without specific use case or need.

Thanks,
Guenter

> Signed-off-by: Lorenz Brun <lorenz@...n.one>
> ---
>  drivers/hwmon/pwm-fan.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
> index 83a347ca35da..aa746c2bde39 100644
> --- a/drivers/hwmon/pwm-fan.c
> +++ b/drivers/hwmon/pwm-fan.c
> @@ -507,6 +507,14 @@ static int pwm_fan_probe(struct platform_device *pdev)
>  
>  	pwm_init_state(ctx->pwm, &ctx->pwm_state);
>  
> +	/*
> +	 * PWM fans are controlled solely by the duty cycle of the PWM signal,
> +	 * they do not care about the exact timing. Thus set usage_power to true
> +	 * to allow less flexible hardware to work as a PWM source for fan
> +	 * control.
> +	 */
> +	ctx->pwm_state.usage_power = true;
> +
>  	/*
>  	 * set_pwm assumes that MAX_PWM * (period - 1) fits into an unsigned
>  	 * long. Check this here to prevent the fan running at a too low

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ