e1000/base: check more errors for ESB2 init and reset
Adding code where missing to handle case where calls to e1000_read_kmrn_reg_80003es2lan and e1000_write_kmrn_reg_80003es2lan return an error value. Also, when accessing the E1000_KMRNCTRLSTA_INBAND_PARAM offset to disable far-end loopback on 80003es2lan devices, make the handling of a read or write failure consistent between hw_init and hw_reset. Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
This commit is contained in:
parent
a70cf8c3ee
commit
32c646d6d2
@ -852,11 +852,15 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
|
||||
/* Disable IBIST slave mode (far-end loopback) */
|
||||
ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data);
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
|
||||
e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
kum_reg_data);
|
||||
if (!ret_val) {
|
||||
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
kum_reg_data);
|
||||
if (ret_val)
|
||||
DEBUGOUT("Error disabling far-end loopback\n");
|
||||
} else
|
||||
DEBUGOUT("Error disabling far-end loopback\n");
|
||||
|
||||
ret_val = e1000_get_auto_rd_done_generic(hw);
|
||||
if (ret_val)
|
||||
@ -912,11 +916,18 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
|
||||
/* Disable IBIST slave mode (far-end loopback) */
|
||||
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
&kum_reg_data);
|
||||
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
|
||||
e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
kum_reg_data);
|
||||
ret_val =
|
||||
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
&kum_reg_data);
|
||||
if (!ret_val) {
|
||||
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
kum_reg_data);
|
||||
if (ret_val)
|
||||
DEBUGOUT("Error disabling far-end loopback\n");
|
||||
} else
|
||||
DEBUGOUT("Error disabling far-end loopback\n");
|
||||
|
||||
/* Set the transmit descriptor write-back policy */
|
||||
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0));
|
||||
|
Loading…
Reference in New Issue
Block a user