Subject: Re: [PATCH net] stmmac: fix potential division by 0

From: Andrew Lunn <[email-masked]>
Date: Sat, 10 Dec 2022 11:50:26 +0100

On Thu, Dec 08, 2022 at 10:27:56AM +0100, Piergiorgio Beruto wrote:
> > > 
> > > Here's the Altera manual:
> > > 
> > >  https://www.intel.com/content/www/us/en/docs/programmable/683126/21-2/functional-description-of-the-emac.html
> > > 
> > > Table 183 shows the minimum PTP frequencies and also states "Therefore,
> > > a higher PTP clock frequency gives better system performance.".
> > > 
> > > So, I'd say using a clock of 2.5MHz seems possible, but will result in
> > > suboptimal precision.
> > 
> > Thanks for the info. So i seems like the correct fix is to camp to
> > 0xff, rather than mask with 0xff.

> Andrew, given your comment, do you wish me to re-post the patch with
> this fix? Or wait for more feedback first?

Please post a patch. Often the only way to get feedback is to break systems :-(

In this case, clamping actually seems like it could fix systems, not
break them.

      Andrew