hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h
....@@ -36,7 +36,6 @@
3636 #if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
3737 void mlx5_init_clock(struct mlx5_core_dev *mdev);
3838 void mlx5_cleanup_clock(struct mlx5_core_dev *mdev);
39
-void mlx5_pps_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe);
4039
4140 static inline int mlx5_clock_get_ptp_index(struct mlx5_core_dev *mdev)
4241 {
....@@ -46,11 +45,14 @@
4645 static inline ktime_t mlx5_timecounter_cyc2time(struct mlx5_clock *clock,
4746 u64 timestamp)
4847 {
48
+ struct mlx5_timer *timer = &clock->timer;
49
+ unsigned int seq;
4950 u64 nsec;
5051
51
- read_lock(&clock->lock);
52
- nsec = timecounter_cyc2time(&clock->tc, timestamp);
53
- read_unlock(&clock->lock);
52
+ do {
53
+ seq = read_seqbegin(&clock->lock);
54
+ nsec = timecounter_cyc2time(&timer->tc, timestamp);
55
+ } while (read_seqretry(&clock->lock, seq));
5456
5557 return ns_to_ktime(nsec);
5658 }
....@@ -58,8 +60,6 @@
5860 #else
5961 static inline void mlx5_init_clock(struct mlx5_core_dev *mdev) {}
6062 static inline void mlx5_cleanup_clock(struct mlx5_core_dev *mdev) {}
61
-static inline void mlx5_pps_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe) {}
62
-
6363 static inline int mlx5_clock_get_ptp_index(struct mlx5_core_dev *mdev)
6464 {
6565 return -1;