Re: [PATCH 2.6.15-rc 1/1] sundance: Really read addr 0

2006-01-26 Thread Jeff Garzik

Arnaldo Carvalho de Melo wrote:

Hi Jeff,

 Please apply:

Make phy 0 actually be read, as it is not being right now as we have:

  int mii_status = mdio_read(dev, phy, MII_BMSR);
  int phyx = phy  0x1f;

When we should have instead:

  int phyx = phy  0x1f;
  int mii_status = mdio_read(dev, phyx, MII_BMSR);

so that when phy, in the end of the (phy = 1; phy = 32...) loop gets
to 32 phyx gets to 0, i.e. we were reading at 32, when the intended
read was for 0.

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]


applied


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2.6.15-rc 1/1] sundance: Really read addr 0

2005-12-25 Thread Arnaldo Carvalho de Melo
Hi Jeff,

 Please apply:

Make phy 0 actually be read, as it is not being right now as we have:

  int mii_status = mdio_read(dev, phy, MII_BMSR);
  int phyx = phy  0x1f;

When we should have instead:

  int phyx = phy  0x1f;
  int mii_status = mdio_read(dev, phyx, MII_BMSR);

so that when phy, in the end of the (phy = 1; phy = 32...) loop gets
to 32 phyx gets to 0, i.e. we were reading at 32, when the intended
read was for 0.

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 0ab9c38..8cdeb5c 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -633,9 +633,13 @@ static int __devinit sundance_probe1 (st
 
 	np-phys[0] = 1;		/* Default setting */
 	np-mii_preamble_required++;
+	/*
+	 * It seems some phys doesn't deal well with address 0 being accessed
+	 * first, so leave address zero to the end of the loop (32  31).
+	 */
 	for (phy = 1; phy = 32  phy_idx  MII_CNT; phy++) {
-		int mii_status = mdio_read(dev, phy, MII_BMSR);
 		int phyx = phy  0x1f;
+		int mii_status = mdio_read(dev, phyx, MII_BMSR);
 		if (mii_status != 0xmii_status != 0x) {
 			np-phys[phy_idx++] = phyx;
 			np-mii_if.advertising = mdio_read(dev, phyx, MII_ADVERTISE);


Re: [PATCH 2.6.15-rc 1/1] sundance: Really read addr 0

2005-12-25 Thread Jeff Garzik

Arnaldo Carvalho de Melo wrote:

Hi Jeff,

 Please apply:

Make phy 0 actually be read, as it is not being right now as we have:

  int mii_status = mdio_read(dev, phy, MII_BMSR);
  int phyx = phy  0x1f;

When we should have instead:

  int phyx = phy  0x1f;
  int mii_status = mdio_read(dev, phyx, MII_BMSR);

so that when phy, in the end of the (phy = 1; phy = 32...) loop gets
to 32 phyx gets to 0, i.e. we were reading at 32, when the intended
read was for 0.

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]


Patch is OK, but cannot apply it since you included it as an attachment 
(which your mailer subsequently base64-encoded, for some reason).


Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html