Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: hns: fix LED configuration for marvell phy

Since commit(net: phy: marvell: change default m88e1510 LED configuration),
the active LED of Hip07 devices is always off, because Hip07 just
use 2 LEDs.
This patch adds a phy_register_fixup_for_uid() for m88e1510 to
correct the LED configuration.

Fixes: 077772468ec1 ("net: phy: marvell: change default m88e1510 LED configuration")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Reviewed-by: linyunsheng <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yonglong Liu and committed by
David S. Miller
f4e5f775 bba18318

+22 -1
+22 -1
drivers/net/ethernet/hisilicon/hns/hns_enet.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/ip.h> 13 13 #include <linux/ipv6.h> 14 + #include <linux/marvell_phy.h> 14 15 #include <linux/module.h> 15 16 #include <linux/phy.h> 16 17 #include <linux/platform_device.h> ··· 1150 1149 } 1151 1150 } 1152 1151 1152 + static int hns_phy_marvell_fixup(struct phy_device *phydev) 1153 + { 1154 + phydev->dev_flags |= MARVELL_PHY_LED0_LINK_LED1_ACTIVE; 1155 + 1156 + return 0; 1157 + } 1158 + 1153 1159 /** 1154 1160 *hns_nic_init_phy - init phy 1155 1161 *@ndev: net device ··· 1181 1173 1182 1174 if (h->phy_if != PHY_INTERFACE_MODE_XGMII) { 1183 1175 phy_dev->dev_flags = 0; 1176 + 1177 + /* register the PHY fixup (for Marvell 88E1510) */ 1178 + ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, 1179 + MARVELL_PHY_ID_MASK, 1180 + hns_phy_marvell_fixup); 1181 + /* we can live without it, so just issue a warning */ 1182 + if (ret) 1183 + netdev_warn(ndev, 1184 + "Cannot register PHY fixup, ret=%d\n", 1185 + ret); 1184 1186 1185 1187 ret = phy_connect_direct(ndev, phy_dev, hns_nic_adjust_link, 1186 1188 h->phy_if); ··· 2448 2430 hns_nic_uninit_ring_data(priv); 2449 2431 priv->ring_data = NULL; 2450 2432 2451 - if (ndev->phydev) 2433 + if (ndev->phydev) { 2434 + phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510, 2435 + MARVELL_PHY_ID_MASK); 2452 2436 phy_disconnect(ndev->phydev); 2437 + } 2453 2438 2454 2439 if (!IS_ERR_OR_NULL(priv->ae_handle)) 2455 2440 hnae_put_handle(priv->ae_handle);