e1000e: clear PHY wakeup bit after LCD reset on 82577/82578
Subsystems (2)
PATCH 1/5 e1000e: clear PHY wakeup bit after LCD reset on 82577/82578
From: Bruce Allan <[email protected]>
Performing a dummy read of the PHY Wakeup Control (WUC) register clears the wakeup enable bit set by an PHY reset. If this bit remains set, link problems may occur.
---
drivers/net/e1000e/ich8lan.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/e1000e/ich8lan.c +9 -1
@@ -844,7 +844,7 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)u32 i;u32 data, cnf_size, cnf_base_addr, sw_cfg_mask;s32 ret_val; -u16 word_addr, reg_data, reg_addr, phy_page =0 ; +u16 reg, word_addr, reg_data, reg_addr, phy_page =0 ; ret_val =e1000e_phy_hw_reset_generic (hw);if (ret_val)
@@ -859,6 +859,10 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)return ret_val; } +/* Dummy read to clear the phy wakeup bit after lcd reset */ +if (hw->mac.type == e1000_pchlan) +e1e_rphy (hw,BM_WUC , ®); +/* * Initialize the PHY from the NVM on ICH platforms. This * is needed due to an issue where the NVM configuration is
@@ -2229,6 +2233,7 @@ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)**/ static s32 e1000_reset_hw_ich8lan (struct e1000_hw *hw) { +u16 reg;u32 ctrl, icr, kab;s32 ret_val;
@@ -2304,6 +2309,9 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)hw_dbg (hw,"Auto Read Done did not complete\n" ); } } +/* Dummy read to clear the phy wakeup bit after lcd reset */ +if (hw->mac.type == e1000_pchlan) +e1e_rphy (hw,BM_WUC , ®);/* * For PCH, this write will make sure that any noise
PATCH 2/5 e1000e: increase swflag acquisition timeout for ICHx/PCH
From: Bruce Allan <[email protected]>
In some conditions (e.g. when AMT is enabled on the system), it is possible to take an extended period of time to for the driver to acquire the sw/fw/hw hardware semaphore used to protect against concurrent access of a shared resource (e.g. PHY registers). This could cause PHY registers to not get configured properly resulting in link issues.
---
drivers/net/e1000e/ich8lan.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/e1000e/ich8lan.c +3 -1
@@ -122,6 +122,8 @@#define HV_LED_CONFIG PHY_REG(768, 30)/* LED Configuration */ +#define SW_FLAG_TIMEOUT 1000/* SW Semaphore flag timeout in milliseconds */ +/* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ /* Offset 04h HSFSTS */ union ich8_hws_flash_status {
@@ -599,7 +601,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) goto out; } - timeout =PHY_CFG_TIMEOUT *2 ; + timeout =SW_FLAG_TIMEOUT ; extcnf_ctrl |=E1000_EXTCNF_CTRL_SWFLAG ;ew32 (EXTCNF_CTRL , extcnf_ctrl);
Re: [net-2.6 PATCH 2/5] e1000e: increase swflag acquisition timeout for ICHx/PCH
From: Jeff Kirsher <[email protected]>
Date: Mon, 26 Oct 2009 14:23:06 -0700
Quoted 10 lines
From: Bruce Allan <[email protected]>
In some conditions (e.g. when AMT is enabled on the system), it is possible to take an extended period of time to for the driver to acquire the sw/fw/hw hardware semaphore used to protect against concurrent access of a shared resource (e.g. PHY registers). This could cause PHY registers to not get configured properly resulting in link issues.
Signed-off-by Bruce Allan <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 3/5 e1000e: 82577/82578 requires a different method to configure LPLU
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Unlike previous ICHx-based parts, the PCH-based parts (82577/82578) require LPLU (Low Power Link Up, or "reverse auto-negotiation") to be configured in the PHY rather than the MAC.
---
drivers/net/e1000e/ich8lan.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-)
drivers/net/e1000e/ich8lan.c +40 -0
@@ -124,6 +124,11 @@#define SW_FLAG_TIMEOUT 1000/* SW Semaphore flag timeout in milliseconds */ +/* OEM Bits Phy Register */ +#define HV_OEM_BITS PHY_REG(768, 25) +#define HV_OEM_BITS_LPLU 0x0004/* Low Power Link Up */ +#define HV_OEM_BITS_RESTART_AN 0x0400/* Restart Auto-negotiation */ +/* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ /* Offset 04h HSFSTS */ union ich8_hws_flash_status {
@@ -202,6 +207,7 @@ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw);static s32 e1000_cleanup_led_pchlan (struct e1000_hw *hw);static s32 e1000_led_on_pchlan (struct e1000_hw *hw);static s32 e1000_led_off_pchlan (struct e1000_hw *hw); +static s32 e1000_set_lplu_state_pchlan (struct e1000_hw *hw,bool active);static inline u16 __er16flash (struct e1000_hw *hw,unsigned long reg) {
@@ -244,6 +250,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) phy->ops.check_polarity = e1000_check_polarity_ife_ich8lan; phy->ops.read_phy_reg = e1000_read_phy_reg_hv; + phy->ops.set_d0_lplu_state = e1000_set_lplu_state_pchlan; + phy->ops.set_d3_lplu_state = e1000_set_lplu_state_pchlan; phy->ops.write_phy_reg = e1000_write_phy_reg_hv; phy->autoneg_mask =AUTONEG_ADVERTISE_SPEED_DEFAULT ;
@@ -1060,6 +1068,38 @@ static s32 e1000_check_polarity_ife_ich8lan(struct e1000_hw *hw) }/** +* e1000_set_lplu_state_pchlan - Set Low Power Link Up state +* @hw: pointer to the HW structure +* @active: true to enable LPLU, false to disable +* +* Sets the LPLU state according to the active flag. For PCH, if OEM write +* bit are disabled in the NVM, writing the LPLU bits in the MAC will not set +* the phy speed. This function will manually set the LPLU bit and restart +* auto-neg as hw would do. D3 and D0 LPLU will call the same function +* since it configures the same bit. +**/ +static s32 e1000_set_lplu_state_pchlan (struct e1000_hw *hw,bool active) +{ +s32 ret_val =0 ; +u16 oem_reg; + + ret_val =e1e_rphy (hw,HV_OEM_BITS , &oem_reg); +if (ret_val) + goto out; + +if (active) + oem_reg |=HV_OEM_BITS_LPLU ; +else + oem_reg &= ~HV_OEM_BITS_LPLU ; + + oem_reg |=HV_OEM_BITS_RESTART_AN ; + ret_val =e1e_wphy (hw,HV_OEM_BITS , oem_reg); + +out: +return ret_val; +} + +/** * e1000_set_d0_lplu_state_ich8lan - Set Low Power Linkup D0 state * @hw: pointer to the HW structure * @active: TRUE to enable LPLU, FALSE to disable
Re: [net-2.6 PATCH 3/5] e1000e: 82577/82578 requires a different method to configure LPLU
From: Jeff Kirsher <[email protected]>
Date: Mon, 26 Oct 2009 14:23:25 -0700
Quoted 8 lines
From: Bruce Allan <[email protected]>
Unlike previous ICHx-based parts, the PCH-based parts (82577/82578) require LPLU (Low Power Link Up, or "reverse auto-negotiation") to be configured in the PHY rather than the MAC.
Signed-off-by Bruce Allan <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 4/5 e1000e: separate mutex usage between NVM and PHY/CSR register for ICHx/PCH
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Accesses to NVM and PHY/CSR registers on ICHx/PCH-based parts are protected from concurrent accesses with a mutex that is acquired when the access is initiated and released when the access has completed. However, the two types of accesses should not be protected by the same mutex because the driver may have to access the NVM while already holding the mutex over several consecutive PHY/CSR accesses which would result in livelock.
---
drivers/net/e1000e/ich8lan.c | 89 +++++++++++++++++++++++++++--------------- 1 files changed, 58 insertions(+), 31 deletions(-)
drivers/net/e1000e/ich8lan.c +58 -31
@@ -578,12 +578,39 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)static DEFINE_MUTEX (nvm_mutex);/** +* e1000_acquire_nvm_ich8lan - Acquire NVM mutex +* @hw: pointer to the HW structure +* +* Acquires the mutex for performing NVM operations. +**/ +static s32 e1000_acquire_nvm_ich8lan (struct e1000_hw *hw) +{ +mutex_lock (&nvm_mutex); + +return 0 ; +} + +/** +* e1000_release_nvm_ich8lan - Release NVM mutex +* @hw: pointer to the HW structure +* +* Releases the mutex used while performing NVM operations. +**/ +static void e1000_release_nvm_ich8lan (struct e1000_hw *hw) +{ +mutex_unlock (&nvm_mutex); + +return ; +} + +static DEFINE_MUTEX (swflag_mutex); + +/** * e1000_acquire_swflag_ich8lan - Acquire software control flag * @hw: pointer to the HW structure * -* Acquires the software control flag for performing NVM and PHY -* operations. This is a function pointer entry point only called by -* read/write routines for the PHY and NVM parts. +* Acquires the software control flag for performing PHY and select +* MAC CSR accesses. **/ static s32 e1000_acquire_swflag_ich8lan (struct e1000_hw *hw) {
@@ -592,7 +619,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)might_sleep (); -mutex_lock (&nvm_mutex); +mutex_lock (&swflag_mutex);while (timeout) { extcnf_ctrl =er32 (EXTCNF_CTRL );
@@ -633,7 +660,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) out:if (ret_val) -mutex_unlock (&nvm_mutex); +mutex_unlock (&swflag_mutex);return ret_val; }
@@ -642,9 +669,8 @@ out:* e1000_release_swflag_ich8lan - Release software control flag * @hw: pointer to the HW structure * -* Releases the software control flag for performing NVM and PHY operations. -* This is a function pointer entry point only called by read/write -* routines for the PHY and NVM parts. +* Releases the software control flag for performing PHY and select +* MAC CSR accesses. **/ static void e1000_release_swflag_ich8lan (struct e1000_hw *hw) {
@@ -654,7 +680,9 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG ;ew32 (EXTCNF_CTRL , extcnf_ctrl); -mutex_unlock (&nvm_mutex); +mutex_unlock (&swflag_mutex); + +return ; }/**
@@ -1360,12 +1388,11 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) || (words ==0 )) {hw_dbg (hw,"nvm parameter(s) out of bounds\n" ); -return -E1000_ERR_NVM ; + ret_val = -E1000_ERR_NVM ; + goto out; } - ret_val =e1000_acquire_swflag_ich8lan (hw); -if (ret_val) - goto out; + nvm->ops.acquire_nvm (hw); ret_val =e1000_valid_nvm_bank_detect_ich8lan (hw, &bank);if (ret_val) {
@@ -1391,7 +1418,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, } } -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); out:if (ret_val)
@@ -1649,11 +1676,15 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,return -E1000_ERR_NVM ; } + nvm->ops.acquire_nvm (hw); +for (i =0 ; i < words; i++) { dev_spec->shadow_ram[offset+i].modified =1 ; dev_spec->shadow_ram[offset+i].value = data[i]; } + nvm->ops.release_nvm (hw); +return 0 ; }
@@ -1683,9 +1714,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)if (nvm->type != e1000_nvm_flash_sw) goto out; - ret_val =e1000_acquire_swflag_ich8lan (hw); -if (ret_val) - goto out; + nvm->ops.acquire_nvm (hw);/* * We're writing to the opposite bank so if we're on bank 1,
@@ -1703,7 +1732,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) old_bank_offset =0 ; ret_val =e1000_erase_flash_bank_ich8lan (hw,1 );if (ret_val) { -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); goto out; } }else {
@@ -1711,7 +1740,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) new_bank_offset =0 ; ret_val =e1000_erase_flash_bank_ich8lan (hw,0 );if (ret_val) { -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); goto out; } }
@@ -1769,7 +1798,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)if (ret_val) {/* Possibly read-only, see e1000e_write_protect_nvm_ich8lan() */ hw_dbg (hw,"Flash commit failed.\n" ); -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); goto out; }
@@ -1782,7 +1811,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) act_offset = new_bank_offset +E1000_ICH_NVM_SIG_WORD ; ret_val =e1000_read_flash_word_ich8lan (hw, act_offset, &data);if (ret_val) { -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); goto out; } data &=0xBFFF ;
@@ -1790,7 +1819,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) act_offset *2 +1 , (u8)(data >> 8));if (ret_val) { -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); goto out; }
@@ -1803,7 +1832,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) act_offset = (old_bank_offset +E1000_ICH_NVM_SIG_WORD ) *2 +1 ; ret_val =e1000_retry_write_flash_byte_ich8lan (hw, act_offset,0 );if (ret_val) { -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); goto out; }
@@ -1813,7 +1842,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) dev_spec->shadow_ram[i].value =0xFFFF ; } -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw);/* * Reload the EEPROM, or else modifications will not appear
@@ -1877,14 +1906,12 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)**/ void e1000e_write_protect_nvm_ich8lan (struct e1000_hw *hw) { +struct e1000_nvm_info *nvm = &hw->nvm;union ich8_flash_protected_range pr0;union ich8_hws_flash_status hsfsts;u32 gfpreg; -s32 ret_val; - ret_val =e1000_acquire_swflag_ich8lan (hw); -if (ret_val) -return ; + nvm->ops.acquire_nvm (hw); gfpreg =er32flash (ICH_FLASH_GFPREG );
@@ -1905,7 +1932,7 @@ void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw) hsfsts.hsf_status.flockdn = true;ew32flash (ICH_FLASH_HSFSTS , hsfsts.regval); -e1000_release_swflag_ich8lan (hw); + nvm->ops.release_nvm (hw); }/**
@@ -3162,9 +3189,9 @@ static struct e1000_phy_operations ich8_phy_ops = { };static struct e1000_nvm_operations ich8_nvm_ops = { - .acquire_nvm = e1000_acquire_swflag_ich8lan, + .acquire_nvm = e1000_acquire_nvm_ich8lan, .read_nvm = e1000_read_nvm_ich8lan, - .release_nvm = e1000_release_swflag_ich8lan, + .release_nvm = e1000_release_nvm_ich8lan, .update_nvm = e1000_update_nvm_checksum_ich8lan, .valid_led_default = e1000_valid_led_default_ich8lan, .validate_nvm = e1000_validate_nvm_checksum_ich8lan,
Re: [net-2.6 PATCH 4/5] e1000e: separate mutex usage between NVM and PHY/CSR register for ICHx/PCH
From: Jeff Kirsher <[email protected]>
Date: Mon, 26 Oct 2009 14:23:43 -0700
Quoted 11 lines
From: Bruce Allan <[email protected]>
Accesses to NVM and PHY/CSR registers on ICHx/PCH-based parts are protected from concurrent accesses with a mutex that is acquired when the access is initiated and released when the access has completed. However, the two types of accesses should not be protected by the same mutex because the driver may have to access the NVM while already holding the mutex over several consecutive PHY/CSR accesses which would result in livelock.
Signed-off-by Bruce Allan <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 5/5 e1000e: allow for swflag to be held over consecutive PHY accesses
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
PCH-based parts (82577/82578) and some ICH8-based parts (82566) need to hold the swflag (sw/fw/hw hardware semaphore) over consecutive PHY accesses in order to perform sw-driven PHY configuration during initialization to workaround known hardware issues (see follow-on patch). This patch provides new PHY read/write functions (and function pointers) that will allow accessing the PHY registers assuming the swflag has already been acquired. The actual PHY register access code has moved into helper functions that are called with a flag indicating whether or not the swflag has already been acquired and acquires/releases it if not.
The functions called from within the updated PHY access functions had to be updated to assume the swflag was already acquired, and other functions that called those functions were also updated to acquire/release the swflag.
---
drivers/net/e1000e/e1000.h | 12 + drivers/net/e1000e/hw.h | 2 drivers/net/e1000e/ich8lan.c | 4 drivers/net/e1000e/phy.c | 469 +++++++++++++++++++++++++++++------------- 4 files changed, 346 insertions(+), 141 deletions(-)
drivers/net/e1000e/e1000.h +12 -0
@@ -519,9 +519,13 @@ extern s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw);extern s32 e1000e_get_cable_length_igp_2 (struct e1000_hw *hw);extern s32 e1000e_get_phy_info_igp (struct e1000_hw *hw);extern s32 e1000e_read_phy_reg_igp (struct e1000_hw *hw,u32 offset,u16 *data); +extern s32 e1000e_read_phy_reg_igp_locked (struct e1000_hw *hw,u32 offset, +u16 *data);extern s32 e1000e_phy_hw_reset_generic (struct e1000_hw *hw);extern s32 e1000e_set_d3_lplu_state (struct e1000_hw *hw,bool active);extern s32 e1000e_write_phy_reg_igp (struct e1000_hw *hw,u32 offset,u16 data); +extern s32 e1000e_write_phy_reg_igp_locked (struct e1000_hw *hw,u32 offset, +u16 data);extern s32 e1000e_phy_sw_reset (struct e1000_hw *hw);extern s32 e1000e_phy_force_speed_duplex_m88 (struct e1000_hw *hw);extern s32 e1000e_get_cfg_done (struct e1000_hw *hw);
@@ -538,7 +542,11 @@ extern s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);extern s32 e1000e_write_phy_reg_bm2 (struct e1000_hw *hw,u32 offset,u16 data);extern void e1000e_phy_force_speed_duplex_setup (struct e1000_hw *hw,u16 *phy_ctrl);extern s32 e1000e_write_kmrn_reg (struct e1000_hw *hw,u32 offset,u16 data); +extern s32 e1000e_write_kmrn_reg_locked (struct e1000_hw *hw,u32 offset, +u16 data);extern s32 e1000e_read_kmrn_reg (struct e1000_hw *hw,u32 offset,u16 *data); +extern s32 e1000e_read_kmrn_reg_locked (struct e1000_hw *hw,u32 offset, +u16 *data);extern s32 e1000e_phy_has_link_generic (struct e1000_hw *hw,u32 iterations,u32 usec_interval,bool *success);extern s32 e1000e_phy_reset_dsp (struct e1000_hw *hw);
@@ -546,7 +554,11 @@ extern s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);extern s32 e1000e_write_phy_reg_mdic (struct e1000_hw *hw,u32 offset,u16 data);extern s32 e1000e_check_downshift (struct e1000_hw *hw);extern s32 e1000_read_phy_reg_hv (struct e1000_hw *hw,u32 offset,u16 *data); +extern s32 e1000_read_phy_reg_hv_locked (struct e1000_hw *hw,u32 offset, +u16 *data);extern s32 e1000_write_phy_reg_hv (struct e1000_hw *hw,u32 offset,u16 data); +extern s32 e1000_write_phy_reg_hv_locked (struct e1000_hw *hw,u32 offset, +u16 data);extern s32 e1000_set_mdio_slow_mode_hv (struct e1000_hw *hw,bool slow);extern s32 e1000_link_stall_workaround_hv (struct e1000_hw *hw);extern s32 e1000_copper_link_setup_82577 (struct e1000_hw *hw);
drivers/net/e1000e/hw.h +2 -0
@@ -764,11 +764,13 @@ struct e1000_phy_operations {s32 (*get_cable_length)(struct e1000_hw *);s32 (*get_phy_info)(struct e1000_hw *);s32 (*read_phy_reg)(struct e1000_hw *,u32 ,u16 *); +s32 (*read_phy_reg_locked)(struct e1000_hw *,u32 ,u16 *);void (*release_phy)(struct e1000_hw *);s32 (*reset_phy)(struct e1000_hw *);s32 (*set_d0_lplu_state)(struct e1000_hw *,bool );s32 (*set_d3_lplu_state)(struct e1000_hw *,bool );s32 (*write_phy_reg)(struct e1000_hw *,u32 ,u16 ); +s32 (*write_phy_reg_locked)(struct e1000_hw *,u32 ,u16 );s32 (*cfg_on_link_up)(struct e1000_hw *); };
drivers/net/e1000e/ich8lan.c +4 -0
@@ -250,9 +250,11 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) phy->ops.check_polarity = e1000_check_polarity_ife_ich8lan; phy->ops.read_phy_reg = e1000_read_phy_reg_hv; + phy->ops.read_phy_reg_locked = e1000_read_phy_reg_hv_locked; phy->ops.set_d0_lplu_state = e1000_set_lplu_state_pchlan; phy->ops.set_d3_lplu_state = e1000_set_lplu_state_pchlan; phy->ops.write_phy_reg = e1000_write_phy_reg_hv; + phy->ops.write_phy_reg_locked = e1000_write_phy_reg_hv_locked; phy->autoneg_mask =AUTONEG_ADVERTISE_SPEED_DEFAULT ; phy->id = e1000_phy_unknown;
@@ -313,6 +315,8 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)case IGP03E1000_E_PHY_ID : phy->type = e1000_phy_igp_3; phy->autoneg_mask =AUTONEG_ADVERTISE_SPEED_DEFAULT ; + phy->ops.read_phy_reg_locked = e1000e_read_phy_reg_igp_locked; + phy->ops.write_phy_reg_locked = e1000e_write_phy_reg_igp_locked;break ;case IFE_E_PHY_ID :case IFE_PLUS_E_PHY_ID :
drivers/net/e1000e/phy.c +328 -141
841 lines not on this page · raw message
Re: [net-2.6 PATCH 5/5] e1000e: allow for swflag to be held over consecutive PHY accesses
From: Jeff Kirsher <[email protected]>
Date: Mon, 26 Oct 2009 14:24:02 -0700
Quoted 12 lines
From: Bruce Allan <[email protected]>
PCH-based parts (82577/82578) and some ICH8-based parts (82566) need to hold the swflag (sw/fw/hw hardware semaphore) over consecutive PHY accesses in order to perform sw-driven PHY configuration during initialization to workaround known hardware issues (see follow-on patch). This patch provides new PHY read/write functions (and function pointers) that will allow accessing the PHY registers assuming the swflag has already been acquired. The actual PHY register access code has moved into helper functions that are called with a flag indicating whether or not the swflag has already been acquired and acquires/releases it if not.
Quoted 6 lines
The functions called from within the updated PHY access functions had to be updated to assume the swflag was already acquired, and other functions that called those functions were also updated to acquire/release the swflag.
Signed-off-by Bruce Allan <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
From: Jeff Kirsher <[email protected]>
Date: Mon, 26 Oct 2009 14:22:47 -0700
Quoted 8 lines
From: Bruce Allan <[email protected]>
Performing a dummy read of the PHY Wakeup Control (WUC) register clears the wakeup enable bit set by an PHY reset. If this bit remains set, link problems may occur.
Signed-off-by Bruce Allan <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.