diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-16 22:44:14 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-16 22:44:14 +0200 |
commit | 1652a83fa494b12e20fc02a2cc3ddbcd75d53170 (patch) | |
tree | 2aa6461f309916dfadb19ed9e30886f4ece11e39 /drivers/net/ethernet/hisilicon/hns/hns_enet.c | |
parent | d6142b91e9cc249b3aa22c90fade67e2e2d52cdb (diff) | |
parent | 7876320f88802b22d4e2daf7eb027dd14175a0f8 (diff) | |
download | blackbird-obmc-linux-1652a83fa494b12e20fc02a2cc3ddbcd75d53170.tar.gz blackbird-obmc-linux-1652a83fa494b12e20fc02a2cc3ddbcd75d53170.zip |
Merge 4.19-rc4 into usb-next
We need the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_enet.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_enet.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index 02a0ba20fad5..f56855e63c96 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -1112,11 +1112,26 @@ static void hns_nic_adjust_link(struct net_device *ndev) struct hnae_handle *h = priv->ae_handle; int state = 1; + /* If there is no phy, do not need adjust link */ if (ndev->phydev) { - h->dev->ops->adjust_link(h, ndev->phydev->speed, - ndev->phydev->duplex); - state = ndev->phydev->link; + /* When phy link down, do nothing */ + if (ndev->phydev->link == 0) + return; + + if (h->dev->ops->need_adjust_link(h, ndev->phydev->speed, + ndev->phydev->duplex)) { + /* because Hi161X chip don't support to change gmac + * speed and duplex with traffic. Delay 200ms to + * make sure there is no more data in chip FIFO. + */ + netif_carrier_off(ndev); + msleep(200); + h->dev->ops->adjust_link(h, ndev->phydev->speed, + ndev->phydev->duplex); + netif_carrier_on(ndev); + } } + state = state && h->dev->ops->get_status(h); if (state != priv->link) { |