From: Shweta Choudaha Date: Thu, 16 May 2019 22:03:31 +0000 (+0100) Subject: net/igb: fix PHY status if PHY reset is not blocked X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=260dd6952600b5b44d0a1ce70a582116e6bd74fa;p=dpdk.git net/igb: fix PHY status if PHY reset is not blocked When PHY reset is blocked as is the case when BMC is connected via NC-SI do not set GO_LINKD bit in PHY power management register in dev_stop as this will disconnect the PHY. Also, in dev_close clear the GO_LINKD bit only if PHY reset is not blocked Fixes: 3af34dec0b41 ("igb: force phy power up/down") Cc: stable@dpdk.org Signed-off-by: Shweta Choudaha Reviewed-by: Xiaolong Ye --- diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index ce7c9e6646..53e83d5ec2 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1468,8 +1468,9 @@ eth_igb_stop(struct rte_eth_dev *dev) igb_pf_reset_hw(hw); E1000_WRITE_REG(hw, E1000_WUC, 0); - /* Set bit for Go Link disconnect */ - if (hw->mac.type >= e1000_82580) { + /* Set bit for Go Link disconnect if PHY reset is not blocked */ + if (hw->mac.type >= e1000_82580 && + (e1000_check_reset_block(hw) != E1000_BLK_PHY_RESET)) { uint32_t phpm_reg; phpm_reg = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT); @@ -1544,8 +1545,9 @@ eth_igb_close(struct rte_eth_dev *dev) igb_release_manageability(hw); igb_hw_control_release(hw); - /* Clear bit for Go Link disconnect */ - if (hw->mac.type >= e1000_82580) { + /* Clear bit for Go Link disconnect if PHY reset is not blocked */ + if (hw->mac.type >= e1000_82580 && + (e1000_check_reset_block(hw) != E1000_BLK_PHY_RESET)) { uint32_t phpm_reg; phpm_reg = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT);