diff options
author | Eugenia Emantayev <eugenia@mellanox.com> | 2017-07-12 17:44:07 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2017-07-27 16:40:17 +0300 |
commit | f08c39ed0bfb503c7b3e013cd40d036ce6a0941a (patch) | |
tree | 6a8c1aa38b0b42b58b3c44f426be8ee5707adbad | |
parent | d439c84509a510e864fdc6166c760482cd03fc57 (diff) | |
download | op-kernel-dev-f08c39ed0bfb503c7b3e013cd40d036ce6a0941a.zip op-kernel-dev-f08c39ed0bfb503c7b3e013cd40d036ce6a0941a.tar.gz |
net/mlx5e: Schedule overflow check work to mlx5e workqueue
This is done in order to ensure that work will not run after the cleanup.
Fixes: ef9814deafd0 ('net/mlx5e: Add HW timestamping (TS) support')
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_clock.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c b/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c index cde8e8e..84dd63e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c @@ -114,13 +114,14 @@ static void mlx5e_timestamp_overflow(struct work_struct *work) struct delayed_work *dwork = to_delayed_work(work); struct mlx5e_tstamp *tstamp = container_of(dwork, struct mlx5e_tstamp, overflow_work); + struct mlx5e_priv *priv = container_of(tstamp, struct mlx5e_priv, tstamp); unsigned long flags; write_lock_irqsave(&tstamp->lock, flags); timecounter_read(&tstamp->clock); write_unlock_irqrestore(&tstamp->lock, flags); - schedule_delayed_work(&tstamp->overflow_work, - msecs_to_jiffies(tstamp->overflow_period * 1000)); + queue_delayed_work(priv->wq, &tstamp->overflow_work, + msecs_to_jiffies(tstamp->overflow_period * 1000)); } int mlx5e_hwstamp_set(struct mlx5e_priv *priv, struct ifreq *ifr) @@ -577,7 +578,7 @@ void mlx5e_timestamp_init(struct mlx5e_priv *priv) INIT_WORK(&tstamp->pps_info.out_work, mlx5e_pps_out); INIT_DELAYED_WORK(&tstamp->overflow_work, mlx5e_timestamp_overflow); if (tstamp->overflow_period) - schedule_delayed_work(&tstamp->overflow_work, 0); + queue_delayed_work(priv->wq, &tstamp->overflow_work, 0); else mlx5_core_warn(priv->mdev, "invalid overflow period, overflow_work is not scheduled\n"); @@ -613,8 +614,6 @@ void mlx5e_timestamp_cleanup(struct mlx5e_priv *priv) } cancel_work_sync(&tstamp->pps_info.out_work); - - kfree(tstamp->ptp_info.pin_config); - cancel_delayed_work_sync(&tstamp->overflow_work); + kfree(tstamp->ptp_info.pin_config); } |