Received: by 10.192.165.148 with SMTP id m20csp806092imm; Thu, 10 May 2018 00:30:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZomLvS9KGKEO9zXv+2v4eGt4a3mQbYwNmwdF5oyP1W5FKirYP7v+VEHHIVqd9Dh44xIOYro X-Received: by 2002:a62:c2:: with SMTP id 185-v6mr310915pfa.238.1525937439445; Thu, 10 May 2018 00:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525937439; cv=none; d=google.com; s=arc-20160816; b=HzmO8PDlpOEFUz/CNQ3HaCwo3ChirV9tKcjDAmQHIu5b0G7+aC4JC9Fh+YOyTBik5y 9ikfoST0DOkh/AKTUqDxWzfs/DFCsNftsbZzXy3cUSCXbanm45q0ti1kfw1uLku+UxAk Hs+wESJlMLNgJDSODoXlJ1GA6xyOgJBs5XZGR00a+iYlquHDZCeXuJpU1cQsqnhyJBNg 61jFpbXSiL8uDb1fTLP6chWmDwk4UbBx6xdcFkPk+2vBwr+jWxsS2ZJMs9MZrlgeZmsz 1Y8VGIwY9OBM6aZKfTZJ4GibXGX/zt2yfZrUbfbVZAdc8SmK+3DaT8hMw/CdlC/kmp8y v9Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Py2CdvYSkyFjtgW5i9OB1l+AVWWHBq5nK/ZsREf9Gbc=; b=Ni0F0G88bMNlWU0SMhVVZnt0uUUaTsXVFZi2la0YcZ3wIvrXFZRvQOrx+T+sEpBTQb CRZZoCf6rouMYYGQXlyjRHODklbfTI4vvgRSF5FrOu6X3srLvCFD3EyQ/o1aEKD4A8Cd nqtEj0PONsDS0BmPs7yV7IUaM7YnS/xIODbj/uAm4C+8B75exGgSpnvbHgEHrpgnb25Z mAiwIsOcatKM6qX7/mQgVkWG2bCHXpfjSApsCAtgJLilMFygoITRQqr/lfpWwybKrwXz CuToDY17ruzodgZMFdmJtZYFxTl+zpuzyPr7CqXv+aoAdDRZoRFmeBu2Z/vMtHyI+kKH BVOA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35-v6si210266plh.36.2018.05.10.00.30.25; Thu, 10 May 2018 00:30:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934449AbeEJH3Q (ORCPT + 99 others); Thu, 10 May 2018 03:29:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:49240 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934314AbeEJH3P (ORCPT ); Thu, 10 May 2018 03:29:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 28DACACB6; Thu, 10 May 2018 07:29:14 +0000 (UTC) From: Benjamin Poirier To: Jeff Kirsher Cc: "Keller, Jacob E" , Achim Mildenberger , olouvignes@gmail.com, jayanth@goubiq.com, ehabkost@redhat.com, postmodern.mod3@gmail.com, Bart.VanAssche@wdc.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Date: Thu, 10 May 2018 16:28:35 +0900 Message-Id: <20180510072835.5549-1-bpoirier@suse.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <02874ECE860811409154E81DA85FBB5882D918F3@ORSMSX115.amr.corp.intel.com> References: <02874ECE860811409154E81DA85FBB5882D918F3@ORSMSX115.amr.corp.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There have been multiple reports of crashes that look like kernel: RIP: 0010:[] timecounter_read+0xf/0x50 [...] kernel: Call Trace: kernel: [] e1000e_phc_gettime+0x2f/0x60 [e1000e] kernel: [] e1000e_systim_overflow_work+0x1d/0x80 [e1000e] kernel: [] process_one_work+0x155/0x440 kernel: [] worker_thread+0x116/0x4b0 kernel: [] kthread+0xd2/0xf0 kernel: [] ret_from_fork+0x3f/0x70 These can be traced back to the fact that e1000e_systim_reset() skips the timecounter_init() call if e1000e_get_base_timinca() returns -EINVAL, which leads to a null deref in timecounter_read(). Commit 83129b37ef35 ("e1000e: fix systim issues", v4.2-rc1) reworked e1000e_get_base_timinca() in such a way that it can return -EINVAL for e1000_pch_spt if the SYSCFI bit is not set in TSYNCRXCTL. Some experimentation has shown that on I219 (e1000_pch_spt, "MAC: 12") adapters, the E1000_TSYNCRXCTL_SYSCFI flag is unstable; TSYNCRXCTL reads sometimes don't have the SYSCFI bit set. Retrying the read shortly after finds the bit to be set. This was observed at boot (probe) but also link up and link down. Moreover, the phc (PTP Hardware Clock) seems to operate normally even after reads where SYSCFI=0. Therefore, remove this register read and unconditionally set the clock parameters. Reported-by: Achim Mildenberger Message-Id: <20180425065243.g5mqewg5irkwgwgv@f2> Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1075876 Fixes: 83129b37ef35 ("e1000e: fix systim issues") Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/intel/e1000e/netdev.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index ec4a9759a6f2..3afb1f3b6f91 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -3546,15 +3546,12 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca) } break; case e1000_pch_spt: - if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) { - /* Stable 24MHz frequency */ - incperiod = INCPERIOD_24MHZ; - incvalue = INCVALUE_24MHZ; - shift = INCVALUE_SHIFT_24MHZ; - adapter->cc.shift = shift; - break; - } - return -EINVAL; + /* Stable 24MHz frequency */ + incperiod = INCPERIOD_24MHZ; + incvalue = INCVALUE_24MHZ; + shift = INCVALUE_SHIFT_24MHZ; + adapter->cc.shift = shift; + break; case e1000_pch_cnp: if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) { /* Stable 24MHz frequency */ -- 2.16.3