Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1670221
| From | l00371289 <linyunsheng@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test |
| Date | 2017-06-20 05:10 +0200 |
| Message-ID | <tUhId-34p-3@gated-at.bofh.it> (permalink) |
| References | <tSVgK-6bj-17@gated-at.bofh.it> <tUc5Q-7Wx-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
hi, Florian On 2017/6/20 5:00, Florian Fainelli wrote: > On 06/16/2017 02:24 AM, Lin Yun Sheng wrote: >> This patch fixes the phy loopback self_test failed issue. when >> Marvell Phy Module is loaded, it will powerdown fiber when doing >> phy loopback self test, which cause phy loopback self_test fail. >> >> Signed-off-by: Lin Yun Sheng <linyunsheng@huawei.com> >> --- >> drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 16 ++++++++++++++-- >> 1 file changed, 14 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c >> index b8fab14..e95795b 100644 >> --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c >> +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c >> @@ -288,9 +288,15 @@ static int hns_nic_config_phy_loopback(struct phy_device *phy_dev, u8 en) > > The question really is, why is not this properly integrated into the PHY > driver and PHYLIB such that the only thing the Ethernet MAC driver has > to call is a function of the PHY driver putting it in self-test? Do you meaning calling phy_dev->drv->resume and phy_dev->drv->suspend function? I tried it, but it failed. if that is what you mean, I will look into it why it fail. Thanks for your reply. Best regards YunSheng Lin > >> >> /* Force 1000M Link, Default is 0x0200 */ >> phy_write(phy_dev, 7, 0x20C); >> - phy_write(phy_dev, HNS_PHY_PAGE_REG, 0); >> >> - /* Enable PHY loop-back */ >> + /* Powerup Fiber */ >> + phy_write(phy_dev, HNS_PHY_PAGE_REG, 1); >> + val = phy_read(phy_dev, COPPER_CONTROL_REG); >> + val &= ~PHY_POWER_DOWN; >> + phy_write(phy_dev, COPPER_CONTROL_REG, val); >> + >> + /* Enable Phy Loopback */ >> + phy_write(phy_dev, HNS_PHY_PAGE_REG, 0); >> val = phy_read(phy_dev, COPPER_CONTROL_REG); >> val |= PHY_LOOP_BACK; >> val &= ~PHY_POWER_DOWN; >> @@ -299,6 +305,12 @@ static int hns_nic_config_phy_loopback(struct phy_device *phy_dev, u8 en) >> phy_write(phy_dev, HNS_PHY_PAGE_REG, 0xFA); >> phy_write(phy_dev, 1, 0x400); >> phy_write(phy_dev, 7, 0x200); >> + >> + phy_write(phy_dev, HNS_PHY_PAGE_REG, 1); >> + val = phy_read(phy_dev, COPPER_CONTROL_REG); >> + val |= PHY_POWER_DOWN; >> + phy_write(phy_dev, COPPER_CONTROL_REG, val); >> + >> phy_write(phy_dev, HNS_PHY_PAGE_REG, 0); >> phy_write(phy_dev, 9, 0xF00); >> >> > >
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH NET] net/hns:bugfix of ethtool -t phy self_test Lin Yun Sheng <linyunsheng@huawei.com> - 2017-06-16 11:00 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test David Miller <davem@davemloft.net> - 2017-06-19 20:30 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Florian Fainelli <f.fainelli@gmail.com> - 2017-06-19 23:10 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Andrew Lunn <andrew@lunn.ch> - 2017-06-20 00:00 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test l00371289 <linyunsheng@huawei.com> - 2017-06-20 05:20 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Andrew Lunn <andrew@lunn.ch> - 2017-06-20 15:30 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test l00371289 <linyunsheng@huawei.com> - 2017-06-21 04:10 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test l00371289 <linyunsheng@huawei.com> - 2017-06-20 05:10 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Andrew Lunn <andrew@lunn.ch> - 2017-06-20 15:30 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test l00371289 <linyunsheng@huawei.com> - 2017-06-21 04:10 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Andrew Lunn <andrew@lunn.ch> - 2017-06-21 05:20 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test l00371289 <linyunsheng@huawei.com> - 2017-06-21 05:50 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Andrew Lunn <andrew@lunn.ch> - 2017-06-21 15:40 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test l00371289 <linyunsheng@huawei.com> - 2017-06-22 03:50 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test Andrew Lunn <andrew@lunn.ch> - 2017-06-22 05:40 +0200
Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test l00371289 <linyunsheng@huawei.com> - 2017-06-22 06:00 +0200
csiph-web