net/mlx5: Convert scaled ppm values outside the s32 range for PHC frequency adjustments
authorRahul Rameshbabu <rrameshbabu@nvidia.com>
Fri, 25 Aug 2023 03:29:50 +0000 (20:29 -0700)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 15 Nov 2023 19:34:30 +0000 (11:34 -0800)
commit78c1b26754d9df062c3c8e08f5d6427967e3ba4b
tree66ecb794912f5432dc38afc332eed8f6f48a9028
parent4395d9de4e21376dcd5592fdf9627beaa8609055
net/mlx5: Convert scaled ppm values outside the s32 range for PHC frequency adjustments

Represent scaled ppm as ppb to the device when the value in scaled ppm is
not representable as a 32-bit signed integer. mlx5 devices only support a
32-bit field for the frequency adjustment value in units of either scaled
ppm or ppb.

Since mlx5 devices only support a 32-bit field for the frequency adjustment
value independent of unit used, limit the maximum frequency adjustment to
S32_MAX ppb.

Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c