[PATCH] 44x ethernet MDIO access

Geert Uytterhoeven geert at linux-m68k.org
Fri Aug 6 22:12:36 EST 2004


On Thu, 5 Aug 2004, Ralph Siemsen wrote:
> Attached is a patch that "works for me" - turns the long udelay() into a
> polling loop with short little delays instead.  This allows MDIO_DELAY
> to be increased to a larger value (say 150) without slowing down most
> systems.

> @@ -451,9 +460,13 @@
>
>  	out_be32(&emacp->em0stacr, stacr);
>
> -	udelay(MDIO_DELAY);
> +	count = 0;
> +	while (((stacr = in_be32(&emacp->em0stacr) & EMAC_STACR_OC) == 0)
> +					&& (count++ < 5000))
                                                      ^^^^
						      MDIO_DELAY?

And perhaps you want to create a (possibly inlined) function just for this
loop?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list