Received: by 10.192.165.148 with SMTP id m20csp463704imm; Wed, 2 May 2018 03:28:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrXhoE66tr8RvnXMp0FNzbxfrHDwxJAC+9+0c0JOettfVCd7SF3Md02Csy0AryktT0Bkpk7 X-Received: by 10.98.251.20 with SMTP id x20mr18900240pfm.48.1525256929634; Wed, 02 May 2018 03:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525256929; cv=none; d=google.com; s=arc-20160816; b=oFIuL0fMMQXfBAQr26WHfTNsY29/TYsr4TfOAMsxT0XgWTPgmTWUqn1m8eKlG1veh3 MXD8nO1Ir6OgGvY4b0sKeT7SLa7hryQjZ27aXqsaPMGGJQ7uZyKhGmB41CxJGQ16KRpn nJ108dlWxBLNam7kh16jz1VPWOps+0LQml1mFdFRnBE+0N7zgwJ7UhjJOsc3awrnodq2 63UUqZVe269C/cybMDI28UxyurKrtErL3nxSKGGx5Z4pooFgMivm5LBUQoqqsZmQwa3x HVmPIuHKmcWRBUHpxE4uoMKYWVqmiPcnNjsxpgh/QDxIWG6m2HfBqwheDPNtdjwHoVg+ 1Xqg== 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=OWe2vQ0QiOV4j4fOB6+lhIqYnCCgKXw4rv+XaDCo53E=; b=nmU5ijjUNw26B+58Cn4ddW3TXoEB7zJIKzjXeXrH8RLkS7bTi/dKoGxDp845DLlAcu nEV2PcZZYMjjVhYQ+dr6PyqujOCa3H1iMIoqlb0Dm7wu5uoitUs3fbXjsHPSbL7HooSS e62UJu+ZXeCP9LoOaXs1SbmyrPovoYNLw/3ZuzMgffKQsBGKWR/ecrgYqzfBEiUqBZs0 hBjPblDcmZ1UVDsDCeErDEtTdb27D+r5N/AjNOKGmFcNcXb2k66530fnWhS0eOEiFcFg LL40+3PrhrRN+SdKUTGQ/NVL1T1pHwtMgu97nlghzoOzA4XY0xbj2shuoB7dQFQIPL85 FttA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nVK6eCSc; 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 r7-v6si11499977plo.486.2018.05.02.03.28.35; Wed, 02 May 2018 03:28:49 -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=nVK6eCSc; 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 S1751287AbeEBK2O (ORCPT + 99 others); Wed, 2 May 2018 06:28:14 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:39064 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbeEBK2J (ORCPT ); Wed, 2 May 2018 06:28:09 -0400 Received: by mail-pg0-f68.google.com with SMTP id b9-v6so10315267pgf.6; Wed, 02 May 2018 03:28:09 -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=OWe2vQ0QiOV4j4fOB6+lhIqYnCCgKXw4rv+XaDCo53E=; b=nVK6eCScK5vzq3EK4EeO2/2MH+/XXA5p/Pan2eMrvyoxLSid5muq6n2OI4mg/0GXiY kstAbL3x6xXecJeDvEk6L+b8sw9wk8THKh3a7K8j6XAsEu6XK7S5fRrslCjJnQ+ENCOk FNBKG71QfYAS/IlMHh8MyExkfanZe39RdV2s0ekWqsT//TBguEoyzOPUohvCepg7juMa KLNjD9zpl7fVPqosnelPX8WwEIWqttop5kvGhrVU2wkldDwQ80K78T6cppoJzWti4JVv kFw6ZKZei3HEjpQowqXzygRFbt20jUcWZhmaYI/TMnt3a3jlaNJhSI2BPgYnJiLRJCej mgTQ== 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=OWe2vQ0QiOV4j4fOB6+lhIqYnCCgKXw4rv+XaDCo53E=; b=gtf7tbK8EtkU+2wmdH7JZ8T3wcHa7vYDe0sctWNn2cgT3Uqakt3i1YS68Y9upRiUuo PlwFLIFmlMUdG7IaFjijG8XN7M+5JTSXPmxrob7hAl21373D3IxHeXKKVXjzr4sXaORJ 47IahasryLHkEfOjZT+N+wS5Rl6xzarxuVjXi3axt3utTSZHSaWvMuG/X6uL3G03icA5 CBbrBP5rRfY83Jliv1Q8Gd99adaXPixOBsqzB8mP2jUkw1Kv9SPr8MfojpCqOXi0TGIe brzmcp+7SxY2O665Z8t0Q8zEORkhztAtMTxbO0s461lXej1gcwUiyq68NUyOv0icn0+u X8JA== X-Gm-Message-State: ALQs6tAeoZ88jDYKGKe/cGJotfb0aC+eLyMHiOUhVdGyMvK3lBiX3477 /oRIlgTiUCPalWNrIghmd3Xqa6qe X-Received: by 10.98.159.202 with SMTP id v71mr18822262pfk.233.1525256888795; Wed, 02 May 2018 03:28:08 -0700 (PDT) Received: from [10.0.2.15] ([114.252.16.84]) by smtp.googlemail.com with ESMTPSA id s7sm20132235pfm.114.2018.05.02.03.28.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 03:28:08 -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> Cc: Netdev , open list , Siva Reddy Kallam , "prashant.sreedharan@broadcom.com" , David Miller , Zumeng Chen From: Zumeng Chen Message-ID: <5af186f8-9718-c295-4e34-e84dd78ea157@gmail.com> Date: Wed, 2 May 2018 18:27: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月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. Cheers, Zumeng > and > not have to add a new flag. > >> /* Add new flags before this comment and TG3_FLAG_NUMBER_OF_FLAGS */ >> TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */ >> -- >> 2.9.3 >>