e1000e: avoid polling h/w registers during link negotiation
Subsystems (2)
PATCH 1/4 e1000e: avoid polling h/w registers during link negotiation
From: Bruce Allan <[email protected]>
Avoid touching hardware registers when possible, otherwise link negotiation can get messed up when user-level scripts are rapidly polling the driver to see if/when link is up. Use the saved link state information instead when possible.
---
drivers/net/e1000e/e1000.h | 1 - drivers/net/e1000e/ethtool.c | 54 ++++++++++++++++++++++-------------------- drivers/net/e1000e/netdev.c | 2 +- 3 files changed, 29 insertions(+), 28 deletions(-)
drivers/net/e1000e/e1000.h +0 -1
@@ -461,7 +461,6 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);extern void e1000e_free_rx_resources (struct e1000_adapter *adapter);extern void e1000e_free_tx_resources (struct e1000_adapter *adapter);extern void e1000e_update_stats (struct e1000_adapter *adapter); -extern bool e1000e_has_link (struct e1000_adapter *adapter);extern void e1000e_set_interrupt_capability (struct e1000_adapter *adapter);extern void e1000e_reset_interrupt_capability (struct e1000_adapter *adapter);extern void e1000e_disable_aspm (struct pci_dev *pdev,u16 state);
drivers/net/e1000e/ethtool.c +28 -26
83 lines not on this page · raw message
drivers/net/e1000e/netdev.c +1 -1
@@ -3964,7 +3964,7 @@ static void e1000_print_link_info(struct e1000_adapter *adapter) ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" ))); } -bool e1000e_has_link (struct e1000_adapter *adapter) +static bool e1000e_has_link (struct e1000_adapter *adapter) {struct e1000_hw *hw = &adapter->hw;bool link_active =0 ;
PATCH 2/4 e1000e: do not touch PHY page 800 registers when link speed is 1000Mbps
From: Bruce Allan <[email protected]>
The PHY on 82577/82578 has issues when the registers on page 800 are accessed when in gigabit mode. Do not clear the Wakeup Control register when resetting the part since it is on page 800 (and will be cleared on reset anyway).
---
drivers/net/e1000e/netdev.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/e1000e/netdev.c +0 -2
@@ -3184,8 +3184,6 @@ void e1000e_reset(struct e1000_adapter *adapter)e1000_get_hw_control (adapter);ew32 (WUC ,0 ); -if (adapter->flags2 &FLAG2_HAS_PHY_WAKEUP ) -e1e_wphy (&adapter->hw,BM_WUC ,0 );if (mac->ops.init_hw (hw))e_err ("Hardware Error\n" );
Re: [net-next-2.6 PATCH 2/4] e1000e: do not touch PHY page 800 registers when link speed is 1000Mbps
From: Jeff Kirsher <[email protected]>
Date: Thu, 17 Jun 2010 21:59:06 -0700
Quoted 10 lines
From: Bruce Allan <[email protected]>
The PHY on 82577/82578 has issues when the registers on page 800 are accessed when in gigabit mode. Do not clear the Wakeup Control register when resetting the part since it is on page 800 (and will be cleared on reset anyway).
Signed-off-by Bruce Allan <[email protected]>Tested-by Jeff Pieper <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 3/4 e1000e: packet split should not be used with early receive
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Originally it was thought there were issues with ICHx/PCH parts with packet split when jumbo frames were enabled but in fact it is really only when early-receive is enabled (via ERT register) on these parts. Use packet split with jumbos but only when early-receive is not enabled.
---
drivers/net/e1000e/netdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/e1000e/netdev.c +1 -1
@@ -2772,7 +2772,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)* per packet. */ pages =PAGE_USE_COUNT (adapter->netdev->mtu); -if (!(adapter->flags &FLAG_IS_ICH ) && (pages <=3 ) && +if (!(adapter->flags &FLAG_HAS_ERT ) && (pages <=3 ) && (PAGE_SIZE <=16384 ) && (rctl &E1000_RCTL_LPE )) adapter->rx_ps_pages = pages;else
Re: [net-next-2.6 PATCH 3/4] e1000e: packet split should not be used with early receive
From: Jeff Kirsher <[email protected]>
Date: Thu, 17 Jun 2010 21:59:27 -0700
Quoted 10 lines
From: Bruce Allan <[email protected]>
Originally it was thought there were issues with ICHx/PCH parts with packet split when jumbo frames were enabled but in fact it is really only when early-receive is enabled (via ERT register) on these parts. Use packet split with jumbos but only when early-receive is not enabled.
Signed-off-by Bruce Allan <[email protected]>Tested-by Jeff Pieper <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 4/4 e1000e: disable gig speed when in S0->Sx transition
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Most of this workaround is necessary for all ICHx/PCH parts so one of the two MAC-type checks can be removed.
---
drivers/net/e1000e/ich8lan.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-)
drivers/net/e1000e/ich8lan.c +5 -14
@@ -3457,21 +3457,12 @@ void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) {u32 phy_ctrl; -switch (hw->mac.type) { -case e1000_ich8lan: -case e1000_ich9lan: -case e1000_ich10lan: -case e1000_pchlan: - phy_ctrl =er32 (PHY_CTRL ); - phy_ctrl |=E1000_PHY_CTRL_D0A_LPLU | -E1000_PHY_CTRL_GBE_DISABLE ; -ew32 (PHY_CTRL , phy_ctrl); + phy_ctrl =er32 (PHY_CTRL ); + phy_ctrl |=E1000_PHY_CTRL_D0A_LPLU |E1000_PHY_CTRL_GBE_DISABLE ; +ew32 (PHY_CTRL , phy_ctrl); -if (hw->mac.type == e1000_pchlan) -e1000_phy_hw_reset_ich8lan (hw); -default : -break ; - } +if (hw->mac.type >= e1000_pchlan) +e1000_phy_hw_reset_ich8lan (hw); }/**
Re: [net-next-2.6 PATCH 4/4] e1000e: disable gig speed when in S0->Sx transition
From: Jeff Kirsher <[email protected]>
Date: Thu, 17 Jun 2010 21:59:48 -0700
Quoted 8 lines
From: Bruce Allan <[email protected]>
Most of this workaround is necessary for all ICHx/PCH parts so one of the two MAC-type checks can be removed.
Signed-off-by Bruce Allan <[email protected]>Tested-by Jeff Pieper <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
From: Jeff Kirsher <[email protected]>
Date: Thu, 17 Jun 2010 21:58:43 -0700
Quoted 10 lines
From: Bruce Allan <[email protected]>
Avoid touching hardware registers when possible, otherwise link negotiation can get messed up when user-level scripts are rapidly polling the driver to see if/when link is up. Use the saved link state information instead when possible.
Signed-off-by Bruce Allan <[email protected]>Tested-by Jeff Pieper <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.