diff options
| -rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_enet.c | 5 | ||||
| -rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 16 | ||||
| -rw-r--r-- | drivers/net/ethernet/hisilicon/hns_mdio.c | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index 5b33238c6680..60e7d7ae3787 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c | |||
| @@ -2418,6 +2418,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev) | |||
| 2418 | out_notify_fail: | 2418 | out_notify_fail: |
| 2419 | (void)cancel_work_sync(&priv->service_task); | 2419 | (void)cancel_work_sync(&priv->service_task); |
| 2420 | out_read_prop_fail: | 2420 | out_read_prop_fail: |
| 2421 | /* safe for ACPI FW */ | ||
| 2422 | of_node_put(to_of_node(priv->fwnode)); | ||
| 2421 | free_netdev(ndev); | 2423 | free_netdev(ndev); |
| 2422 | return ret; | 2424 | return ret; |
| 2423 | } | 2425 | } |
| @@ -2447,6 +2449,9 @@ static int hns_nic_dev_remove(struct platform_device *pdev) | |||
| 2447 | set_bit(NIC_STATE_REMOVING, &priv->state); | 2449 | set_bit(NIC_STATE_REMOVING, &priv->state); |
| 2448 | (void)cancel_work_sync(&priv->service_task); | 2450 | (void)cancel_work_sync(&priv->service_task); |
| 2449 | 2451 | ||
| 2452 | /* safe for ACPI FW */ | ||
| 2453 | of_node_put(to_of_node(priv->fwnode)); | ||
| 2454 | |||
| 2450 | free_netdev(ndev); | 2455 | free_netdev(ndev); |
| 2451 | return 0; | 2456 | return 0; |
| 2452 | } | 2457 | } |
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c index 8e9b95871d30..ce15d2350db9 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | |||
| @@ -1157,16 +1157,18 @@ static int hns_get_regs_len(struct net_device *net_dev) | |||
| 1157 | */ | 1157 | */ |
| 1158 | static int hns_nic_nway_reset(struct net_device *netdev) | 1158 | static int hns_nic_nway_reset(struct net_device *netdev) |
| 1159 | { | 1159 | { |
| 1160 | int ret = 0; | ||
| 1161 | struct phy_device *phy = netdev->phydev; | 1160 | struct phy_device *phy = netdev->phydev; |
| 1162 | 1161 | ||
| 1163 | if (netif_running(netdev)) { | 1162 | if (!netif_running(netdev)) |
| 1164 | /* if autoneg is disabled, don't restart auto-negotiation */ | 1163 | return 0; |
| 1165 | if (phy && phy->autoneg == AUTONEG_ENABLE) | ||
| 1166 | ret = genphy_restart_aneg(phy); | ||
| 1167 | } | ||
| 1168 | 1164 | ||
| 1169 | return ret; | 1165 | if (!phy) |
| 1166 | return -EOPNOTSUPP; | ||
| 1167 | |||
| 1168 | if (phy->autoneg != AUTONEG_ENABLE) | ||
| 1169 | return -EINVAL; | ||
| 1170 | |||
| 1171 | return genphy_restart_aneg(phy); | ||
| 1170 | } | 1172 | } |
| 1171 | 1173 | ||
| 1172 | static u32 | 1174 | static u32 |
diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c index 017e08452d8c..baf5cc251f32 100644 --- a/drivers/net/ethernet/hisilicon/hns_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns_mdio.c | |||
| @@ -321,7 +321,7 @@ static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum) | |||
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | hns_mdio_cmd_write(mdio_dev, is_c45, | 323 | hns_mdio_cmd_write(mdio_dev, is_c45, |
| 324 | MDIO_C45_WRITE_ADDR, phy_id, devad); | 324 | MDIO_C45_READ, phy_id, devad); |
| 325 | } | 325 | } |
| 326 | 326 | ||
| 327 | /* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/ | 327 | /* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/ |
