aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Bohrer <sbohrer@rgmadvisors.com>2013-12-31 11:39:40 -0600
committerDavid S. Miller <davem@davemloft.net>2014-01-02 03:30:36 -0500
commit2156d9a8ac0202f0158d407063cb850afffd3f56 (patch)
treeee54f3bc45192eac61f4c194756405e46a942638
parentmlx4_en: Add PTP hardware clock (diff)
downloadlinux-dev-2156d9a8ac0202f0158d407063cb850afffd3f56.tar.xz
linux-dev-2156d9a8ac0202f0158d407063cb850afffd3f56.zip
mlx4_en: Only cycle port if HW timestamp config changes
If the hwtstamp_config matches what is currently set for the device then simply return. Without this change any program that tries to enable hardware timestamps will cause the link to cycle even if hardware timstamps were already enabled. Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com> Acked-By: Hadar Hen Zion <hadarh@mellanox.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_clock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index 30712b36f43c..abaf6bb22416 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -42,6 +42,10 @@ int mlx4_en_timestamp_config(struct net_device *dev, int tx_type, int rx_filter)
int port_up = 0;
int err = 0;
+ if (priv->hwtstamp_config.tx_type == tx_type &&
+ priv->hwtstamp_config.rx_filter == rx_filter)
+ return 0;
+
mutex_lock(&mdev->state_lock);
if (priv->port_up) {
port_up = 1;