提交 75e7fb0a 编写于 作者: D David S. Miller

Merge branch 'hns-fixes'

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: NDavid S. Miller <davem@davemloft.net>
...@@ -147,12 +147,10 @@ static void hns_ae_put_handle(struct hnae_handle *handle) ...@@ -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); struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle);
int i; int i;
vf_cb->mac_cb = NULL;
kfree(vf_cb);
for (i = 0; i < handle->q_num; i++) for (i = 0; i < handle->q_num; i++)
hns_ae_get_ring_pair(handle->qs[i])->used_by_vf = 0; 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) static int hns_ae_wait_flow_down(struct hnae_handle *handle)
......
...@@ -1170,6 +1170,13 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h) ...@@ -1170,6 +1170,13 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
if (!h->phy_dev) if (!h->phy_dev)
return 0; 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) { if (h->phy_if != PHY_INTERFACE_MODE_XGMII) {
phy_dev->dev_flags = 0; phy_dev->dev_flags = 0;
...@@ -1181,16 +1188,6 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h) ...@@ -1181,16 +1188,6 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
if (unlikely(ret)) if (unlikely(ret))
return -ENODEV; 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; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册