From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wenzhuol@shecgisg004.sh.intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 82EA6924D
 for <dev@dpdk.org>; Fri, 16 Oct 2015 04:51:47 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga101.jf.intel.com with ESMTP; 15 Oct 2015 19:51:46 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.17,687,1437462000"; d="scan'208";a="812243561"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by fmsmga001.fm.intel.com with ESMTP; 15 Oct 2015 19:51:45 -0700
Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com
 [10.239.29.89])
 by shvmail01.sh.intel.com with ESMTP id t9G2piga027973;
 Fri, 16 Oct 2015 10:51:44 +0800
Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1])
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id
 t9G2pe9T031022; Fri, 16 Oct 2015 10:51:42 +0800
Received: (from wenzhuol@localhost)
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9G2peaA031018;
 Fri, 16 Oct 2015 10:51:40 +0800
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Date: Fri, 16 Oct 2015 10:50:54 +0800
Message-Id: <1444963882-30931-9-git-send-email-wenzhuo.lu@intel.com>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1444963882-30931-1-git-send-email-wenzhuo.lu@intel.com>
References: <1444804479-14840-1-git-send-email-wenzhuo.lu@intel.com>
 <1444963882-30931-1-git-send-email-wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH v3 08/36] e1000/base: remove E1000_WRITE_FLUSH
	for DH89XXCC_SGMII after commencing HW reset
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 16 Oct 2015 02:51:48 -0000

For DH89XXCC_SGMII, write flush leaves registers of this device trashed
(0xFFFFFFFF). Added check for this device.
Also, after both for Port SW Reset and Device Reset case, platform should
wait at least 3ms before reading any registers. Since waiting is
conditionally executed only for Device Reset - removed the condition.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/e1000/base/e1000_82575.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/base/e1000_82575.c b/drivers/net/e1000/base/e1000_82575.c
index 3dc8066..ab547ca 100644
--- a/drivers/net/e1000/base/e1000_82575.c
+++ b/drivers/net/e1000/base/e1000_82575.c
@@ -2490,11 +2490,17 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)
 		ctrl |= E1000_CTRL_RST;
 
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
-	E1000_WRITE_FLUSH(hw);
 
-	/* Add delay to insure DEV_RST has time to complete */
-	if (global_device_reset)
-		msec_delay(5);
+	switch (hw->device_id) {
+	case E1000_DEV_ID_DH89XXCC_SGMII:
+		break;
+	default:
+		E1000_WRITE_FLUSH(hw);
+		break;
+	}
+
+	/* Add delay to insure DEV_RST or RST has time to complete */
+	msec_delay(5);
 
 	ret_val = e1000_get_auto_rd_done_generic(hw);
 	if (ret_val) {
-- 
1.9.3