Skip to contentSkip to conversation

UEC: Don't udelay needlessly

PATCH New Joakim Tjernlund 4 participants 11 messages Aug 11, 2010 – Aug 31, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 UEC: Don't udelay needlessly

uec_init() adds an udelay(100000) even though
the PHY status read went well, don't do that.

---
 drivers/qe/uec.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/qe/uec.c +3 -1
index ccbf27d..758151f 100644
@@ -1223,8 +1223,10 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
 		i = 50;
 		do {
 			err = curphy->read_status(uec->mii_info);
+			if (!(((i-- > 0) && !uec->mii_info->link) || err))
+				break;
 			udelay(100000);
-		} while (((i-- > 0) && !uec->mii_info->link) || err);
+		} while (1);
 
 		if (err || i <= 0)
 			printf("warning: %s: timeout on PHY link\n", dev->name);
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/2 UEC PHY: Remove strange 0.5 sec delay

This udelay looks bogus and doesn't help my board.

---

This delay was introduced by ee62ed3286f83b98b7785e0318dc6379e78f7ff6 Kim, is this really needed for you?

 drivers/qe/uec_phy.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/qe/uec_phy.c +0 -1
index 5237960..29ca97e 100644
@@ -398,7 +398,6 @@ static int genmii_update_link (struct uec_mii_info *mii_info)
 			status = phy_read(mii_info, PHY_BMSR);
 		}
 		mii_info->link = 1;
-		udelay(500000);	/* another 500 ms (results in faster booting) */
 	} else {
 		if (status & PHY_BMSR_LS)
 			mii_info->link = 1;
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/2 UEC PHY: Remove strange 0.5 sec delay

Quoted 7 lines · On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund…

This udelay looks bogus and doesn't help my board.

---

This delay was introduced by ee62ed3286f83b98b7785e0318dc6379e78f7ff6 Kim, is this really needed for you?

not that I know of - both these patches work fine on an 8323erdb and 8360emds:

thanks!

Kim

#3 lore raw

PATCH 2/2 UEC PHY: Remove strange 0.5 sec delay

Kim Phillips <[email protected]> wrote on 2010/08/12 07:17:49:

Quoted 12 lines
Quoted 7 lines · On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund…

This udelay looks bogus and doesn't help my board.

---

This delay was introduced by ee62ed3286f83b98b7785e0318dc6379e78f7ff6 Kim, is this really needed for you?

Quoted 6 lines

not that I know of - both these patches work fine on an 8323erdb and 8360emds:

thanks!

Would you mind take a look at [PATCH] UEC PHY: Speed up initial PHY neg. ? Sent it 2 days ago to the list.

Jocke

#4 lore raw

PATCH 2/2 UEC PHY: Remove strange 0.5 sec delay

Quoted 17 lines

Kim Phillips <[email protected]> wrote on 2010/08/12 07:17:49:

Quoted 15 lines
Quoted 7 lines · On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund…

This udelay looks bogus and doesn't help my board.

---

This delay was introduced by ee62ed3286f83b98b7785e0318dc6379e78f7ff6 Kim, is this really needed for you?

not that I know of - both these patches work fine on an 8323erdb and 8360emds:

Quoted 6 lines
Quoted 3 lines

thanks!

Would you mind take a look at [PATCH] UEC PHY: Speed up initial PHY neg. ? Sent it 2 days ago to the list.

Ping?

#5 lore raw

PATCH 2/2 UEC PHY: Remove strange 0.5 sec delay

In reply to Kim Phillips
Quoted 12 lines
Quoted 7 lines · On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund…

This udelay looks bogus and doesn't help my board.

---

This delay was introduced by ee62ed3286f83b98b7785e0318dc6379e78f7ff6 Kim, is this really needed for you?

Quoted 8 lines

not that I know of - both these patches work fine on an 8323erdb and 8360emds:

thanks!

Kim

This one too?

#8 lore raw

PATCH 1/2 UEC: Don't udelay needlessly

Dear Joakim Tjernlund,

Quoted 10 lines · In message <OFC346B6E4.325608D3-ONC1257783.0028D954-C1257783.00290C71@transmode…
Quoted 8 lines
Quoted 5 lines · Joakim Tjernlund

uec_init() adds an udelay(100000) even though
the PHY status read went well, don't do that.

---

hmm, who gets this into the tree?

This being a network driver I see it on Ben's plate...

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Machines take me by surprise with great frequency.      - Alan Turing
#9 lore raw

PATCH 1/2 UEC: Don't udelay needlessly

In reply to Joakim Tjernlund

Hi Joakim,

Quoted 7 lines · Joakim Tjernlund
Quoted 7 lines
Quoted 3 lines · On Wed, 11 Aug 2010 11:44:21 +0200 Joakim Tjernlund…

uec_init() adds an udelay(100000) even though
the PHY status read went well, don't do that.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

---

Kim

hmm, who gets this into the tree?

I'm just getting caught up, and will take this.

Regards,
Ben

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#10 lore raw

PATCH 1/2 UEC: Don't udelay needlessly

In reply to Joakim Tjernlund

Hi Jocke,

Quoted 14 lines · Joakim Tjernlund

uec_init() adds an udelay(100000) even though
the PHY status read went well, don't do that.

---
  drivers/qe/uec.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
drivers/qe/uec.c +0 -0
index ccbf27d..758151f 100644
@@ -1223,8 +1223,10 @@ static int uec_init(struct eth_device* dev, bd_t *bd)
  		i = 50;

drivers/qe/uec.c static int uec_init(struct eth_device* dev, bd_t *bd) · line 1232

Quoted 10 lines
drivers/qe/uec.c +3 -1
  		do {
  			err = curphy->read_status(uec->mii_info);
+			if (!(((i-->  0)&&  !uec->mii_info->link) || err))
+				break;
  			udelay(100000);
-		} while (((i-->  0)&&  !uec->mii_info->link) || err);
+		} while (1);
 
  		if (err || i<= 0)
  			printf("warning: %s: timeout on PHY link\n", dev->name);

Parts 1 & 2 applied to net/next. Sorry for taking so long.

regards,
Ben