Re: [PATCH] pwm: atmel: Fix prescaler for periods of 2^32 clock cycles or more
From: Uwe Kleine-König
Date: Wed Oct 14 2026 - 05:46:59 EST
hello Karl,
On Sat, Oct 03, 2026 at 10:30:35AM +0200, Karl Mehltretter wrote:
> [...] Some out-of-range requests of 2^32 clock cycles or more were
> accepted and programmed with truncated values. They now fail with
> -EINVAL.
This is wrong, a too big request is supposed to pick the maximal
possible configuration without an error. But that is a preexisting issue
and converting to the waveform API is more sensible than fixing that.
For the scope of this patch, the implemented behaviour is ok.
> The truncation was not reachable when it was introduced. The period
> was an unsigned int in nanoseconds then, which limits it to about
> 4.29 s. Commit a9d887dc1c60 ("pwm: Convert period and duty cycle to
> u64") made longer periods possible.
>
> Fixes: 2101c878f767 ("pwm: atmel: Replace loop in prescale calculation by ad-hoc calculation")
> Fixes: a9d887dc1c60 ("pwm: Convert period and duty cycle to u64")
Why are here two fixes lines? Given that 2101c878f767 is an ancestor of
a9d887dc1c60, this cannot be right.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature