linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Phy read timeout in ibm_new_emac driver
@ 2008-04-16 10:49 M B
  2008-04-16 12:09 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: M B @ 2008-04-16 10:49 UTC (permalink / raw)
  To: netdev; +Cc: ppc-dev

The __emac_mdio_read function of the emac driver (core.c) will retry
100 times and wait 99us (until the last call of emac_phy_done). I
assume this is an off by one error.

	/* Wait for read to complete */
	n = 100;
	while (!emac_phy_done(dev, (r = in_be32(&p->stacr)))) {
		udelay(1);
		if (!--n) {
			DBG2(dev, " -> timeout wait complete\n");
			goto bail;
		}
	}

My Micrel/Kendin KSZ8721BT on my ppc405EP board needs one us longer to
finish. I was able to reproduce this all the time. So I wonder if the
timeout of 100us is defined by the MII standard, or by the author of
the driver?
If it's a standard I've still a bad feeling if we just correct the
timeout to 100us, maybe 110 should be fine. If it's not defined by the
standard, I would add 50% to the timeout. It won't slow down other
phys, but a scan on the phy bus might get slowed down.
Same applies for __emac_mdio_write.

Oh and we could save a us by putting the udelay(1) after the if section ;-)

Regards

Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-23  5:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-16 10:49 Phy read timeout in ibm_new_emac driver M B
2008-04-16 12:09 ` Benjamin Herrenschmidt
2008-04-23  5:06   ` Markus Brunner
2008-04-23  5:18     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).