From patchwork Tue Jul 19 20:25:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 650444 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 3rvBPB6B0Dz9ssM for ; Wed, 20 Jul 2016 06:25:18 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752153AbcGSUZP (ORCPT ); Tue, 19 Jul 2016 16:25:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbcGSUZN (ORCPT ); Tue, 19 Jul 2016 16:25:13 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3CC9BC05AA41; Tue, 19 Jul 2016 20:25:13 +0000 (UTC) Received: from hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com (hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com [10.16.184.47]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6JKPCeQ022059; Tue, 19 Jul 2016 16:25:12 -0400 From: Jarod Wilson To: linux-kernel@vger.kernel.org Cc: Jarod Wilson , Jeff Kirsher , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [PATCH net] e1000e: fix PTP on e1000_pch_lpt variants Date: Tue, 19 Jul 2016 16:25:02 -0400 Message-Id: <1468959902-25071-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 19 Jul 2016 20:25:13 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I've got reports that the Intel I-218V NIC in Intel NUC5i5RYH systems used as a PTP slave experiences random ~10 hour clock jumps, which are resolved if the same workaround for the 82574 and 82583 is employed. Switching from an if to a select, because the list of NIC types could well grow further and we'd already have to wrap the conditionals. CC: Jeff Kirsher CC: intel-wired-lan@lists.osuosl.org CC: netdev@vger.kernel.org Signed-off-by: Jarod Wilson Reported-by: Rupesh Patel Signed-off-by: Jarod Wilson Reported-by: Rupesh Patel Signed-off-by: Jarod Wilson --- drivers/net/ethernet/intel/e1000e/netdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 2b2e2f8..866fea0 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -4335,7 +4335,10 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc) systim = (cycle_t)systimel; systim |= (cycle_t)systimeh << 32; - if ((hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82583)) { + switch (hw->mac.type) { + case e1000_82574: + case e1000_82583: + case e1000_pch_lpt: u64 time_delta, rem, temp; u32 incvalue; int i; @@ -4360,6 +4363,9 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc) (rem == 0)) break; } + break; + default: + break; } return systim; }