Re: FEC MDIO read timeout on linkup
From: Andrew Lunn <andrew@lunn.ch>
Date: 2022-05-02 18:24:58
From: Andrew Lunn <andrew@lunn.ch>
Date: 2022-05-02 18:24:58
writing to this register could trigger a FEC_ENET_MII interrupt actually creating a race condition with fec_enet_mdio_read() that is called on link change also.
Another point to consider:
static int fec_enet_mdio_wait(struct fec_enet_private *fep)
{
uint ievent;
int ret;
ret = readl_poll_timeout_atomic(fep->hwp + FEC_IEVENT, ievent,
ievent & FEC_ENET_MII, 2, 30000);
if (!ret)
writel(FEC_ENET_MII, fep->hwp + FEC_IEVENT);
return ret;
}
An unexpected interrupt will make this exit too early, and the read
will get invalid data. An unexpected interrupt would not cause a
timeout here, which is what you are reporting.
Andrew