Skip to content

Commit e4a8c79

Browse files
committed
net/mlx5: Change parameters for PTP internal functions
jira LE-3615 Rebuild_History Non-Buildable kernel-5.14.0-570.28.1.el9_6 commit-author Jianbo Liu <[email protected]> commit 9f722fb In later patch, the mlx5_clock will be allocated dynamically, its address can be obtained from mlx5_core_dev struct, but mdev can't be obtained from mlx5_clock because it can be shared by multiple interfaces. So change the parameter for such internal functions, only mdev is passed down from the callers. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Carolina Jubran <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> (cherry picked from commit 9f722fb) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 9aadae3 commit e4a8c79

File tree

1 file changed

+8
-11
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/lib

1 file changed

+8
-11
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -878,10 +878,8 @@ static int mlx5_query_mtpps_pin_mode(struct mlx5_core_dev *mdev, u8 pin,
878878
mtpps_size, MLX5_REG_MTPPS, 0, 0);
879879
}
880880

881-
static int mlx5_get_pps_pin_mode(struct mlx5_clock *clock, u8 pin)
881+
static int mlx5_get_pps_pin_mode(struct mlx5_core_dev *mdev, u8 pin)
882882
{
883-
struct mlx5_core_dev *mdev = container_of(clock, struct mlx5_core_dev, clock);
884-
885883
u32 out[MLX5_ST_SZ_DW(mtpps_reg)] = {};
886884
u8 mode;
887885
int err;
@@ -900,8 +898,9 @@ static int mlx5_get_pps_pin_mode(struct mlx5_clock *clock, u8 pin)
900898
return PTP_PF_NONE;
901899
}
902900

903-
static void mlx5_init_pin_config(struct mlx5_clock *clock)
901+
static void mlx5_init_pin_config(struct mlx5_core_dev *mdev)
904902
{
903+
struct mlx5_clock *clock = &mdev->clock;
905904
int i;
906905

907906
if (!clock->ptp_info.n_pins)
@@ -922,7 +921,7 @@ static void mlx5_init_pin_config(struct mlx5_clock *clock)
922921
sizeof(clock->ptp_info.pin_config[i].name),
923922
"mlx5_pps%d", i);
924923
clock->ptp_info.pin_config[i].index = i;
925-
clock->ptp_info.pin_config[i].func = mlx5_get_pps_pin_mode(clock, i);
924+
clock->ptp_info.pin_config[i].func = mlx5_get_pps_pin_mode(mdev, i);
926925
clock->ptp_info.pin_config[i].chan = 0;
927926
}
928927
}
@@ -1041,10 +1040,10 @@ static void mlx5_timecounter_init(struct mlx5_core_dev *mdev)
10411040
ktime_to_ns(ktime_get_real()));
10421041
}
10431042

1044-
static void mlx5_init_overflow_period(struct mlx5_clock *clock)
1043+
static void mlx5_init_overflow_period(struct mlx5_core_dev *mdev)
10451044
{
1046-
struct mlx5_core_dev *mdev = container_of(clock, struct mlx5_core_dev, clock);
10471045
struct mlx5_ib_clock_info *clock_info = mdev->clock_info;
1046+
struct mlx5_clock *clock = &mdev->clock;
10481047
struct mlx5_timer *timer = &clock->timer;
10491048
u64 overflow_cycles;
10501049
u64 frac = 0;
@@ -1135,7 +1134,7 @@ static void mlx5_init_timer_clock(struct mlx5_core_dev *mdev)
11351134

11361135
mlx5_timecounter_init(mdev);
11371136
mlx5_init_clock_info(mdev);
1138-
mlx5_init_overflow_period(clock);
1137+
mlx5_init_overflow_period(mdev);
11391138

11401139
if (mlx5_real_time_mode(mdev)) {
11411140
struct timespec64 ts;
@@ -1147,13 +1146,11 @@ static void mlx5_init_timer_clock(struct mlx5_core_dev *mdev)
11471146

11481147
static void mlx5_init_pps(struct mlx5_core_dev *mdev)
11491148
{
1150-
struct mlx5_clock *clock = &mdev->clock;
1151-
11521149
if (!MLX5_PPS_CAP(mdev))
11531150
return;
11541151

11551152
mlx5_get_pps_caps(mdev);
1156-
mlx5_init_pin_config(clock);
1153+
mlx5_init_pin_config(mdev);
11571154
}
11581155

11591156
void mlx5_init_clock(struct mlx5_core_dev *mdev)

0 commit comments

Comments
 (0)