Received: by 10.213.65.68 with SMTP id h4csp2150196imn; Sun, 8 Apr 2018 21:01:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx48/8bMd99G++lkco/GeSh9otSlzjkJwqemRVpb5EKob3HH4MIXa1WP9VQJ/pXFxM+Aond6Y X-Received: by 2002:a17:902:74c3:: with SMTP id f3-v6mr5403209plt.7.1523246469319; Sun, 08 Apr 2018 21:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523246469; cv=none; d=google.com; s=arc-20160816; b=lWmsayyGUHamSl/DxVv5cxk9KvBMBjpkVCTUYTIV+iWehu2bwqNWFNPSEQoas5Ry0w xJVOO6qdkp0v9bFamPHmprBabnJB61K+RsVlHSzcpFqd+/OqNHpdLHCBra4LB7yeeU17 z4ulsrF4mHuTS5qozfYSmMYw1uraj26Frpfs6Jz7DhdEneys/eXlAk2AOs0Z4ws0YlMF tw0xkWKqJ58/Do9F9JPuWmBHzwdljYbtyX4SCKl619NweRW84MYj8oFWUv+4RWm6ZF0g tfjDe/DYfD+nmANz0TY3DHc+Hp4RzXN38Z+LDpxG4/ur+Yky2DN6TqGidEaMJzSJW+VF gw9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=19ekOJhaoJVctcLj3EB29G0NtaYS67uAEk/j3Q8faEs=; b=fr8EPlRib6Yn+AQZqQsCZtwDYUKDszykF466Z6OXkwhVnjtqNi7oSDcNGN5PuV7n0a 4j2G2I7gFMOJDSu+uHHDgMa/HCW4X8gYWHObEyJKdOSDfYCrWuzZI2idodPn14r5/0TH db4CyNRpHNSaKX3TeBnS9lFSo1Ba/xCcUxjXtAdODVrJ5yiNMXWHdEy/RoeFtAAq1axk HefLvL37ICDDPy1zc3k6gZIAoYrp9UhQZ1OtINXa4ByUyTBvH8IJx27BJihYyjzah8S6 LmSIgi7fp1MPzj2aQcUHymvOrJYUTN3rei+mHUvdxvZ4bOobOruyet3Q3kKtyOaNQ0eX jlOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=O6Mco+tT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a31-v6si13661901pla.322.2018.04.08.21.00.31; Sun, 08 Apr 2018 21:01:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=O6Mco+tT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754282AbeDIDzx (ORCPT + 99 others); Sun, 8 Apr 2018 23:55:53 -0400 Received: from mail-by2nam01on0126.outbound.protection.outlook.com ([104.47.34.126]:59343 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753788AbeDIASt (ORCPT ); Sun, 8 Apr 2018 20:18:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=19ekOJhaoJVctcLj3EB29G0NtaYS67uAEk/j3Q8faEs=; b=O6Mco+tTLX3QFqYtaFrAmC4n2pf1XOwJJawJUkO2+3wH+mRQTCCyqpozpWh8IDFI2YoqdnMRSGt20Ao+xrDNquXWfn4ysgb4D4A8qPiZP6NGzjystMuRoQ5mrkTrUn71hcgCAsCyXHIb00zccFf5KImLcpEPpvECwzg+RJrsdfs= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1128.namprd21.prod.outlook.com (52.132.133.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:18:42 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:18:42 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Daniel Hua , Jeff Kirsher , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 087/189] igb: Clear TXSTMP when ptp_tx_work() is timeout Thread-Topic: [PATCH AUTOSEL for 4.15 087/189] igb: Clear TXSTMP when ptp_tx_work() is timeout Thread-Index: AQHTz5g0RYIIzWb8nUaXVNSjUQtqwg== Date: Mon, 9 Apr 2018 00:17:54 +0000 Message-ID: <20180409001637.162453-87-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1128;7:i3yToUFnBk5Nia31jEB8zSCsNiAIlzALSIbTfGXLwXAs4aFqE7aizqVi0x4dI9VsWClKWex1aKuY9fWK8aFhqFoZlPLHquli4zzunRdYtwnOmL+/mRlUnskud5UTOY9CdWtFoGXj98NrnjFER0doxCcmg7HE4MjsJrgQl3c4BLWQK3Zw2wZyK63XkfVN3+GgFIUOT4Rro4Ngs/kwq3f/rPxIwAA7o1WhwcIqaAbV2o7BSY1XWhZjVzSqcqO17wHU;20:cE2+SbEXrprXzK/6tocVQeeEqT2iNgPq01eVZeBlG7EoKrsZJrtwA/x8hLnJSiHI+Cy34ZmS1heVYByt427912f1WnnJiNdco0ujUIGLU9H0y7nsYxIi2Pnmdoa8iK0551Ccq7XutPn4g+5L5HUh5lcInjzizn3QrsweH3jCoeg= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: d97435fd-7562-408d-07e3-08d59daf733a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1128; x-ms-traffictypediagnostic: DM5PR2101MB1128: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(21532816269658)(228905959029699)(145744241990776); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1128;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1128; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(396003)(376002)(366004)(39380400002)(199004)(189003)(66066001)(86362001)(59450400001)(3660700001)(3280700002)(2900100001)(25786009)(36756003)(6506007)(76176011)(2906002)(6486002)(86612001)(99286004)(102836004)(1076002)(7736002)(575784001)(97736004)(2616005)(446003)(486006)(11346002)(476003)(26005)(305945005)(6666003)(6512007)(4326008)(107886003)(478600001)(6436002)(5660300001)(10290500003)(5250100002)(22452003)(316002)(105586002)(186003)(8676002)(110136005)(54906003)(72206003)(53936002)(2501003)(68736007)(14454004)(6116002)(8936002)(3846002)(81156014)(10090500001)(106356001)(81166006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1128;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: vFfI/bAazCupAYJ0scHPHGyl0R+KmkXlLNhdRHczI+QyWX29icZvJ4uS4mv5Z4fbJFXoOyLBWIItUflvqvxrD2f2VfddgdG1R9mKvabRArcXYArswxuU0BqfqVQXLuCg0BlQdni31LxkWlm6q1FkPfR1of92WVGen3xDyA4f2bklVTtCB73EeXfJ+kswUkQPijpCCYaN9+ANIQ0a1qso9mCQGZMuumPILMCSMjqnllNbeTIpuqr1aIAZAjOZ4oVB/ziPZ2rV/kr7JYvMzlRMZsI5542BhDBhLaB8IOpvk1VTz2h9B1noILvWmArtlb5xZU2mrbkdU06rq7shSTApS6nmbyuch/LO87LI8vpD1qmhgkIoz2cjPuPARzwM1O6TB8XwRP+H0/nNVOt7AmmKVPgCV058W5e8Wy9YxPLfb2k= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: d97435fd-7562-408d-07e3-08d59daf733a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:54.2574 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1128 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Hua [ Upstream commit 3a53285228165225a7f76c7d5ff1ddc0213ce0e4 ] Problem description: After ethernet cable connect and disconnect for several iterations on a device with i210, tx timestamp will stop being put into the socket. Steps to reproduce: 1. Setup a device with i210 and wire it to a 802.1AS capable switch ( Extreme Networks Summit x440 is used in our case) 2. Have the gptp daemon running on the device and make sure it is synced with the switch 3. Have the switch disable and enable the port, wait for the device gets resynced with the switch 4. Iterates step 3 until the device is not albe to get resynced 5. Review the log in dmesg and you will see warning message "igb : clearing Tx timestamp hang" Root cause: If ptp_tx_work() gets scheduled just before the port gets disabled, a LINK DOWN event will be processed before ptp_tx_work(), which may cause timeout in ptp_tx_work(). In the timeout logic, the TSYNCTXCTL's TXTT bit (Transmit timestamp valid bit) is not cleared, causing no new timestamp loaded to TXSTMP register. Consequently therefore, no new interrupt is triggerred by TSICR.TXTS bit and no more Tx timestamp send to the socket. Signed-off-by: Daniel Hua Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igb/igb_ptp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/etherne= t/intel/igb/igb_ptp.c index 841c2a083349..0746b19ec6d3 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -643,6 +643,10 @@ static void igb_ptp_tx_work(struct work_struct *work) adapter->ptp_tx_skb =3D NULL; clear_bit_unlock(__IGB_PTP_TX_IN_PROGRESS, &adapter->state); adapter->tx_hwtstamp_timeouts++; + /* Clear the tx valid bit in TSYNCTXCTL register to enable + * interrupt + */ + rd32(E1000_TXSTMPH); dev_warn(&adapter->pdev->dev, "clearing Tx timestamp hang\n"); return; } @@ -717,6 +721,7 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter) */ void igb_ptp_tx_hang(struct igb_adapter *adapter) { + struct e1000_hw *hw =3D &adapter->hw; bool timeout =3D time_is_before_jiffies(adapter->ptp_tx_start + IGB_PTP_TX_TIMEOUT); =20 @@ -736,6 +741,10 @@ void igb_ptp_tx_hang(struct igb_adapter *adapter) adapter->ptp_tx_skb =3D NULL; clear_bit_unlock(__IGB_PTP_TX_IN_PROGRESS, &adapter->state); adapter->tx_hwtstamp_timeouts++; + /* Clear the tx valid bit in TSYNCTXCTL register to enable + * interrupt + */ + rd32(E1000_TXSTMPH); dev_warn(&adapter->pdev->dev, "clearing Tx timestamp hang\n"); } } --=20 2.15.1