Re: [PATCH net-next 3/3] ptp: idt82p33: optimize _idt82p33_adjfine
From: Vladimir Oltean
Date: Wed Nov 04 2020 - 19:36:01 EST
On Wed, Nov 04, 2020 at 08:46:57AM -0800, Richard Cochran wrote:
> On Wed, Nov 04, 2020 at 11:01:49AM -0500, min.li.xe@xxxxxxxxxxx wrote:
> > From: Min Li <min.li.xe@xxxxxxxxxxx>
> >
> > Use div_s64 so that the neg_adj is not needed.
>
> Back in the day, I coded the neg_adj because there was some issue with
> signed 64 bit division that I can't recall now. Either div_s64 didn't
> exist or it was buggy on some archs... there was _some_ reason.
>
> So unless you are sure that this works on all platforms, I would leave
> it alone.
On the other hand and with all due respect, saying that it may have been
'buggy on some archs back in the day' and then not bringing any evidence
is a bit of a strange claim to make.
I am actively using div_s64 in drivers/net/dsa/sja1105/sja1105_ptp.c
successfully on arm and arm64.
We may keep the ptp_clock_info::adjfine procedure as is, and to be
copied by everyone, because we can't make sure that it works "on all
platforms" (aka "cargo cult"). Or we could waste a few hours from
somebody's time, until he figures out how to bisect the IDT 82P33 PTP
driver (a driver with 3 patches, and 3 more with Min's series) to find a
1-line change, and then we could find out what the problem you were
seeing was. I say waste that guy's time :)