[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <pujikyjijvcn3mmlayqmdkh5zyjqdrfmmz3jafxyhdhuo5ekam@ntttaqiw7iow>
Date: Wed, 27 Nov 2024 09:56:18 +0100
From: Uwe Kleine-König <ukleinek@...nel.org>
To: "Rafael V. Volkmer" <rafael.v.volkmer@...il.com>
Cc: linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] pwm: correct pwm->state.enabled handling to allow
fops control
Hello,
On Tue, Nov 26, 2024 at 06:24:14PM -0300, Rafael V. Volkmer wrote:
> Ensure pwm->state.enabled is consistently updated during enable and
> disable operations in ehrpwm_pwm_apply() to resolve this issue.
>
> Previously, when attempting to interact with the ti PWM driver through
> fops, the pwm->state.enabled field was not updated correctly after
> applying enable or disable. This led to a state mismatch where the
> driver's state detection logic prevented disabling the PWM through
> fops once it had been activated.
>
> Signed-off-by: Rafael V. Volkmer <rafael.v.volkmer@...il.com>
> ---
> drivers/pwm/pwm-tiehrpwm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
> index 0125e73b98df..9f939d535440 100644
> --- a/drivers/pwm/pwm-tiehrpwm.c
> +++ b/drivers/pwm/pwm-tiehrpwm.c
> @@ -420,6 +420,7 @@ static int ehrpwm_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> if (!state->enabled) {
> if (enabled)
> ehrpwm_pwm_disable(chip, pwm);
> + pwm->state.enabled = false;
This is a layer violation (pwm->state is under control of core.c only)
and uses irritating indention.
Please rethink!
Best regards
Uwe
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists