linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karel Balej" <balejk@matfyz.cz>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: <regressions@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<linux-pwm@vger.kernel.org>
Subject: Re: [PATCH] pwm: Fix setting period with #pwm-cells = <1> and of_pwm_single_xlate()
Date: Fri, 29 Mar 2024 12:21:15 +0100	[thread overview]
Message-ID: <D06708BSGQ0J.1L4YOKOADM7T6@matfyz.cz> (raw)
In-Reply-To: <20240329103544.545290-2-u.kleine-koenig@pengutronix.de>

Uwe Kleine-König, 2024-03-29T11:35:40+01:00:
> For drivers making use of of_pwm_single_xlate() (i.e. those that don't
> pass a hwpwm index) and also don't pass flags, setting period was
> wrongly skipped. This affects the pwm-pxa and ti-sn65dsi86 drivers.
>
> Reported-by: Karel Balej <balejk@matfyz.cz>
> Fixes: 40ade0c2e794 ("pwm: Let the of_xlate callbacks accept references without period")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/pwm/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
> index 54a62879fffa..ee3ef3f44bc5 100644
> --- a/drivers/pwm/core.c
> +++ b/drivers/pwm/core.c
> @@ -512,7 +512,7 @@ of_pwm_single_xlate(struct pwm_chip *chip, const struct of_phandle_args *args)
>  	if (IS_ERR(pwm))
>  		return pwm;
>  
> -	if (args->args_count > 1)
> +	if (args->args_count > 0)
>  		pwm->args.period = args->args[0];
>  
>  	pwm->args.polarity = PWM_POLARITY_NORMAL;
> -- 
> 2.43.0

Thank you, this fixes the issue for me.

Tested-by: Karel Balej <balejk@matfyz.cz>

Just a nit: I am not sure if perhaps this being part of the report
thread is sufficient, but generally there should probably also be a
Closes: trailer for regzbot to automatically mark the report as resolved
among other reasons.

Best regards,
K. B.

  reply	other threads:[~2024-03-29 11:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 16:27 [REGRESSION] PWM vibrator does not probe with v6.9-rc1 Karel Balej
2024-03-29 10:35 ` [PATCH] pwm: Fix setting period with #pwm-cells = <1> and of_pwm_single_xlate() Uwe Kleine-König
2024-03-29 11:21   ` Karel Balej [this message]
2024-03-29 13:24     ` Uwe Kleine-König
2024-03-29 14:09       ` Linux regression tracking (Thorsten Leemhuis)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D06708BSGQ0J.1L4YOKOADM7T6@matfyz.cz \
    --to=balejk@matfyz.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).