Skip to content

Commit 410a494

Browse files
etantilovJeff Kirsher
authored andcommitted
ixgbe: add write flush when configuring CS4223/7
Make sure the writes are processed immediately. Without the flush it is possible for operations on one port to spill over the other as the resource is shared. Signed-off-by: Emil Tantilov <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent cc1de78 commit 410a494

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,12 +1824,28 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
18241824

18251825
/* Configure CS4227/CS4223 LINE side to proper mode. */
18261826
reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + slice_offset;
1827+
1828+
ret_val = hw->phy.ops.read_reg(hw, reg_slice,
1829+
IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
1830+
if (ret_val)
1831+
return ret_val;
1832+
1833+
reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
1834+
(IXGBE_CS4227_EDC_MODE_SR << 1));
1835+
18271836
if (setup_linear)
18281837
reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 1;
18291838
else
18301839
reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 1;
1831-
return hw->phy.ops.write_reg(hw, reg_slice, IXGBE_MDIO_ZERO_DEV_TYPE,
1832-
reg_phy_ext);
1840+
1841+
ret_val = hw->phy.ops.write_reg(hw, reg_slice,
1842+
IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext);
1843+
if (ret_val)
1844+
return ret_val;
1845+
1846+
/* Flush previous write with a read */
1847+
return hw->phy.ops.read_reg(hw, reg_slice,
1848+
IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
18331849
}
18341850

18351851
/**

0 commit comments

Comments
 (0)