All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Bruce Allan <bruce.w.allan@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 06/40] e1000e: Clear host wakeup bit on 82577/8 without touching PHY page 800
Date: Tue,  7 Jun 2011 05:32:41 -0700	[thread overview]
Message-ID: <1307449995-9458-7-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1307449995-9458-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

The Host Wakeup Active bit in the PHY Port General Configuration register
(page 769 register 17) must be cleared after every PHY reset to prevent an
unexpected wake signal from the PHY. Originally, this was accomplished by
simply reading the PHY Wakeup Control register on page 800 which clears the
Host Wakeup Active bit as a side-effect. Unfortunately, a hardware bug on
the 82577 and 82578 PHY can cause unexpected behavior when registers on
page 800 are accessed while in gigabit mode.

This patch changes the remaining instances when the Host Wakeup Active bit
needs to be cleared while possibly in gigabit mode by accessing the Port
General Configuration register directly instead of accessing any register
on page 800.

Signed-off-by: Bruce 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/e1000e/e1000.h   |    1 +
 drivers/net/e1000e/ich8lan.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 2c05b4f..c1e7f94 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -104,6 +104,7 @@ struct e1000_info;
 	 (((reg) & ~MAX_PHY_REG_ADDRESS) << (PHY_UPPER_SHIFT - PHY_PAGE_SHIFT)))
 
 /* PHY Wakeup Registers and defines */
+#define BM_PORT_GEN_CFG PHY_REG(BM_PORT_CTRL_PAGE, 17)
 #define BM_RCTL         PHY_REG(BM_WUC_PAGE, 0)
 #define BM_WUC          PHY_REG(BM_WUC_PAGE, 1)
 #define BM_WUFC         PHY_REG(BM_WUC_PAGE, 2)
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 1ede6e0..c175212 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -1391,14 +1391,11 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
 	ret_val = hw->phy.ops.acquire(hw);
 	if (ret_val)
 		goto out;
-	ret_val = hw->phy.ops.read_reg_locked(hw,
-	                                      PHY_REG(BM_PORT_CTRL_PAGE, 17),
-	                                      &phy_data);
+	ret_val = hw->phy.ops.read_reg_locked(hw, BM_PORT_GEN_CFG, &phy_data);
 	if (ret_val)
 		goto release;
-	ret_val = hw->phy.ops.write_reg_locked(hw,
-	                                       PHY_REG(BM_PORT_CTRL_PAGE, 17),
-	                                       phy_data & 0x00FF);
+	ret_val = hw->phy.ops.write_reg_locked(hw, BM_PORT_GEN_CFG,
+					       phy_data & 0x00FF);
 release:
 	hw->phy.ops.release(hw);
 out:
@@ -1760,9 +1757,12 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
 		break;
 	}
 
-	/* Dummy read to clear the phy wakeup bit after lcd reset */
-	if (hw->mac.type >= e1000_pchlan)
-		e1e_rphy(hw, BM_WUC, &reg);
+	/* Clear the host wakeup bit after lcd reset */
+	if (hw->mac.type >= e1000_pchlan) {
+		e1e_rphy(hw, BM_PORT_GEN_CFG, &reg);
+		reg &= ~BM_WUC_HOST_WU_BIT;
+		e1e_wphy(hw, BM_PORT_GEN_CFG, reg);
+	}
 
 	/* Configure the LCD with the extended configuration region in NVM */
 	ret_val = e1000_sw_lcd_config_ich8lan(hw);
@@ -3161,11 +3161,13 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
 
 	/*
 	 * The 82578 Rx buffer will stall if wakeup is enabled in host and
-	 * the ME.  Reading the BM_WUC register will clear the host wakeup bit.
+	 * the ME.  Disable wakeup by clearing the host wakeup bit.
 	 * Reset the phy after disabling host wakeup to reset the Rx buffer.
 	 */
 	if (hw->phy.type == e1000_phy_82578) {
-		e1e_rphy(hw, BM_WUC, &i);
+		e1e_rphy(hw, BM_PORT_GEN_CFG, &i);
+		i &= ~BM_WUC_HOST_WU_BIT;
+		e1e_wphy(hw, BM_PORT_GEN_CFG, i);
 		ret_val = e1000_phy_hw_reset_ich8lan(hw);
 		if (ret_val)
 			return ret_val;
-- 
1.7.5.2


  parent reply	other threads:[~2011-06-07 12:33 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 12:32 [net-next 00/40][pull request] Intel Wired LAN Driver Update Jeff Kirsher
2011-06-07 12:32 ` [net-next 01/40] e1000e: disable far-end loopback mode on ESB2 Jeff Kirsher
2011-06-07 12:32 ` [net-next 02/40] e1000e: 82579 intermittently disabled during S0->Sx Jeff Kirsher
2011-06-07 12:32 ` [net-next 03/40] e1000e: log when swflag is cleared unexpectedly on ICH/PCH devices Jeff Kirsher
2011-06-07 12:32 ` [net-next 04/40] e1000e: do not schedule the Tx queue until ready Jeff Kirsher
2011-06-07 12:32 ` [net-next 05/40] e1000e: access multiple PHY registers on same page at the same time Jeff Kirsher
2011-06-07 12:32 ` Jeff Kirsher [this message]
2011-06-07 12:32 ` [net-next 07/40] e1000e: remove redundant reverse dependency on CRC32 Jeff Kirsher
2011-06-07 12:32 ` [net-next 08/40] e1000e: update driver version Jeff Kirsher
2011-06-07 12:32 ` [net-next 09/40] igbvf: update version number Jeff Kirsher
2011-06-07 12:32 ` [net-next 10/40] igb: Change version to remove number after -k in kernel versions Jeff Kirsher
2011-06-07 12:32 ` [net-next 11/40] ixgbe: dcbnl reduce duplicated code and indentation Jeff Kirsher
2011-06-07 12:32 ` [net-next 12/40] ixgbe: consolidate packet buffer allocation Jeff Kirsher
2011-06-07 12:32 ` [net-next 13/40] ixgbe: consolidate MRQC and MTQC handling Jeff Kirsher
2011-06-07 12:32 ` [net-next 14/40] ixgbe: configure minimal packet buffers to support TC Jeff Kirsher
2011-06-07 12:32 ` [net-next 15/40] ixgbe: DCB use existing TX and RX queues Jeff Kirsher
2011-06-07 12:32 ` [net-next 16/40] ixgbe: DCB 82598 devices, tx_idx and rx_idx swapped Jeff Kirsher
2011-06-07 12:32 ` [net-next 17/40] ixgbe: setup redirection table for multiple packet buffers Jeff Kirsher
2011-06-07 12:32 ` [net-next 18/40] ixgbe: fix bit mask for DCB version Jeff Kirsher
2011-06-07 12:32 ` [net-next 19/40] ixgbe: DCB and perfect filters can coexist Jeff Kirsher
2011-06-07 12:32 ` [net-next 20/40] ixgbe: DCB, remove unneeded ixgbe_dcb_txq_to_tc() routine Jeff Kirsher
2011-06-07 12:32 ` [net-next 21/40] ixgbe: add support for Dell CEM Jeff Kirsher
2011-06-07 12:32 ` [net-next 22/40] ixgbe: setup per CPU PCI pool for FCoE DDP Jeff Kirsher
2011-06-07 12:32 ` [net-next 23/40] ixgbe: use per NUMA node lock " Jeff Kirsher
2011-06-07 12:32 ` [net-next 24/40] ixgbe: alloc DDP PCI pool and ixgbe queues as per NUMA nodes Jeff Kirsher
2011-06-07 12:58   ` Ben Hutchings
2011-06-14  0:14     ` Vasu Dev
2011-06-07 12:33 ` [net-next 25/40] ixgbe: remove ntuple filtering Jeff Kirsher
2011-06-07 12:33 ` [net-next 26/40] ixgbe: fix flags relating to perfect filters to support coexistence Jeff Kirsher
2011-06-07 12:33 ` [net-next 27/40] ixgbe: update perfect filter framework to support retaining filters Jeff Kirsher
2011-06-07 12:33 ` [net-next 28/40] ixgbe: add basic support for setting and getting nfc controls Jeff Kirsher
2011-06-07 12:33 ` [net-next 29/40] ixgbe: add support for displaying ntuple filters via the nfc interface Jeff Kirsher
2011-06-07 12:33 ` [net-next 30/40] ixgbe: add support for nfc addition and removal of filters Jeff Kirsher
2011-06-07 21:24   ` Ben Hutchings
2011-06-07 22:39     ` Alexander Duyck
2011-06-07 12:33 ` [net-next 31/40] ethtool: remove support for ETHTOOL_GRXNTUPLE Jeff Kirsher
2011-06-07 13:06   ` Ben Hutchings
2011-06-07 22:20     ` Alexander Duyck
2011-06-07 12:33 ` [net-next 32/40] ixgbe: add support for modifying UDP RSS flow hash options Jeff Kirsher
2011-06-07 12:33 ` [net-next 33/40] ixgbe: move setting RSC into a separate function Jeff Kirsher
2011-06-07 12:33 ` [net-next 34/40] ixgbe: move reset code " Jeff Kirsher
2011-06-07 12:33 ` [net-next 35/40] ixgbe: disable RSC when Rx checksum is off Jeff Kirsher
2011-06-07 12:33 ` [net-next 36/40] ixgbe: fix ring assignment issues for SR-IOV and drop cases Jeff Kirsher
2011-06-07 12:33 ` [net-next 37/40] rtnetlink: Compute and store minimum ifinfo dump size Jeff Kirsher
2011-06-08  6:09   ` Johannes Berg
2011-06-08  7:12     ` David Miller
2011-06-07 12:33 ` [net-next 38/40] ixgbe: Update feature flags so that LRO and Ntuple are restricted Jeff Kirsher
2011-06-07 13:15   ` Ben Hutchings
2011-06-07 22:32     ` Alexander Duyck
2011-06-07 12:33 ` [net-next 39/40] ixgbe: update driver version string Jeff Kirsher
2011-06-07 12:33 ` [net-next 40/40] ixgbevf: Update the driver string 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=1307449995-9458-7-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=bruce.w.allan@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.