]>
Commit | Line | Data |
---|---|---|
d369aec6 SL |
1 | From c0922744d77fd3e24c0c8cda7742d9b4a8c4015f Mon Sep 17 00:00:00 2001 |
2 | From: Yonglong Liu <liuyonglong@huawei.com> | |
3 | Date: Sat, 26 Jan 2019 17:18:27 +0800 | |
4 | Subject: net: hns: Fix wrong read accesses via Clause 45 MDIO protocol | |
5 | ||
6 | [ Upstream commit cec8abba13e6a26729dfed41019720068eeeff2b ] | |
7 | ||
8 | When reading phy registers via Clause 45 MDIO protocol, after write | |
9 | address operation, the driver use another write address operation, so | |
10 | can not read the right value of any phy registers. This patch fixes it. | |
11 | ||
12 | Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> | |
13 | Signed-off-by: Peng Li <lipeng321@huawei.com> | |
14 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
15 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
16 | --- | |
17 | drivers/net/ethernet/hisilicon/hns_mdio.c | 2 +- | |
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
19 | ||
20 | diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c | |
21 | index 501eb2090ca6..de23a0ead5d7 100644 | |
22 | --- a/drivers/net/ethernet/hisilicon/hns_mdio.c | |
23 | +++ b/drivers/net/ethernet/hisilicon/hns_mdio.c | |
24 | @@ -329,7 +329,7 @@ static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum) | |
25 | } | |
26 | ||
27 | hns_mdio_cmd_write(mdio_dev, is_c45, | |
28 | - MDIO_C45_WRITE_ADDR, phy_id, devad); | |
29 | + MDIO_C45_READ, phy_id, devad); | |
30 | } | |
31 | ||
32 | /* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/ | |
33 | -- | |
34 | 2.19.1 | |
35 |