From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shawn Bohrer Subject: [PATCH net-next 2/2] mlx4_en: Only cycle port if HW timestamp config changes Date: Tue, 17 Dec 2013 14:22:25 -0600 Message-ID: <1387311745-9291-1-git-send-email-shawn.bohrer@gmail.com> Cc: Or Gerlitz , Amir Vadai , Richard Cochran , netdev@vger.kernel.org, tomk@rgmadvisors.com, Hadar Hen Zion , Shawn Bohrer To: "David S. Miller" Return-path: Received: from mail-oa0-f44.google.com ([209.85.219.44]:37170 "EHLO mail-oa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043Ab3LQUXl (ORCPT ); Tue, 17 Dec 2013 15:23:41 -0500 Received: by mail-oa0-f44.google.com with SMTP id m1so7225078oag.3 for ; Tue, 17 Dec 2013 12:23:40 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: From: Shawn Bohrer 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 --- drivers/net/ethernet/mellanox/mlx4/en_clock.c | 4 ++++ 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 9b0d515..cc6a546 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; -- 1.7.7.6