Received: by 10.192.165.148 with SMTP id m20csp900053imm; Wed, 2 May 2018 10:33:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqFrECm0CK3q2XypjD6d/6Nm1EZUP+GfTTc6rL+fU1PiZpVLa4gMybINF4sL6bYfGnqcxXN X-Received: by 10.98.89.89 with SMTP id n86mr18831261pfb.217.1525282411098; Wed, 02 May 2018 10:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525282411; cv=none; d=google.com; s=arc-20160816; b=lsPd6dsUdkIGWdtNGbiVN003BtlZvQ/J+8eT9+RklTOF8x9Vo1bNNN7h5S7qwvf9qN uuNE9U8OIXEuSQdosFSQXXHOFW1cBohiaFs1u1QB2L+G7h1+7TFMUExRrt9f/1g0e+sZ elbJFVg4kMLtFZ4DwYe9W/qZZa1OXb7gXk1m96S7rf2rRMKBFq2BTUEhcYHhlyVrWIuy SQknaGL63U8Z/xWtKOfmcsmcPDvocTbKQdRceEBRaFLOO7TANEEmBVyy06M8KqiJeYJQ CxVQf0PoNUlX85csLqwIOGQtjLRbJlMh7/q1pgZLToOUP7bp9gGH6AUy0K/dAuKh75jE yEVg== 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=zkU3Th/Uox9d/eGk0hAIvy5JQPB+UNTnSqlr2kH9lQg=; b=Qab9Te3Up9TAeEWbRN97dwm70h6gcdWNcsEdk8GjEXO4zwQy6wRptCq386towmLFsb qjxCdTwfir/QUvKtcut8dVH1GjiIxg10LRmImrxfwC7ZqwE9AZWDK6zxTAeUrTe7Lhh/ ThnjzDkj9Zkklo8i8Evy0SbgrZ3LMX7lTMoB8YT5m2X/DvpYYDjGAMbphoBHT+xbD0IM GxaZvtHnl+QsrNogmqlH9WhVKr6TVXecrf2jkuI7tWv+4A24Xfb6KSbRQUUHodfOycLC ivjnVa7hZ9qVvHxHaNNcPGBuaN7qhXg10J3PqNDJeY4ctM0rCcUxHk1taViyG+4f3rFF VnCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=GXl+ieGw; 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 x2-v6si11809926plv.388.2018.05.02.10.33.13; Wed, 02 May 2018 10:33:31 -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=GXl+ieGw; 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 S1751324AbeEBRc5 (ORCPT + 99 others); Wed, 2 May 2018 13:32:57 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:36465 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751020AbeEBRcx (ORCPT ); Wed, 2 May 2018 13:32:53 -0400 Received: by mail-oi0-f47.google.com with SMTP id v2-v6so13685819oif.3 for ; Wed, 02 May 2018 10:32:53 -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=zkU3Th/Uox9d/eGk0hAIvy5JQPB+UNTnSqlr2kH9lQg=; b=GXl+ieGw36t4WGjZKaZajvFsqcFKjO0afDPX/cGxQZnxteu38oWEkLdbb+gQVLaphz C0ATJrbC6IARHJNW2X7C/p2DY49Qf4aaFaL1wdXJGXe/MgXeNpKDZBEp6vAF4JhiqdGU de3I3qHNyzetlFwrjLoq+rI84xYeZ8Hd75gh4= 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=zkU3Th/Uox9d/eGk0hAIvy5JQPB+UNTnSqlr2kH9lQg=; b=KC3DW3FUwIuUUWqudngCOgHDxaeHuLrXHl6N0jYJrQ53Jn3SFPqoplcZS/GcsMfDp9 HljLzPffSSaq0pejrc37wrHee6oq37P6kIVYBEqC1Vdl4vCKT+qo1pUyvXzQPcHXvisD q6kFx8IYCcCuDDmEiW2GD3M7GBDNFN1ZWnufucNBL131Crx+BYpANfyibWN+MJyNYURx 0e2dGFYIsxouMcxxlyh6qNJDarJppON66AIOgOc4BgfxF910PTsPcp+NFT8eOkSiVzhO nNg0gFRTYyS/C02w9PPQMqMWohVl9GUYUBog1OSLkPk/uhqCtMgSKQa+oREWSGPvgnyB XYKg== X-Gm-Message-State: ALQs6tBVk9kci/PIwzbbUZeXbyR38VjZSI9F2w31r7PYyk8IOyo7RYNS LYVOyt7ryqxRTyroxsNNGYmjEi52/ZZiAtuP310BJw== X-Received: by 2002:aca:3445:: with SMTP id b66-v6mr5772482oia.289.1525282373248; Wed, 02 May 2018 10:32:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1b4c:0:0:0:0:0 with HTTP; Wed, 2 May 2018 10:32:52 -0700 (PDT) In-Reply-To: <5af186f8-9718-c295-4e34-e84dd78ea157@gmail.com> References: <20180502004234.230662-1-zumeng.chen@gmail.com> <5af186f8-9718-c295-4e34-e84dd78ea157@gmail.com> From: Michael Chan Date: Wed, 2 May 2018 10:32:52 -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 3:27 AM, Zumeng Chen wrote: > 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 wrot= e: >> >>> 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 logi= c > 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 related > codes carefully. > We should use an existing flag whenever appropriate, instead of adding yet another flag to do similar things. I've looked at the code briefly and believe that INIT_COMPLETE will work. If you think it won't work, please be specific and point out why it won't work. Thanks.