Skip to content

Commit

Permalink
Merge branch 'hns-fixes'
Browse files Browse the repository at this point in the history
Huazhong Tan says:

====================
net: hns: Bugfixes for HNS driver

This patchset includes bugfixes for the HNS ethernet controller driver.

Every patch is independent.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 4, 2019
2 parents cff1e01 + bb98950 commit 75e7fb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,10 @@ static void hns_ae_put_handle(struct hnae_handle *handle)
struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle);
int i;

vf_cb->mac_cb = NULL;

kfree(vf_cb);

for (i = 0; i < handle->q_num; i++)
hns_ae_get_ring_pair(handle->qs[i])->used_by_vf = 0;

kfree(vf_cb);
}

static int hns_ae_wait_flow_down(struct hnae_handle *handle)
Expand Down
17 changes: 7 additions & 10 deletions drivers/net/ethernet/hisilicon/hns/hns_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,13 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
if (!h->phy_dev)
return 0;

ethtool_convert_legacy_u32_to_link_mode(supported, h->if_support);
linkmode_and(phy_dev->supported, phy_dev->supported, supported);
linkmode_copy(phy_dev->advertising, phy_dev->supported);

if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
phy_dev->autoneg = false;

if (h->phy_if != PHY_INTERFACE_MODE_XGMII) {
phy_dev->dev_flags = 0;

Expand All @@ -1181,16 +1188,6 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
if (unlikely(ret))
return -ENODEV;

ethtool_convert_legacy_u32_to_link_mode(supported, h->if_support);
linkmode_and(phy_dev->supported, phy_dev->supported, supported);
linkmode_copy(phy_dev->advertising, phy_dev->supported);

if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
phy_dev->autoneg = false;

if (h->phy_if == PHY_INTERFACE_MODE_SGMII)
phy_stop(phy_dev);

return 0;
}

Expand Down

0 comments on commit 75e7fb0

Please sign in to comment.