netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Raanan Avargil <raanan.avargil@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next v2 02/15] e1000e: Increase PHY PLL clock gate timing
Date: Wed, 24 Feb 2016 18:14:49 -0800	[thread overview]
Message-ID: <1456366502-132841-3-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1456366502-132841-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Raanan Avargil <raanan.avargil@intel.com>

Several packet loss issues were reported for which the root cause for
them was an incorrect configuration of internal HW PHY clock gating
mechanism by SW.
This patch provides the correct mechanism.

Signed-off-by: Raanan Avargil <raanan.avargil@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 12 ++++++++++++
 drivers/net/ethernet/intel/e1000e/ich8lan.h |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index c731465..786d214 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -1433,6 +1433,18 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
 			emi_addr = I217_RX_CONFIG;
 		ret_val = e1000_write_emi_reg_locked(hw, emi_addr, emi_val);
 
+		if (hw->mac.type == e1000_pch_lpt ||
+		    hw->mac.type == e1000_pch_spt) {
+			u16 phy_reg;
+
+			e1e_rphy_locked(hw, I217_PLL_CLOCK_GATE_REG, &phy_reg);
+			phy_reg &= ~I217_PLL_CLOCK_GATE_MASK;
+			if (speed == SPEED_100 || speed == SPEED_10)
+				phy_reg |= 0x3E8;
+			else
+				phy_reg |= 0xFA;
+			e1e_wphy_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg);
+		}
 		hw->phy.ops.release(hw);
 
 		if (ret_val)
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
index 34c551e..7d85f00 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -226,6 +226,9 @@
 #define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA	0x100
 #define HV_PM_CTRL_K1_ENABLE		0x4000
 
+#define I217_PLL_CLOCK_GATE_REG	PHY_REG(772, 28)
+#define I217_PLL_CLOCK_GATE_MASK	0x07FF
+
 #define SW_FLAG_TIMEOUT		1000	/* SW Semaphore flag timeout in ms */
 
 /* Inband Control */
-- 
2.5.0

  parent reply	other threads:[~2016-02-25  2:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25  2:14 [net-next v2 00/15][pull request] 1GbE Intel Wired LAN Driver Updates 2016-02-24 Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 01/15] e1000e: Increase ULP timer Jeff Kirsher
2016-02-25  2:14 ` Jeff Kirsher [this message]
2016-02-25  2:14 ` [net-next v2 03/15] e1000e: Set HW FIFO minimum pointer gap for non-gig speeds Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 04/15] e1000e: Clear ULP configuration register on ULP exit Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 05/15] e1000e: Initial support for KabeLake Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 06/15] igb: When GbE link up, wait for Remote receiver status condition Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 07/15] igb: constify e1000_phy_operations structure Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 08/15] igb: enable WoL for OEM devices regardless of EEPROM setting Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 09/15] igb: add conditions for I210 to generate periodic clock output Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 10/15] igb: rename igb define to be more generic Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 11/15] igb: Add support for generic Tx checksums Jeff Kirsher
2016-02-25  2:14 ` [net-next v2 12/15] igbvf: " Jeff Kirsher
2016-02-25  2:15 ` [net-next v2 13/15] igbvf: remove "link is Up" message when registering mcast address Jeff Kirsher
2016-02-25  2:15 ` [net-next v2 14/15] igb: Fix VLAN tag stripping on Intel i350 Jeff Kirsher
2016-02-25  2:15 ` [net-next v2 15/15] igb: call ndo_stop() instead of dev_close() when running offline selftest Jeff Kirsher
2016-02-25  7:45 ` [net-next v2 00/15][pull request] 1GbE Intel Wired LAN Driver Updates 2016-02-24 Or Gerlitz
2016-02-25 21:59   ` Jeff Kirsher
2016-02-26 19:57 ` David Miller

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=1456366502-132841-3-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=raanan.avargil@intel.com \
    --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).