mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-08 15:48:23 +00:00
Merge branch 'hns-fixes'
Peng Li says: ==================== net: hns: code optimizations & bugfixes for HNS driver This patchset includes bugfixes and code optimizations for the HNS ethernet controller driver ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
417c8045c1
3 changed files with 15 additions and 8 deletions
|
@ -2418,6 +2418,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
|
||||||
out_notify_fail:
|
out_notify_fail:
|
||||||
(void)cancel_work_sync(&priv->service_task);
|
(void)cancel_work_sync(&priv->service_task);
|
||||||
out_read_prop_fail:
|
out_read_prop_fail:
|
||||||
|
/* safe for ACPI FW */
|
||||||
|
of_node_put(to_of_node(priv->fwnode));
|
||||||
free_netdev(ndev);
|
free_netdev(ndev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2447,6 +2449,9 @@ static int hns_nic_dev_remove(struct platform_device *pdev)
|
||||||
set_bit(NIC_STATE_REMOVING, &priv->state);
|
set_bit(NIC_STATE_REMOVING, &priv->state);
|
||||||
(void)cancel_work_sync(&priv->service_task);
|
(void)cancel_work_sync(&priv->service_task);
|
||||||
|
|
||||||
|
/* safe for ACPI FW */
|
||||||
|
of_node_put(to_of_node(priv->fwnode));
|
||||||
|
|
||||||
free_netdev(ndev);
|
free_netdev(ndev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1157,16 +1157,18 @@ static int hns_get_regs_len(struct net_device *net_dev)
|
||||||
*/
|
*/
|
||||||
static int hns_nic_nway_reset(struct net_device *netdev)
|
static int hns_nic_nway_reset(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
struct phy_device *phy = netdev->phydev;
|
struct phy_device *phy = netdev->phydev;
|
||||||
|
|
||||||
if (netif_running(netdev)) {
|
if (!netif_running(netdev))
|
||||||
/* if autoneg is disabled, don't restart auto-negotiation */
|
return 0;
|
||||||
if (phy && phy->autoneg == AUTONEG_ENABLE)
|
|
||||||
ret = genphy_restart_aneg(phy);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
if (!phy)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
if (phy->autoneg != AUTONEG_ENABLE)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
return genphy_restart_aneg(phy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32
|
static u32
|
||||||
|
|
|
@ -321,7 +321,7 @@ static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
|
||||||
}
|
}
|
||||||
|
|
||||||
hns_mdio_cmd_write(mdio_dev, is_c45,
|
hns_mdio_cmd_write(mdio_dev, is_c45,
|
||||||
MDIO_C45_WRITE_ADDR, phy_id, devad);
|
MDIO_C45_READ, phy_id, devad);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/
|
/* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue