]> git.baikalelectronics.ru Git - kernel.git/commit
igb: convert .adjfreq to .adjfine
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 21 Jul 2022 21:30:01 +0000 (14:30 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 28 Jul 2022 18:03:01 +0000 (11:03 -0700)
commit96f514a70607a4b4036e9c95587704779f6b47de
tree69d9b9dd32d9f6df785018b38d0bedf08913781b
parentd3e1441240fc635e7be13d9694563390970b3771
igb: convert .adjfreq to .adjfine

The 82576 PTP implementation still uses .adjfreq instead of using the newer
.adjfine.

This implementation uses a pre-simplified calculation since the base
increment value for the 82576 is just 16 * 2^19. Converting this into
scaled_ppm is tricky, and makes the intent a bit less clear.

Simply convert to the normal flow of multiplying the base increment value
by the scaled_ppm and then dividing by 1000000ULL << 16. This can be
implemented using mul_u64_u64_div_u64 which can avoid the possible overflow
that might occur for large adjustments.

Use of .adjfine can improve the precision of small adjustments and gets us
one driver closer to removing the old implementation from the kernel
entirely.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igb/igb_ptp.c