.. | .. |
---|
36 | 36 | #if IS_ENABLED(CONFIG_PTP_1588_CLOCK) |
---|
37 | 37 | void mlx5_init_clock(struct mlx5_core_dev *mdev); |
---|
38 | 38 | void mlx5_cleanup_clock(struct mlx5_core_dev *mdev); |
---|
39 | | -void mlx5_pps_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe); |
---|
40 | 39 | |
---|
41 | 40 | static inline int mlx5_clock_get_ptp_index(struct mlx5_core_dev *mdev) |
---|
42 | 41 | { |
---|
.. | .. |
---|
46 | 45 | static inline ktime_t mlx5_timecounter_cyc2time(struct mlx5_clock *clock, |
---|
47 | 46 | u64 timestamp) |
---|
48 | 47 | { |
---|
| 48 | + struct mlx5_timer *timer = &clock->timer; |
---|
| 49 | + unsigned int seq; |
---|
49 | 50 | u64 nsec; |
---|
50 | 51 | |
---|
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)); |
---|
54 | 56 | |
---|
55 | 57 | return ns_to_ktime(nsec); |
---|
56 | 58 | } |
---|
.. | .. |
---|
58 | 60 | #else |
---|
59 | 61 | static inline void mlx5_init_clock(struct mlx5_core_dev *mdev) {} |
---|
60 | 62 | 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 | | - |
---|
63 | 63 | static inline int mlx5_clock_get_ptp_index(struct mlx5_core_dev *mdev) |
---|
64 | 64 | { |
---|
65 | 65 | return -1; |
---|