Commit f04bbcbf authored by Yonglong Liu's avatar Yonglong Liu Committed by David S. Miller
Browse files

net: hns3: fix a phy loopback fail issue



When phy driver does not implement the set_loopback interface,
phy loopback test will return -EOPNOTSUPP, and the loopback test
will fail. So when phy driver does not implement the set_loopback
interface, don't do phy loopback test.

Fixes: c9765a89 ("net: hns3: add phy selftest function")
Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f9d41f0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -752,7 +752,8 @@ static int hclge_get_sset_count(struct hnae3_handle *handle, int stringset)
		handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK;
		handle->flags |= HNAE3_SUPPORT_SERDES_PARALLEL_LOOPBACK;

		if (hdev->hw.mac.phydev) {
		if (hdev->hw.mac.phydev && hdev->hw.mac.phydev->drv &&
		    hdev->hw.mac.phydev->drv->set_loopback) {
			count += 1;
			handle->flags |= HNAE3_SUPPORT_PHY_LOOPBACK;
		}