Re: [PATCH net] net: dsa: sja1105: reject zero pin duration for PTP perout
From: Andrew Lunn
Date: Wed Jun 03 2026 - 08:42:11 EST
On Wed, Jun 03, 2026 at 02:02:16PM +0300, Aleksandrova Alyona wrote:
> pin_duration is converted from the user-provided period to SJA1105
> clock ticks and is later passed as the cycle_time argument to
> future_base_time().
>
> Very small period values may become zero after the conversion,
> which can lead to a division by zero in future_base_time().
>
> Reject zero pin_duration values and values that exceed the
> supported range.
Which is better, reject, or round up to 1?
Andrew