net: hns: fix ethtool loopback fail bug
authorKejian Yan <yankejian@huawei.com>
Tue, 21 Jun 2016 03:56:28 +0000 (11:56 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jun 2016 08:51:54 +0000 (04:51 -0400)
commitcba80bdea72cb24a93bd00286673991ffb4a6b31
tree4ee420beee5d4aa5bc7548f4d3e37bcc65c782c0
parent89a6b1aae844a89f6724b22c63803bb6fbe5677b
net: hns: fix ethtool loopback fail bug

When run ethtool cmd(ethtool -t ethx) again and again for a long
time, it will be probabilistically fail. The PHYs' registers may
be on different pages, so it must be switch to the right page
before setting PHYs' registers.
And __lb_up() calls phy_start() to startup the PHYs device, but
this function may change Copper Control Register(Page 0, Register 0)
to an other value. It would cause phy loopback test fail. if we
remove phy_start(), we have to remove the relative phy_stop(),
phy_disconnect() when doing phy loopback to keep the phy stay in
right status.

Reported-by: hejun <hjat2005@huawei.com>
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c