From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754917AbcGTRFm (ORCPT ); Wed, 20 Jul 2016 13:05:42 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:36438 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751397AbcGTRFh (ORCPT ); Wed, 20 Jul 2016 13:05:37 -0400 Date: Wed, 20 Jul 2016 13:05:33 -0400 From: Jarod Wilson To: "Rustad, Mark D" Cc: LKML , "netdev@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" Subject: Re: [Intel-wired-lan] [PATCH net] e1000e: fix PTP on e1000_pch_lpt variants Message-ID: <20160720170533.GE37138@redhat.com> References: <1468959902-25071-1-git-send-email-jarod@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2016 at 08:49:03PM +0000, Rustad, Mark D wrote: > Jarod Wilson wrote: > > >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 > >--- > > 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; > > I don't think that it is acceptable to declare local variables > inside a switch statement quite like this. At a minimum, a new block > needs to be opened to allow the declarations. Gah, sorry, I think testing was done with an if, made a late change to a switch without doing sufficient re-testing. I'll fix that up and re-test. -- Jarod Wilson jarod@redhat.com