From patchwork Wed Aug 1 14:56:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wyborny, Carolyn" X-Patchwork-Id: 174470 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A77F72C00A1 for ; Thu, 2 Aug 2012 00:56:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755330Ab2HAO4l (ORCPT ); Wed, 1 Aug 2012 10:56:41 -0400 Received: from mga14.intel.com ([143.182.124.37]:14909 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755230Ab2HAO4l convert rfc822-to-8bit (ORCPT ); Wed, 1 Aug 2012 10:56:41 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 01 Aug 2012 07:56:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="129250392" Received: from orsmsx603.amr.corp.intel.com ([10.22.226.49]) by AZSMGA002.ch.intel.com with ESMTP; 01 Aug 2012 07:56:40 -0700 Received: from orsmsx106.amr.corp.intel.com (10.22.225.133) by orsmsx603.amr.corp.intel.com (10.22.226.49) with Microsoft SMTP Server (TLS) id 8.2.255.0; Wed, 1 Aug 2012 07:56:39 -0700 Received: from orsmsx102.amr.corp.intel.com ([169.254.1.159]) by ORSMSX106.amr.corp.intel.com ([169.254.5.44]) with mapi id 14.01.0355.002; Wed, 1 Aug 2012 07:56:39 -0700 From: "Wyborny, Carolyn" To: Stefan Assmann , "netdev@vger.kernel.org" CC: "e1000-devel@lists.sourceforge.net" Subject: RE: [PATCH net-next] igb: add delay to allow igb loopback test to succeed on 8086:10c9 Thread-Topic: [PATCH net-next] igb: add delay to allow igb loopback test to succeed on 8086:10c9 Thread-Index: AQHNb9tHoYQYiSIuEU+2i6CVzYCJlJdFC9Ng Date: Wed, 1 Aug 2012 14:56:38 +0000 Message-ID: <9BBC4E0CF881AA4299206E2E1412B62630D880DC@ORSMSX102.amr.corp.intel.com> References: <1343821463-18052-1-git-send-email-sassmann@kpanic.de> In-Reply-To: <1343821463-18052-1-git-send-email-sassmann@kpanic.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org -----Original Message----- From: Stefan Assmann [mailto:sassmann@kpanic.de] Sent: Wednesday, August 01, 2012 4:44 AM To: netdev@vger.kernel.org Cc: e1000-devel@lists.sourceforge.net; Wyborny, Carolyn; sassmann@kpanic.de Subject: [PATCH net-next] igb: add delay to allow igb loopback test to succeed on 8086:10c9 Some 8086:10c9 NICs have a problem completing the ethtool loopback test. The result looks like this: ethtool -t eth1 The test result is FAIL The test extra info: Register test (offline) 0 Eeprom test (offline) 0 Interrupt test (offline) 0 Loopback test (offline) 13 Link test (on/offline) 0 A bisect clearly points to commit a95a07445ee97a2fef65befafbadcc30ca1bd145. However that seems to only trigger the bug. While adding some printk the problem disappeared, so this might be a timing issue. After some trial and error I discovered that adding a small delay just before igb_write_phy_reg() in igb_integrated_phy_loopback() allows the loopback test to succeed. I was unable to figure out the root cause so far but I expect it to be somewhere in the following executing path igb_integrated_phy_loopback ->igb_write_phy_reg_igp ->igb_write_phy_reg_mdic ->igb_acquire_phy_82575 ->igb_acquire_swfw_sync_82575 As this workaround only introduces a minor delay, which is not in the hot path I hope this is acceptable. The problem could only be oberved on 8086:10c9 NICs so far and not all of them show the behaviour. I did not restrict the workaround to this type of NIC as it should do no harm to other igb NICs. With the patch below the loopback test succeeded 500 times in a row using a NIC that would otherwise fail. Signed-off-by: Stefan Assmann --- drivers/net/ethernet/intel/igb/igb_ethtool.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) -- 1.7.4.4 ACK. Jeff will be pulling this into his tree. Thanks, Carolyn Carolyn Wyborny Linux Development LAN Access Division Intel Corporation -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index a19c84c..f62fa25 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -1497,6 +1497,9 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter) break; } + /* add small delay to avoid loopback test failure */ + msleep(50); + /* force 1000, set loopback */ igb_write_phy_reg(hw, PHY_CONTROL, 0x4140);