public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Bonnefille" <thomas.bonnefille@bootlin.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>,
	"Jingbao Qiu" <qiujingbao.dlmu@gmail.com>
Cc: <robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
	<unicorn_wang@outlook.com>, <dlan@gentoo.org>,
	<linux-pwm@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 2/2] pwm: sophgo: add pwm support for Sophgo CV1800 SoC
Date: Sun, 06 Apr 2025 02:16:41 +0200	[thread overview]
Message-ID: <D8Z4GLQZGKKS.37TDZ7QBN4V4N@bootlin.com> (raw)
In-Reply-To: <k6jbdbhkgwthxwutty6l4q75wds2nilb3chrv7n4ccycnzllw4@yubxfh5ciahr>

Hello,

On Sat Jun 1, 2024 at 1:53 PM CEST, Uwe Kleine-König wrote:
> On Wed, May 01, 2024 at 04:32:42PM +0800, Jingbao Qiu wrote:
>> [...]
>> +	if ((state & BIT(pwm->hwpwm)) && enable)
>> +		regmap_update_bits(priv->map, PWM_CV1800_OE,
>> +				   PWM_CV1800_OE_MASK(pwm->hwpwm),
>> +				   PWM_CV1800_REG_ENABLE(pwm->hwpwm));
>
> This looks strange. If BIT(hwpwm) is already set, set it again?!
> Also if you used the caching implemented in regmap, you don't need to
> make this conditional.
>

I was testing the series and noticed indeed an issue in this driver at
those lines. If PWM_CV1800_OE isn't set by something else than the
kernel it will never be set and so, there will never be a PWM outputted.

Using :
    if (!(state & BIT(pwm->hwpwm)) && enable)
Solved the issue but as Uwe said you can probably rely on regmap caching
to avoid this condition.

>
> ...
> 

Do you plan on sending a new iteration some day ? I may have some time
to continue the upstreaming process if you need to.

Thank you for this series !
Thomas

  reply	other threads:[~2025-04-06  0:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01  8:32 [PATCH v7 0/2] riscv: pwm: sophgo: add pwm support for CV1800 Jingbao Qiu
2024-05-01  8:32 ` [PATCH v7 1/2] dt-bindings: pwm: sophgo: add pwm for Sophgo CV1800 series SoC Jingbao Qiu
2024-05-01  8:32 ` [PATCH v7 2/2] pwm: sophgo: add pwm support for Sophgo CV1800 SoC Jingbao Qiu
2024-06-01 11:53   ` Uwe Kleine-König
2025-04-06  0:16     ` Thomas Bonnefille [this message]
2025-04-07  5:38       ` Jingbao Qiu
2025-04-09  6:25         ` Chen Wang
2025-04-07  7:21       ` Inochi Amaoto
2025-04-08  7:54         ` Thomas Bonnefille
2025-04-08 10:15           ` Inochi Amaoto
2024-05-03  1:47 ` [PATCH v7 0/2] riscv: pwm: sophgo: add pwm support for CV1800 Chen Wang
2024-05-04  6:49   ` Jingbao Qiu

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=D8Z4GLQZGKKS.37TDZ7QBN4V4N@bootlin.com \
    --to=thomas.bonnefille@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=qiujingbao.dlmu@gmail.com \
    --cc=robh@kernel.org \
    --cc=ukleinek@kernel.org \
    --cc=unicorn_wang@outlook.com \
    /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