From: Shawn Bohrer Date: Tue, 31 Dec 2013 17:39:40 +0000 (-0600) Subject: mlx4_en: Only cycle port if HW timestamp config changes X-Git-Tag: v3.14-rc1~94^2~314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2156d9a8ac0202f0158d407063cb850afffd3f56;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Acked-By: Hadar Hen Zion Acked-by: Richard Cochran Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c index 30712b3..abaf6bb 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;