Message ID | 20221202201528.26634-3-rrameshbabu@nvidia.com (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ptp: Introduce .getfine callback to ptp_clock_info | expand |
Hi Rahul, Thank you for the patch! Yet something to improve: [auto build test ERROR on net-next/master] url: https://github.com/intel-lab-lkp/linux/commits/Rahul-Rameshbabu/ptp-Introduce-getfine-callback-to-ptp_clock_info/20221203-041829 patch link: https://lore.kernel.org/r/20221202201528.26634-3-rrameshbabu%40nvidia.com patch subject: [PATCH net-next 2/2] net/mlx5: Implement ptp_clock_info .getfine function config: powerpc-allmodconfig compiler: powerpc-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/a7bdcf94180cbdbf637e07639c15da3fc3df8f4f git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Rahul-Rameshbabu/ptp-Introduce-getfine-callback-to-ptp_clock_info/20221203-041829 git checkout a7bdcf94180cbdbf637e07639c15da3fc3df8f4f # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>, old ones prefixed by <<): >> ERROR: modpost: "__divdi3" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] undefined! >> ERROR: modpost: "__udivdi3" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] undefined!
Hi Rahul,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Rahul-Rameshbabu/ptp-Introduce-getfine-callback-to-ptp_clock_info/20221203-041829
patch link: https://lore.kernel.org/r/20221202201528.26634-3-rrameshbabu%40nvidia.com
patch subject: [PATCH net-next 2/2] net/mlx5: Implement ptp_clock_info .getfine function
config: mips-allyesconfig
compiler: mips-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/a7bdcf94180cbdbf637e07639c15da3fc3df8f4f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Rahul-Rameshbabu/ptp-Introduce-getfine-callback-to-ptp_clock_info/20221203-041829
git checkout a7bdcf94180cbdbf637e07639c15da3fc3df8f4f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
arch/mips/kernel/head.o: in function `kernel_entry':
(.ref.text+0xac): relocation truncated to fit: R_MIPS_26 against `start_kernel'
init/main.o: in function `set_reset_devices':
main.c:(.init.text+0x20): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0x30): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
init/main.o: in function `debug_kernel':
main.c:(.init.text+0xa4): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0xb4): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
init/main.o: in function `quiet_kernel':
main.c:(.init.text+0x128): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0x138): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
init/main.o: in function `warn_bootconfig':
main.c:(.init.text+0x1ac): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0x1bc): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
init/main.o: in function `init_setup':
main.c:(.init.text+0x234): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0x254): additional relocation overflows omitted from the output
mips-linux-ld: drivers/net/ethernet/mellanox/mlx5/core/lib/clock.o: in function `mlx5_ptp_getfine':
>> clock.c:(.text.mlx5_ptp_getfine+0xd8): undefined reference to `__divdi3'
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c index 69cfe60c558a..4ecf67f617c0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -326,6 +326,40 @@ static int mlx5_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) return 0; } +static int mlx5_ptp_getfine(struct ptp_clock_info *ptp, long *scaled_ppm) +{ + struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, ptp_info); + u32 in[MLX5_ST_SZ_DW(mtutc_reg)] = {}; + u32 out[MLX5_ST_SZ_DW(mtutc_reg)]; + struct mlx5_core_dev *mdev; + s64 delta; + int err; + + mdev = container_of(clock, struct mlx5_core_dev, clock); + + err = mlx5_core_access_reg(mdev, in, sizeof(in), out, sizeof(out), + MLX5_REG_MTUTC, 0, 0); + if (err) + return err; + + delta = MLX5_GET(mtutc_reg, out, freq_adjustment); + /* Convert parts-per-billion (10^-9) to parts-per-million (10^-6) + * with a 16 bit binary fractional field + * + * scaled_ppm = ppb * 2^16 / 1000 + * + * which is equivalent to + * + * scaled_ppm = ppb * 2^13 / 125 + */ + delta <<= 13; + delta /= 125; + + *scaled_ppm = delta; + + return 0; +} + static int mlx5_ptp_adjfreq_real_time(struct mlx5_core_dev *mdev, s32 freq) { u32 in[MLX5_ST_SZ_DW(mtutc_reg)] = {}; @@ -688,6 +722,7 @@ static const struct ptp_clock_info mlx5_ptp_clock_info = { .n_pins = 0, .pps = 0, .adjfine = mlx5_ptp_adjfine, + .getfine = mlx5_ptp_getfine, .adjtime = mlx5_ptp_adjtime, .gettimex64 = mlx5_ptp_gettimex, .settime64 = mlx5_ptp_settime,