From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD69942050; Wed, 17 Jun 2026 16:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781712685; cv=none; b=iphvNBg1sPRt+PCWrOMSJkaWpu9GrPL+EeJ2tRslOPMRBLn3KbkqxjxUA3uwnSPnrwhRfQCNhyvjLGWjptBiqg3apA07vTzyp9PNq0MwVPpfa1Ep1vY36+yRf4oAfD628MB0Yu8Ii9qRoc08GJcspMgWZHFpIadQ9OKAv3Cip6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781712685; c=relaxed/simple; bh=b4bet+WzXHeWHI5YMWUNFNdpIrqfDuFYca3TeOTmh0I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YmzW5KY9eRW6KiXRzcavSM7saYXt9laM1/6EPU5XBXAoEWNrKPxiYRPfNl3axLaWJGos4Tgokjpm4cFZS3CHXQGkAF4NhamnWC5PJEDkAVyYrxIuDHgvYBOUHMwWL/qV+pWhYuJ6FJ1Pgd0m1L3JySd1IMr4zYA0aKvihiAgqHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rew1IxI6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rew1IxI6" Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id 6465E1F000E9; Wed, 17 Jun 2026 16:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781712677; bh=b4bet+WzXHeWHI5YMWUNFNdpIrqfDuFYca3TeOTmh0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Rew1IxI6/tQGVLFP/hzcDQ6v2QfSaqCQiFIQkeHepW0SUdwCAT+mMF4oGkd8Ji/Ix Z3IVAbaoCVcTIcqmLq8nWzXOqMsfoTcLPg6eROU0+Iq4Bpgm40EnXirvpTSfuvCuhk H9oSZ2oYPt5MP/m9OkE0n2k4c5ba37jP8O5ea7l3SaABXDBywVeghbbvCEKhE8wwAk 6DD3gZqUyTIndZhauRXcsIkqA/3e/LKU7ikuVG0lY6/ChA2Z76JIgmORwhWSIr7GF2 2/r0ySw8uLCXWYwgnr9Oco6xJjv+jzksgCLD8Tvn78HQHABdFMLv0rugAaceDC6VvQ WV70/pLFZOG6g== Date: Wed, 17 Jun 2026 18:11:15 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: keguang.zhang@gmail.com Cc: Binbin Zhou , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] pwm: loongson: Reload PWM configuration through counter reset Message-ID: References: <20260616-pwm-loongson-fix-v1-0-491dbf260a7f@gmail.com> <20260616-pwm-loongson-fix-v1-2-491dbf260a7f@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7bkyubkedq66emcn" Content-Disposition: inline In-Reply-To: <20260616-pwm-loongson-fix-v1-2-491dbf260a7f@gmail.com> --7bkyubkedq66emcn Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 2/2] pwm: loongson: Reload PWM configuration through counter reset MIME-Version: 1.0 Hello, On Tue, Jun 16, 2026 at 07:13:18PM +0800, Keguang Zhang via B4 Relay wrote: > From: Keguang Zhang >=20 > 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 =3D 17 and then is disabled with say the counter at 4, and later restarted with PERIOD =3D 12, the counter first goes up to 17 before the 12 becomes active, right?=20 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 --7bkyubkedq66emcn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmoyxyAACgkQj4D7WH0S /k6cogf/Z85s176uz5NVwNJkgxrz8iz9YuiVCadsdDzq64+O6T/i5e+3Nt/WKCeD R55lKQYG4sLnoLeuCIvOOkzkB7LxXR2TvuVinzODHYrDGCj7QQbCorEyFrI8nL9w oymNV+/X5m6GqoRlbrF+zYcibus9tdnFXUGvrZ9Yv/ewsI/h4mWWd1Mnu5Cch7i7 Gaatn3RHGiCWlKqg2Vw6YHPi9JEOtV0xy2oSgC9naPRQSZO4SR08meCy1fJ7cpE1 sZ0bIfSbSF68sr2z0/o1Kwspk+i1+7ZFNfYZICfNZ/kvKPEPqaAQnFIMHXUQei2x SR8eCjmkQUeby//8SFL28QWa0fq+XA== =K14W -----END PGP SIGNATURE----- --7bkyubkedq66emcn--