Received: by 10.213.65.68 with SMTP id h4csp2123006imn; Sun, 8 Apr 2018 20:16:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/p0cDk+8UasM30eiCf25zYjojaWIN3U5L0Agw8zQywghVhhbw2t088wjlWxOdEpKuF8ATG X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr19267947pla.324.1523243776362; Sun, 08 Apr 2018 20:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243776; cv=none; d=google.com; s=arc-20160816; b=T3GEBEMjMua4SBoKkAolHL512P2T/LiHKUc0hLQxqaRuRTpXMJ3EN4W54ydLFsRFmZ awVymZHocnAP0cAJEeAWlK3KME0ye0fWfYsIHqC9ewKnQPiERiDrKjcnfHi0zUNtCd4R rz9jVnPmb2TsKDBhf6dZCHEwhgJOJHFw0RObfVyo4YI1IBhgshZ7Qxhsmj2iVkVkaqO/ TsuyAuZWL+j1l5P8l35rEuSBupkqfYGCLtIOwryrDu+/aDMmSXFEqQqUrstq6mlgsTFd XpukJTq3gqI1NEIoISK1D97HYDCLLKkvlfmLB+Dy4Me9+BiQu2HwpJ7f8wfdHRhg+woL 8sZQ== 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=EMjjkaayd9RBH7piubkloiCW46R72ty/V3MzAvzd8y+oJAON8TFjXYCiYIgmktUHMS K9XOd3v/KVB9N8VvvA5F3cq7e1W/OPB4Orne3IergEZ2qqtbBJLsdylJFfpAoLFKGVjd PHsPP8aiJx3Ai0bsgZ8PUb2lf32w5iAu+ItxTWFX2jTFSt37NqbTRSeLajS+pgPx6dQV 2b0uD3gvj0a5SqitVheASM/MDkdCrpxrj5HY0RZLomD08xDtO1dTkqldh46yJfUZ+JrY vrgxM/mzm0t7XJyBzZ0BYBhhspRKQ8OKFkNC76fi5xFystk0mnwei8qqiSwmkPWxwA7Y 5uuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=MBev5VED; 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 e98-v6si7630122plb.273.2018.04.08.20.15.39; Sun, 08 Apr 2018 20:16:16 -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=MBev5VED; 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 S1755262AbeDIDND (ORCPT + 99 others); Sun, 8 Apr 2018 23:13:03 -0400 Received: from mail-by2nam03on0115.outbound.protection.outlook.com ([104.47.42.115]:29467 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754045AbeDIAXw (ORCPT ); Sun, 8 Apr 2018 20:23:52 -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=MBev5VEDigOmMAUSdsAAUoNtuYrTKarbYWE/Xn3+pUe38ihnvf1s/bsYQbYUqmDf/o2EAq5ithNFBARaDNH0swh1ugUB7ofvUZCuWpzuTeA7Uh8B2ZfEEYf/zgbK0fQDYXM701bJYxB8WmZAMzHy7MALfE4HrDgrMJoAzt/E1tI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1080.namprd21.prod.outlook.com (52.132.130.14) 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:23:48 +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:23:48 +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.14 073/161] igb: Clear TXSTMP when ptp_tx_work() is timeout Thread-Topic: [PATCH AUTOSEL for 4.14 073/161] igb: Clear TXSTMP when ptp_tx_work() is timeout Thread-Index: AQHTz5iaKnH7xoeNa0KajAQSCzUPkw== Date: Mon, 9 Apr 2018 00:20:45 +0000 Message-ID: <20180409001936.162706-73-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB1080;7:czYtzunoLFeWNomTsyru7U2q5LgeQO6TD7R0hpE8SkwbvdFK4EJR9KivSfLrD9CjQ/tKKmS1BwSbQqM7w1ICShggdkGjKTDctvY4+GOdl/oZelj3QVOqNgQJiSIbLoGNXOezEqCykBcU+IXn9u9y2hfC6FkZzcS/yeOnViB+GVm1zEaI3Xc9/2iGzYPb5fPe99DEykR6nAm8xJt2dNtuCh/7SpwF6FC+144XaibDh2SbGlwpkCVYY1Ek5QdjNRUE;20:ZuWosHw+L87WkjyAgjp/aGUL9FzozF66dykhxxeSCUYtjFZlI7bSTHZZDu3ahKX/ym3G13xRaiXiiTSFx9cqz4/EFrZaaS6D8chsgJWDUC6YJnBTkN1NaDLfonWF3uhtE+v8yeNlI2JtM74NqDdSLqh5M/st6c2ee3/Xpo3n+Zc= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 4e56b032-f66b-4413-923b-08d59db02a0b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1080; x-ms-traffictypediagnostic: DM5PR2101MB1080: 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)(10201501046)(93006095)(93001095)(3002001)(3231221)(944501327)(52105095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1080;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1080; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(396003)(39380400002)(366004)(39860400002)(199004)(189003)(2501003)(5250100002)(8936002)(10090500001)(5660300001)(3660700001)(446003)(107886003)(14454004)(36756003)(6436002)(476003)(3280700002)(2616005)(11346002)(4326008)(6666003)(53936002)(6512007)(22452003)(305945005)(10290500003)(316002)(102836004)(2906002)(6116002)(66066001)(6506007)(3846002)(7736002)(486006)(54906003)(110136005)(186003)(72206003)(26005)(1076002)(105586002)(2900100001)(6486002)(97736004)(478600001)(81156014)(81166006)(86612001)(8676002)(106356001)(99286004)(86362001)(575784001)(76176011)(59450400001)(68736007)(25786009)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1080;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: eJGkm1XKprK4TYYgAt8IwhoWaJPatBzaUwt/hwxXEL7nE5lYImX51lRoZoMNsW0bCvZ7sXFLPhYI0/7ks/ZfhDpoSsttQOjn4tU3cjXBUW5qWjIp7oKvC8MABM0dtLIAjX3a+p6RIVxGoEahLg24wIeXSATA9dHxfN4Dhue8VJBesTDYlfe3h24x36ptMINGhPKCd8T3D5phi/uMMZZoP45eKBpOoUkD/vtPk0+w3bZI+RKkRKVwqQhBqiJ9Ecj1w5/kgvcUJL6vMUY/C5ss9A2NnKtOzMZKvSlkdQ3MnpavaqnVY1D4mzAG6dAgAaRidcOYK141IvWMNJb0BIAH/wygD5oGfcbQUp8gNOYInrP8Ffp3uhgVfrab1aL1D2W5PCY4vtlYrjNCWtmw+xS0g6YBCIFcqIloSM58x7P9mGU= 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: 4e56b032-f66b-4413-923b-08d59db02a0b X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:20:45.6909 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1080 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