All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: keguang.zhang@gmail.com
Cc: Binbin Zhou <zhoubinbin@loongson.cn>,
	linux-pwm@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] pwm: loongson: Reload PWM configuration through counter reset
Date: Wed, 17 Jun 2026 18:11:15 +0200	[thread overview]
Message-ID: <ajLFi7NpYQVcR_4I@monoceros> (raw)
In-Reply-To: <20260616-pwm-loongson-fix-v1-2-491dbf260a7f@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

Hello,

On Tue, Jun 16, 2026 at 07:13:18PM +0800, Keguang Zhang via B4 Relay wrote:
> From: Keguang Zhang <keguang.zhang@gmail.com>
> 
> By default, the Loongson PWM controller latches the LOW and PERIOD
> registers only at the start of each PWM period, causing configuration
> updates to be delayed until the next period.
>
> Reset the PWM counter when disabling the PWM and release it when enabling
> the PWM to force the controller to re-latch the updated LOW and PERIOD
> values, allowing configuration changes to take effect immediately.

To get this right, so if the hardware runs with PERIOD = 17 and then is
disabled with say the counter at 4, and later restarted with PERIOD =
12, the counter first goes up to 17 before the 12 becomes active, right? 

I think the commit log is a bit irritating, because (IIUC) you only
change the behaviour when the PWM is disabled and then reenabled. If the
configuration is changed while the PWM is running, the effect is still
delayed until the current period ends (which is complete fine and even
preferred).

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-06-17 16:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 11:13 [PATCH 0/2] pwm: loongson: Fix PWM configuration handling Keguang Zhang via B4 Relay
2026-06-16 11:13 ` Keguang Zhang
2026-06-16 11:13 ` [PATCH 1/2] pwm: loongson: Fix low pulse buffer register handling Keguang Zhang via B4 Relay
2026-06-16 11:13   ` Keguang Zhang
2026-06-17 16:03   ` Uwe Kleine-König
2026-06-16 11:13 ` [PATCH 2/2] pwm: loongson: Reload PWM configuration through counter reset Keguang Zhang via B4 Relay
2026-06-16 11:13   ` Keguang Zhang
2026-06-17 16:11   ` Uwe Kleine-König [this message]

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=ajLFi7NpYQVcR_4I@monoceros \
    --to=ukleinek@kernel.org \
    --cc=keguang.zhang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=zhoubinbin@loongson.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.