Skip to content

Commit

Permalink
net: hns: Fix wrong read accesses via Clause 45 MDIO protocol
Browse files Browse the repository at this point in the history
When reading phy registers via Clause 45 MDIO protocol, after write
address operation, the driver use another write address operation, so
can not read the right value of any phy registers. This patch fixes it.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yonglong Liu authored and David S. Miller committed Jan 28, 2019
1 parent ed29ca8 commit cec8abb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/hisilicon/hns_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
}

hns_mdio_cmd_write(mdio_dev, is_c45,
MDIO_C45_WRITE_ADDR, phy_id, devad);
MDIO_C45_READ, phy_id, devad);
}

/* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/
Expand Down

0 comments on commit cec8abb

Please sign in to comment.