mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
net:phy: Fix "Link is Down" issue
The issue happened randomly in runtime. The message "Link is Down" is popped but soon it recovered to "Link is Up". The "Link is Down" results from the incorrect read data for reading the PHY register via MDIO bus. The correct sequence for reading the data shall be: 1. fire the command 2. wait for command done (this step was missing) 3. wait for data idle 4. read data from data register Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com> Change-Id: I5fc3b4ec30e642b77c8a345a5a6b779672c3b6e2
This commit is contained in:
parent
5a1b0e191a
commit
a87b82a6cd
|
|
@ -61,6 +61,13 @@ static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum)
|
|||
|
||||
iowrite32(ctrl, ctx->base + ASPEED_MDIO_CTRL);
|
||||
|
||||
rc = readl_poll_timeout(ctx->base + ASPEED_MDIO_CTRL, ctrl,
|
||||
!(ctrl & ASPEED_MDIO_CTRL_FIRE),
|
||||
ASPEED_MDIO_INTERVAL_US,
|
||||
ASPEED_MDIO_TIMEOUT_US);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = readl_poll_timeout(ctx->base + ASPEED_MDIO_DATA, data,
|
||||
data & ASPEED_MDIO_DATA_IDLE,
|
||||
ASPEED_MDIO_INTERVAL_US,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user