[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <6a6049b80804160349q42120b4bs1c0db49ea5ad055d@mail.gmail.com>
Date: Wed, 16 Apr 2008 12:49:46 +0200
From: "M B" <super.firetwister@...glemail.com>
To: netdev@...r.kernel.org
Cc: ppc-dev <linuxppc-dev@...abs.org>,
"Benjamin Herrenschmidt" <benh@...nel.crashing.org>
Subject: Phy read timeout in ibm_new_emac driver
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists