Received: by 10.192.165.148 with SMTP id m20csp1424005imm; Wed, 2 May 2018 22:05:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrzULjJks7ZMrXCW5edePcLTEUW8fKhU2wsLfAhsgjEgFTxtqnEBgt3uDsoy4+ygo1Q3MrO X-Received: by 2002:a63:60c1:: with SMTP id u184-v6mr17887023pgb.122.1525323912140; Wed, 02 May 2018 22:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525323912; cv=none; d=google.com; s=arc-20160816; b=ORr7CW48jsbGMWaMpUFM9Y9kez8DBXX3pJIdVerqspdjisMNmaT2bxSF472cFGnRjA TDCl/+yS4H+/q/2uzWEzWeR13NhJAH163hHxZt38TVqFHU7vX1ZNCZyFt9ufp63cVgTg Cvi9MvJN/7r5Yix55qWrVpy4jfSsENnpAH6oSzynJNuAz2KRfxGsXpOJTQriPNdHAZ39 N6LNbufOjpDJRinCGju8BpPop51RF0lbDf371Nb++bdldLihT0b7h4KyWFhGlhXqRdyY b5idd0usgKdfmgy6rDqKwgLmfDCSjePtYGKdlG4gKyEr+JDHQfbzEZdDfLFmYnJhoVCt t5uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=FQDyvlY9U/N34lSkdWNvCj2uotNfc9Gs9K5ZihdaSIw=; b=UA64us66yeaRwZ3TCmnJ83CRS0mIAnJV3fEE+wFxwphkQbsxNV9DM2CpcSxTklU/xx Ns/ELbtzn7NIXNbhfMS/XsTFFtD4ksg+IquOGvecb4BVmFFTp4FVXEMSMIW3slp8/k+r hrSC7PWVgPNOzvdD6xxPXsbQY2Qs03OL+x8Q483EkXytxljxe0qv7E2nzZPHJiRE7cpp ERvz+PZmCRIM9U7+ggWEC3Pw/kQGEFikxVoGLNQMK/qhVgPiTWDwHERTubbIz3ydymJ5 NmXFvQSSyMVGNfNtgiJNsoJlcYEXDAw5G6gh5v4olNf0rstGGQjjCghwCQ9uaVqVG45V kovg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=bN/jF+mD; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi1-v6si8000288plb.267.2018.05.02.22.04.58; Wed, 02 May 2018 22:05:12 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=bN/jF+mD; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbeECFEj (ORCPT + 99 others); Thu, 3 May 2018 01:04:39 -0400 Received: from mail-ot0-f170.google.com ([74.125.82.170]:34636 "EHLO mail-ot0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751741AbeECFEe (ORCPT ); Thu, 3 May 2018 01:04:34 -0400 Received: by mail-ot0-f170.google.com with SMTP id i5-v6so7560153otf.1 for ; Wed, 02 May 2018 22:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FQDyvlY9U/N34lSkdWNvCj2uotNfc9Gs9K5ZihdaSIw=; b=bN/jF+mDZCobbCtAcIknurUhtlAExCorRJIdTX7kEnFz0kKs2ZTOrDK2PFHc/VRNXm dTcAcxLmZwIySIsjgWVOIFoP7w0rl4/729vICzskzQ/+4zLolK2wuyrgVb+s0/uRtthu BltEe8j4kifdasQ226B43l1q4c+zuD5FPPiCo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FQDyvlY9U/N34lSkdWNvCj2uotNfc9Gs9K5ZihdaSIw=; b=NhsEk/fR2WRmTzqkFvP2ydg/I/XiXA0eOCKY8KMo4tyHDn+CLPVxjwa9rSfWjGGEfI BpiBaFj4UwPUEIrWAw5ceCpWiQWRDAPM+FvUDMJf6kPO9yDujwpUc7J/0qQckzTkD40I omgK55Kp2iD0TX+hZLHO+Nj7NkK7qKYk841SA9fI5bQjmKaIPrvGYs10KfmsVdI94AS3 lHV+Jc+nlEbA84lqp7dQ7XUcw1D8g8v1pu+Oale3QWizSS3d4UIP+lwGCBb5iMIpcDHt 22+TRMbqpXgFQ347Q9Bm8XwUjVGLijZuxrrIquFvBW9KVUBaEM+hKL+vBaa0/8OJEIJQ sr7A== X-Gm-Message-State: ALQs6tD3/U03cLalH4mCvdOrVL5kkmbybJG+7Rpm/hPxe56gVc3QOCUu nI5Ps4xHERNdPq2XJ7cYJWgENV73x9nWKItiof/6ng== X-Received: by 2002:a9d:14c5:: with SMTP id r5-v6mr14702249otr.397.1525323873907; Wed, 02 May 2018 22:04:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1b4c:0:0:0:0:0 with HTTP; Wed, 2 May 2018 22:04:33 -0700 (PDT) In-Reply-To: <8f73e98f-0c55-2d96-a1b7-0890bf90bf41@gmail.com> References: <20180502004234.230662-1-zumeng.chen@gmail.com> <5af186f8-9718-c295-4e34-e84dd78ea157@gmail.com> <8f73e98f-0c55-2d96-a1b7-0890bf90bf41@gmail.com> From: Michael Chan Date: Wed, 2 May 2018 22:04:33 -0700 Message-ID: Subject: Re: [v2 PATCH 1/1] tg3: fix meaningless hw_stats reading after tg3_halt memset 0 hw_stats To: Zumeng Chen Cc: Netdev , open list , Siva Reddy Kallam , "prashant.sreedharan@broadcom.com" , David Miller , Zumeng Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 2, 2018 at 5:30 PM, Zumeng Chen wrote: > On 2018=E5=B9=B405=E6=9C=8803=E6=97=A5 01:32, Michael Chan wrote: >> >> On Wed, May 2, 2018 at 3:27 AM, Zumeng Chen wrot= e: >>> >>> On 2018=E5=B9=B405=E6=9C=8802=E6=97=A5 13:12, Michael Chan wrote: >>>> >>>> On Tue, May 1, 2018 at 5:42 PM, Zumeng Chen >>>> wrote: >>>> >>>>> diff --git a/drivers/net/ethernet/broadcom/tg3.h >>>>> b/drivers/net/ethernet/broadcom/tg3.h >>>>> index 3b5e98e..c61d83c 100644 >>>>> --- a/drivers/net/ethernet/broadcom/tg3.h >>>>> +++ b/drivers/net/ethernet/broadcom/tg3.h >>>>> @@ -3102,6 +3102,7 @@ enum TG3_FLAGS { >>>>> TG3_FLAG_ROBOSWITCH, >>>>> TG3_FLAG_ONE_DMA_AT_ONCE, >>>>> TG3_FLAG_RGMII_MODE, >>>>> + TG3_FLAG_HALT, >>>> >>>> I think you should be able to use the existing INIT_COMPLETE flag >>> >>> >>> No, it will bring the uncertain factors into the existed complicate >>> logic >>> of INIT_COMPLETE. >>> And I think it's very simple logic here to fix the meaningless hw_stats >>> reading and the problem >>> of commit f5992b72. I even suspect if you have read INIT_COMPLETE relat= ed >>> codes carefully. >>> >> We should use an existing flag whenever appropriate > > > I disagree. This is sort of blahblah... >> I don't want to see another flag added that is practically the same as !INIT_COMPLETE. The driver already has close to one hundred flags. Adding a new flag that is similar to an existing flag will just make the code more difficult to understand and maintain. If you don't want to fix it the cleaner way, Siva or I will fix it.