From patchwork Tue Apr 5 18:30:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel Walker (danielwa)" X-Patchwork-Id: 606677 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 3qfdNg1Z5Gz9t3Z for ; Wed, 6 Apr 2016 04:56:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.b=IxP4xWH/; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 846E88C065; Tue, 5 Apr 2016 18:56:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bi4qA4DoUzwF; Tue, 5 Apr 2016 18:56:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 19A418788E; Tue, 5 Apr 2016 18:55:59 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5409B1C10F5 for ; Tue, 5 Apr 2016 18:30:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4BE1E8B65A for ; Tue, 5 Apr 2016 18:30:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kSso7A1GPASh for ; Tue, 5 Apr 2016 18:30:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 6B5D18B019 for ; Tue, 5 Apr 2016 18:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1821; q=dns/txt; s=iport; t=1459881007; x=1461090607; h=from:to:cc:subject:date:message-id; bh=jZUVzFLSwcgFEKc18KtQPUKn7hr8TAFFGOxNcKSK9/A=; b=IxP4xWH/8zBj0lfAKhjDDIWuhBVuIaQxXHZdfdVCkA3XArvA13Ye1gzl 4O/SLqtcmdMPUyVyExLsiBgGS9Mh4azIgRFn+Wr2T170RVav8iu4ERCXh 4suaHfDCipDdBsTrkJ5K01CBfgoWVxblgvq46pFlTdF5lqY6q6HeDAgVZ E=; X-IronPort-AV: E=Sophos;i="5.24,445,1454976000"; d="scan'208";a="90346472" Received: from rcdn-core-12.cisco.com ([173.37.93.148]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2016 18:30:05 +0000 Received: from zorba.cisco.com ([10.24.33.135]) by rcdn-core-12.cisco.com (8.14.5/8.14.5) with ESMTP id u35IU3OV002155; Tue, 5 Apr 2016 18:30:04 GMT From: Daniel Walker To: dima.ruinskiy@intel.com, Jeff Kirsher , Jesse Brandeburg , Shannon Nelson , Carolyn Wyborny , Don Skidmore , Bruce Allan , John Ronciak , Mitch Williams Date: Tue, 5 Apr 2016 11:30:03 -0700 Message-Id: <1459881004-13992-1-git-send-email-danielwa@cisco.com> X-Mailer: git-send-email 2.5.0 X-Auto-Response-Suppress: DR, OOF, AutoReply X-Mailman-Approved-At: Tue, 05 Apr 2016 18:55:55 +0000 Cc: netdev@vger.kernel.org, xe-kernel@external.cisco.com, linux-kernel@vger.kernel.org, Steve Shih , intel-wired-lan@lists.osuosl.org, Daniel Walker Subject: [Intel-wired-lan] [PATCH -v2] drivers: net: ethernet: intel: e1000e: fix ethtool autoneg off for non-copper X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" From: Steve Shih This patch fixes the issues for disabling auto-negotiation and forcing speed and duplex settings for the non-copper media. For non-copper media, e1000_get_settings should return ETH_TP_MDI_INVALID for eth_tp_mdix_ctrl instead of ETH_TP_MDI_AUTO so subsequent e1000_set_settings call would not fail with -EOPNOTSUPP. e1000_set_spd_dplx should not automatically turn autoneg back on for forced 1000 Mbps full duplex settings for non-copper media. Cc: xe-kernel@external.cisco.com Cc: Daniel Walker Signed-off-by: Steve Shih Tested-by: Aaron Brown --- drivers/net/ethernet/intel/e1000e/ethtool.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index 6cab1f3..b6b8290 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c @@ -201,6 +201,9 @@ static int e1000_get_settings(struct net_device *netdev, else ecmd->eth_tp_mdix_ctrl = hw->phy.mdix; + if (hw->phy.media_type != e1000_media_type_copper) + ecmd->eth_tp_mdix_ctrl = ETH_TP_MDI_INVALID; + return 0; } @@ -236,8 +239,12 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx) mac->forced_speed_duplex = ADVERTISE_100_FULL; break; case SPEED_1000 + DUPLEX_FULL: - mac->autoneg = 1; - adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL; + if (adapter->hw.phy.media_type == e1000_media_type_copper) { + mac->autoneg = 1; + adapter->hw.phy.autoneg_advertised = + ADVERTISE_1000_FULL; + } else + mac->forced_speed_duplex = ADVERTISE_1000_FULL; break; case SPEED_1000 + DUPLEX_HALF: /* not supported */ default: