Received: by 10.192.165.148 with SMTP id m20csp1504083imm; Thu, 10 May 2018 11:44:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3EnTXDPlk6QUDecku1IvZ2SzgpKL1bjIlu51X0IE58Y2YZXYzekCOLo8jHteeQvuL9QSB X-Received: by 2002:a63:9812:: with SMTP id q18-v6mr1947643pgd.170.1525977876328; Thu, 10 May 2018 11:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525977876; cv=none; d=google.com; s=arc-20160816; b=VDlXz9xLXU5noKHnKP2V9ihOYC3opGL531OLBgxXXlLdRQ2P9x6h0y7jwoG/Pe/mWt qvtE2HAXH87oJEkpIicgpj9M4VgRaQ1TZk0/vaq0tPXtiinffJSrqZVyHgE2qke8Tawq ezhvh1GOQGKPRUcuwuOHvgekj52Ut6xax3Iy1b8RuWiWgB9HoGDxoJBLMW5pV7oyM5Cb 5D/SWdXO4mYzmn003du+YDdc8haYbjh4d8ZHSpV8hGTqgODxzLUwYJBleODyu0EU27S7 E2jiABj4nCf19e7n9fbr9gTeR4M1u3hOiRTFMPsPUjNbXZVxc0dOPLwV2ZFZj4Q/uguk ZO8Q== 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 :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=anAtSJfpHkcKHrOVQi/T5lsVrp9RDnRLA2HC0GcDDOI=; b=c8Jp1Ee0KlbB+crU5htG72SuthC3aZ7oo5xnkzJha1J8rsRADY+NMKx7munpcPQRFy oHjGR4fze5OL4jO9U+7TLPstLLcgzx62phvRQ39MLSCgN063mDmawflhmIYAs2W50gk2 gBOOcN6hOwactQRH1g5xaC1Kdf7fOFC7QpvWywWaNZIVRJrpN+97g1kReNJb7xn0283K WXVRD8s1AvQV2IX60S+hL2RQB2x9swjcHvnlqh3EMVLxfjW+4l5y8gBkzhEv4mHVN/GT XNtd7iM/JLd1b+kpwyvp2S1IfWyjHjEs+BQhH0sh8Bi1/mN83WHNuMOsvlqRUmnv91jZ Izvw== 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 f13-v6si1178287pgr.62.2018.05.10.11.44.21; Thu, 10 May 2018 11:44:36 -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 S1751690AbeEJSm7 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 10 May 2018 14:42:59 -0400 Received: from mga14.intel.com ([192.55.52.115]:42478 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbeEJSm5 (ORCPT ); Thu, 10 May 2018 14:42:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 May 2018 11:42:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,386,1520924400"; d="scan'208";a="38350579" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga007.fm.intel.com with ESMTP; 10 May 2018 11:42:56 -0700 Received: from orsmsx115.amr.corp.intel.com ([169.254.4.200]) by ORSMSX106.amr.corp.intel.com ([169.254.1.74]) with mapi id 14.03.0319.002; Thu, 10 May 2018 11:42:56 -0700 From: "Keller, Jacob E" To: Benjamin Poirier , "Kirsher, Jeffrey T" CC: 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: RE: [PATCH] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Thread-Topic: [PATCH] e1000e: Ignore TSYNCRXCTL when getting I219 clock attributes Thread-Index: AQHT6DClJ3dQ5IHll0yV5BCwEp6jIKQpTMjQ Date: Thu, 10 May 2018 18:42:56 +0000 Message-ID: <02874ECE860811409154E81DA85FBB5882DD85D3@ORSMSX115.amr.corp.intel.com> References: <02874ECE860811409154E81DA85FBB5882D918F3@ORSMSX115.amr.corp.intel.com> <20180510072835.5549-1-bpoirier@suse.com> In-Reply-To: <20180510072835.5549-1-bpoirier@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzljZjgwYzktZDU0Ni00OTU2LTlkOTEtOTg5OWE3YTRmNjNlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjlkcklGaWVNdmplRktWRG50TG5LWUxMbUVwYjRQZlhIVTRVbDFZVGs0ZXM9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Benjamin Poirier [mailto:bpoirier@suse.com] > Sent: Thursday, May 10, 2018 12:29 AM > To: Kirsher, Jeffrey T > 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 > > 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 Given testing showing that the clock operates fine regardless of the register read, I think this is probably fine. Normally I believe the register was used to check which frequency was in use, but it doesn't seem to serve that purpose here. Thanks, Jake