On Sat, Aug 09, 2025 at 11:45:23AM +0200, Uwe Kleine-König wrote:
Hello Sasha,
On Fri, Aug 08, 2025 at 06:30:33PM -0400, Sasha Levin wrote:
This is a note to let you know that I've just added the patch titled
pwm: rockchip: Round period/duty down on apply, up on get
to the 6.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: pwm-rockchip-round-period-duty-down-on-apply-up-on-g.patch and it can be found in the queue-6.16 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
commit 51144efa3159cd95ab37e786c982822a060d7d1a Author: Nicolas Frattaroli nicolas.frattaroli@collabora.com Date: Mon Jun 16 17:14:17 2025 +0200
pwm: rockchip: Round period/duty down on apply, up on get
[ Upstream commit 0b4d1abe5ca568c5b7f667345ec2b5ad0fb2e54b ] With CONFIG_PWM_DEBUG=y, the rockchip PWM driver produces warnings like this: rockchip-pwm fd8b0010.pwm: .apply is supposed to round down duty_cycle (requested: 23529/50000, applied: 23542/50000) This is because the driver chooses ROUND_CLOSEST for purported idempotency reasons. However, it's possible to keep idempotency while always rounding down in .apply(). Do this by making .get_state() always round up, and making .apply() always round down. This is done with u64 maths, and setting both period and duty to U32_MAX (the biggest the hardware can support) if they would exceed their 32 bits confines. Fixes: 12f9ce4a5198 ("pwm: rockchip: Fix period and duty cycle approximation") Fixes: 1ebb74cf3537 ("pwm: rockchip: Add support for hardware readout") Signed-off-by: Nicolas Frattaroli nicolas.frattaroli@collabora.com Link: https://lore.kernel.org/r/20250616-rockchip-pwm-rounding-fix-v2-1-a9c65acad7... Signed-off-by: Uwe Kleine-König ukleinek@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org
while the new code makes the driver match the PWM rules now, I'd be conservative and not backport that patch because while I consider it a (very minor) fix that's a change in behaviour and maybe people depend on that old behaviour. So let's not break our user's workflows and reserve that for a major release. Please drop this patch from your queue.
Now dropped, but note, any behavior change is ok for ANY kernel version as we guarantee they all work the same :)
So good luck with your users in the 6.17 release...
thanks
greg k-h