Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1153015imm; Wed, 1 Aug 2018 11:03:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeU9nfKFM5F1hJZjdHlp6c66+yF8ce1f9MDD5WNSnBfZlqbqkcFMuw+UlUauOdszl59rcVV X-Received: by 2002:a17:902:bd82:: with SMTP id q2-v6mr9291554pls.178.1533146625691; Wed, 01 Aug 2018 11:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533146625; cv=none; d=google.com; s=arc-20160816; b=X82PrKX9FOuPjrRP4eWDZAM7yBRI3mt12TRwTlRVL93EUeCP6kSjcXZD4ypGyfqH9B VrY5nJxbYsDLE4j8ZGoIpkeHSJMOEuLdKumGbBeOeDK2668xaqa6BjlAbW8lW83NPVfp JsY61BTL7KhqLu0di7Hm3tl1zsGQjbiBks7rr0P18wsEAL4I11drAAWSdpoHbd01sPEe KC5LelZHI8NycvMkq0yZuWLv/0WilR4Z/naERBx6p4sC3QUcxCxu+oOVwGthyWVB1nb4 q/AZIXbnGHtQCp7nL00EQDAIhw8NbWStAKbj1MOy6sIbW4U2xkalUhWGatG5T+gpbug4 ePQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YcbBdRKspde72TVh3fsxmPMqIyhQ5Eu8Qq1OWzfMSik=; b=WFIbIDdzS74yWmdGpDMc/EKmWm0TvVPk51YEXpyDOUVym/EA7K8lDImBO32lX7Mcl6 lW7VXq2JTVHTi63OEC/WYaD5+vDcR75jvpx03E6oula8YxYCaD/1az40IJ8GqvgYbuDO BR3ONIG6yIll94xCyFOdbY1iMF6/HUFsonB38KMZBAM22k2qq6cW9GFBlVb7VKVpbfEu XeSTtCHFQo+I9HWQtXhhNYcWSbAdTIN34jFKDx66LHaSZ/znC2wWXnJztkwyOJ66X/Ha s7xZGcean1SGuZX/n4rA76f2eupthXsnXVQ3EzqPfKJRu+8vhC0zBaHZLfRNvPM/+gsK iACw== 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 144-v6si14436583pfw.95.2018.08.01.11.03.31; Wed, 01 Aug 2018 11:03:45 -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 S1732725AbeHATtA (ORCPT + 99 others); Wed, 1 Aug 2018 15:49:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50226 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405866AbeHATIi (ORCPT ); Wed, 1 Aug 2018 15:08:38 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A996B1370; Wed, 1 Aug 2018 17:13:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Achim Mildenberger , Benjamin Poirier , Aaron Brown , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.14 044/246] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Date: Wed, 1 Aug 2018 18:49:14 +0200 Message-Id: <20180801165013.826708233@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Poirier [ Upstream commit fff200caf6f9179dd9a7fc67acd659e614c3f72f ] 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 Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/e1000e/netdev.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -3558,15 +3558,12 @@ s32 e1000e_get_base_timinca(struct e1000 } 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 */