On Wed, Apr 14, 2021 at 09:36:04PM +0200, Andrew Lunn wrote:
> > +static int korina_mdio_wait(struct korina_private *lp)
> > +{
> > + int timeout = 1000;
> > +
> > + while ((readl(&lp->eth_regs->miimind) & 1) && timeout-- > 0)
> > + udelay(1);
> > +
> > + if (timeout <= 0)
> > +
> +static int korina_mdio_wait(struct korina_private *lp)
> +{
> + int timeout = 1000;
> +
> + while ((readl(&lp->eth_regs->miimind) & 1) && timeout-- > 0)
> + udelay(1);
> +
> + if (timeout <= 0)
> + return -1;
> +
> + return 0;
Using readl_poll_timeout_ato
Fixed MDIO functions to work reliable and not just by accident.
Signed-off-by: Thomas Bogendoerfer
---
drivers/net/ethernet/korina.c | 57 +++
1 file changed, 38 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/kori