linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 44x ethernet MDIO access
@ 2004-08-05 19:01 Ralph Siemsen
  2004-08-05 20:05 ` Ralph Siemsen
  2004-08-05 21:23 ` Matt Porter
  0 siblings, 2 replies; 6+ messages in thread
From: Ralph Siemsen @ 2004-08-05 19:01 UTC (permalink / raw)
  To: Linux PPC Dev, Matt Porter

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

There is a small bug in the emac_phy_write() routine defined in
drivers/net/ibm_emac/ibm_emac_core.c (present in latest 2.6.8-rc3).  At
the end of the function, check is done for phy error; however as written
this will always be false, because "stacr" contains the value _written_
to the hardware, rather than the value read back from hardware.

Simple on-line fix attached.

In a related issue, both the PHY read and write functions use a fixed
time delay (MDIO_DELAY = 50) presently... it seems I need a longer value
on my hardware, and having such hardcoded values is trouble anyways... I
suggest we change the code to poll for completion, with a short delay
and an upper limit on the number of loops.

=Ralph

[-- Attachment #2: mdio_write.patch --]
[-- Type: text/plain, Size: 500 bytes --]

Allow proper detection of phy write error.

--- linux-2.6.8-rc3/drivers/net/ibm_emac/ibm_emac_core.c.orig	2004-08-05 14:54:22.000000000 -0400
+++ linux-2.6.8-rc3/drivers/net/ibm_emac/ibm_emac_core.c	2004-08-05 14:54:56.000000000 -0400
@@ -453,7 +453,7 @@

 	udelay(MDIO_DELAY);

-	if ((in_be32(&emacp->em0stacr) & EMAC_STACR_OC) == 0)
+	if (((stacr = in_be32(&emacp->em0stacr)) & EMAC_STACR_OC) == 0)
 		printk(KERN_WARNING "%s: PHY write timeout #2!\n", dev->name);

 	/* Check for a write error */

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

end of thread, other threads:[~2004-08-06 13:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-05 19:01 [PATCH] 44x ethernet MDIO access Ralph Siemsen
2004-08-05 20:05 ` Ralph Siemsen
2004-08-05 21:34   ` Matt Porter
2004-08-06 12:12   ` Geert Uytterhoeven
2004-08-06 13:04     ` Ralph Siemsen
2004-08-05 21:23 ` Matt Porter

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).