Received: by 10.192.165.148 with SMTP id m20csp1251951imm; Wed, 2 May 2018 17:31:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoOs/ZGovlCe9b/CfaqAPWOLiw8lKLndcS6Gks/5qtkQP2anO4t0gxGcHFe9VYfDpKfHIm7 X-Received: by 10.98.79.12 with SMTP id d12mr21135022pfb.220.1525307510473; Wed, 02 May 2018 17:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525307510; cv=none; d=google.com; s=arc-20160816; b=yk9QfbOJWMUO6irklrSGOW0mFLTN0A9HVcC21fujHbBzI+MJ0wGr/6V/6pTWkRRWcH UZWi9FsaHDsO6s/QVuKncmf6aN68ggMQT0hT99j8+hCFHGcNZUmER6KLCsBsVU1gY1W7 5pw5a4KfrNoMCf2jEBmDTrIRwRgRAQfWyIHYOEM1idC3oio2sOE1NiJnIxcPN5WxeLMy 6IVjRA7xTnB5uaP905A/7WMV/fShEl6BWvGalW8wgtxVszU3AntPR8rQwSEnQwNzR9SQ WWNHpasiOk/xUS4uXcWwhwFuysIF0RnMmOegBEt2K5jGqbju+kL6DcthPqktr+/C2fxd tZ0w== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=PPyd9AGTZdkOVWBGUY9IABUXIH/FBLuPMOs2Y+cia+M=; b=XqAHSb0/3FDQ3MlWdNybfRjP+y3ZgvLm7RWeFEZaw/Bs3vgq03WpWR9gU4QOAlONWP jIaOVDTMCkXWQNv14dAPDrzocauvhpP8OL0f1qzvaadEasmzBe+Aq6UQ3dEB5G9dly7i YrAiMrpQcBfm9TT3hoxkEa5w8kuf0m7Gy4cNoG9oCKQZUew3wUvIYaI/US62hLusQe2A lILJ4Cr+asLnwedQlpDjrJao1po6Ca1lYj8NgsLc+0W2jxx8rALwF7EYL9yp6VdlMvBL 41iJHaLT0p1gIf8vQlQHAqsMJ8amvMdMKZsOB5PXaUVw8ou7h0OInc88ezDHx8ble5aw FrxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ASEaFnUK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6-v6si10249620pgc.140.2018.05.02.17.31.22; Wed, 02 May 2018 17:31:50 -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=@gmail.com header.s=20161025 header.b=ASEaFnUK; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751837AbeECAbL (ORCPT + 99 others); Wed, 2 May 2018 20:31:11 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34737 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751747AbeECAbI (ORCPT ); Wed, 2 May 2018 20:31:08 -0400 Received: by mail-pg0-f67.google.com with SMTP id g20-v6so5148746pgv.1; Wed, 02 May 2018 17:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=PPyd9AGTZdkOVWBGUY9IABUXIH/FBLuPMOs2Y+cia+M=; b=ASEaFnUKZIU63NAH/4C7gjTzBucB7P2I6qjYgicTU5CMUZagt+L+aIoFOcMbXElCm2 aQTIvMxeWNPkYdJS4RdLRaFEwd8qV5RWa1ZUot8kXTK05ChhD1yPBpxRSu6xOYhU0sMH omvX3rDuYLD8c/mcuav6mGmqROqL3OsuC3Q1/92qS8/QJZc8xJAK0sXZYLDr4HidEGo9 xophf7eP4Hw1Fsp4n4XsAHBaVpd4XG70vSANbPa1w9bLtxoK8/NnmiHo726ZDfDEKr89 Nvx7Tw1uZ4HNll43sAqiSHStpIMdezK9y1SThQPdYBLin7zrbyO+NL+HFrkGAE+VKRQT xqGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=PPyd9AGTZdkOVWBGUY9IABUXIH/FBLuPMOs2Y+cia+M=; b=PBUgWNSacsDZOmUoxNDblXKkAGrKPNpWPiglQkC78Fi2zq6nmahJfVou3n74RkQPGy cG+n4ITyXsG0dXsMtDOpgtKyOYoBD23jKBnU1URoQkF0x0hGqOjDkoz0NJOhEQRU7Y88 5iwkHhOK9LdhG8ZbYiftf+u4cZJwIin+pTgI8G/OU8SHvYlhi3rhq69NTGsHk3+NU/3O s2Bn8X9BzUTCwRliRJMcSEakvViwz3zt11yQh+9bm8Q+8a5EEXPZjgq3MIpX1ePAncHY mL5oy5FEmFQX5+SVFwQBKUTxTYxDfM6epnJjS8jzA+Cu6z4nTi8//l+cGgnUidwA5du1 hKxw== X-Gm-Message-State: ALQs6tC3hRUpRwayQ4e5XluveRkPOyjqJ8lic/3K/4nTQdxS29P/kOA1 vPVU0mdoTXssp7u+vbzfmzV/TiQPVR8= X-Received: by 10.167.130.22 with SMTP id k22mr21239649pfi.73.1525307468202; Wed, 02 May 2018 17:31:08 -0700 (PDT) Received: from [10.0.2.15] ([123.116.137.251]) by smtp.googlemail.com with ESMTPSA id b6-v6sm16801051pgr.52.2018.05.02.17.31.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 17:31:07 -0700 (PDT) Subject: Re: [v2 PATCH 1/1] tg3: fix meaningless hw_stats reading after tg3_halt memset 0 hw_stats To: Michael Chan References: <20180502004234.230662-1-zumeng.chen@gmail.com> <5af186f8-9718-c295-4e34-e84dd78ea157@gmail.com> Cc: Netdev , open list , Siva Reddy Kallam , "prashant.sreedharan@broadcom.com" , David Miller , Zumeng Chen From: Zumeng Chen Message-ID: <8f73e98f-0c55-2d96-a1b7-0890bf90bf41@gmail.com> Date: Thu, 3 May 2018 08:30:54 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018年05月03日 01:32, Michael Chan wrote: > On Wed, May 2, 2018 at 3:27 AM, Zumeng Chen wrote: >> On 2018年05月02日 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 related >> codes carefully. >> > We should use an existing flag whenever appropriate I disagree. This is sort of blahblah... > , instead of adding > yet another flag to do similar things. I've looked at the code briefly > and believe that INIT_COMPLETE will work. When we fix a problem, we'd better think if we introduce a new one. > If you think it won't work, > please be specific and point out why it won't work. Thanks. I don't care if it work or not, I directly feel it's a bad idea. INIT_COMPLETE include a lot of network stuffs, it's not simple hardware reset related. Here again, My fix logic is very simple to fix the problem I met, I think this is how Linux works together with such a lot of thing, which means clear, simple, and robust for every unit, we re-unite them eco-systematically. Finally, it's yours, so be it. Cheers, Zumeng