netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: David Ertman <davidx.m.ertman@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 04/15] e1000e: Fix 82579 sets LPI too early.
Date: Sat,  8 Mar 2014 01:25:30 -0800	[thread overview]
Message-ID: <1394270741-29926-5-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1394270741-29926-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: David Ertman <davidx.m.ertman@intel.com>

Enabling EEE LPI sooner than one second after link up on 82579 causes link
issues with some switches.

Remove EEE enablement for 82579 parts from the link initialization flow to
avoid initializing too early.  EEE initialization for 82579 will be done
in e1000e_update_phy_task.

Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Acked-by: Bruce W Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 16 ++++++++++++----
 drivers/net/ethernet/intel/e1000e/ich8lan.h |  1 +
 drivers/net/ethernet/intel/e1000e/netdev.c  |  7 ++++++-
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 4f3da87..42cc537 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -744,8 +744,14 @@ s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data)
  *  Enable/disable EEE based on setting in dev_spec structure, the duplex of
  *  the link and the EEE capabilities of the link partner.  The LPI Control
  *  register bits will remain set only if/when link is up.
+ *
+ *  EEE LPI must not be asserted earlier than one second after link is up.
+ *  On 82579, EEE LPI should not be enabled until such time otherwise there
+ *  can be link issues with some switches.  Other devices can have EEE LPI
+ *  enabled immediately upon link up since they have a timer in hardware which
+ *  prevents LPI from being asserted too early.
  **/
-static s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
+s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
 {
 	struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
 	s32 ret_val;
@@ -1126,9 +1132,11 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
 	e1000e_check_downshift(hw);
 
 	/* Enable/Disable EEE after link up */
-	ret_val = e1000_set_eee_pchlan(hw);
-	if (ret_val)
-		return ret_val;
+	if (hw->phy.type > e1000_phy_82579) {
+		ret_val = e1000_set_eee_pchlan(hw);
+		if (ret_val)
+			return ret_val;
+	}
 
 	/* If we are forcing speed/duplex, then we simply return since
 	 * we have already determined whether we have link or not.
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
index 217090d..707bf4d 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -268,4 +268,5 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
 s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
 s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
 s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data);
+s32 e1000_set_eee_pchlan(struct e1000_hw *hw);
 #endif /* _E1000E_ICH8LAN_H_ */
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 1f144e9..94bd92d 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -4463,11 +4463,16 @@ static void e1000e_update_phy_task(struct work_struct *work)
 	struct e1000_adapter *adapter = container_of(work,
 						     struct e1000_adapter,
 						     update_phy_task);
+	struct e1000_hw *hw = &adapter->hw;
 
 	if (test_bit(__E1000_DOWN, &adapter->state))
 		return;
 
-	e1000_get_phy_info(&adapter->hw);
+	e1000_get_phy_info(hw);
+
+	/* Enable EEE on 82579 after link up */
+	if (hw->phy.type == e1000_phy_82579)
+		e1000_set_eee_pchlan(hw);
 }
 
 /**
-- 
1.8.3.1

  parent reply	other threads:[~2014-03-08  9:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-08  9:25 [net-next 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-08  9:25 ` [net-next 01/15] e1000e: PTP lock in e1000e_phc_adjustfreq Jeff Kirsher
2014-03-08  9:25 ` [net-next 02/15] e1000e: Cleanup unecessary references Jeff Kirsher
2014-03-08  9:25 ` [net-next 03/15] e1000e: Resolve issues with Management Engine (ME) briefly blocking PHY resets Jeff Kirsher
2014-03-08  9:25 ` Jeff Kirsher [this message]
2014-03-08  9:25 ` [net-next 05/15] e1000e: Cleanup - Update GPL header and Copyright Jeff Kirsher
2014-03-08  9:25 ` [net-next 06/15] e1000e: Add missing branding strings in ich8lan.c Jeff Kirsher
2014-03-08  9:25 ` [net-next 07/15] e1000e: Refactor PM flows Jeff Kirsher
2014-03-08  9:25 ` [net-next 08/15] e1000e Refactor of Runtime Power Management Jeff Kirsher
2014-03-08  9:25 ` [net-next 09/15] e1000e: Feature Enable PHY Ultra Low Power Mode (ULP) Jeff Kirsher
2014-03-08  9:25 ` [net-next 10/15] e1000e: Fix not generating an error on invalid load parameter Jeff Kirsher
2014-03-08  9:25 ` [net-next 11/15] e1000e: Fix ethtool offline tests for 82579 parts Jeff Kirsher
2014-03-08  9:25 ` [net-next 12/15] e1000e: Fix SHRA register access for 82579 Jeff Kirsher
2014-03-08  9:25 ` [net-next 13/15] ixgbevf: fix skb->pkt_type checks Jeff Kirsher
2014-03-08  9:25 ` [net-next 14/15] igb: fix array size calculation Jeff Kirsher
2014-03-08  9:25 ` [net-next 15/15] igb: fix warning if !CONFIG_IGB_HWMON Jeff Kirsher
2014-03-08 23:50 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates David Miller
2014-03-09  0:10   ` David Miller
2014-03-09  1:12     ` Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394270741-29926-5-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=davidx.m.ertman@intel.com \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).