[U-Boot] [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.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se --- drivers/qe/uec.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c index ccbf27d..758151f 100644 --- a/drivers/qe/uec.c +++ b/drivers/qe/uec.c @@ -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);

This udelay looks bogus and doesn't help my board.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se ---
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(-)
diff --git a/drivers/qe/uec_phy.c b/drivers/qe/uec_phy.c index 5237960..29ca97e 100644 --- a/drivers/qe/uec_phy.c +++ b/drivers/qe/uec_phy.c @@ -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;

On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
This udelay looks bogus and doesn't help my board.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
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:
Acked-by: Kim Phillips kim.phillips@freescale.com
thanks!
Kim

Kim Phillips kim.phillips@freescale.com wrote on 2010/08/12 07:17:49:
On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
This udelay looks bogus and doesn't help my board.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
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:
Acked-by: Kim Phillips kim.phillips@freescale.com
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

Kim Phillips kim.phillips@freescale.com wrote on 2010/08/12 07:17:49:
On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
This udelay looks bogus and doesn't help my board.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
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:
Acked-by: Kim Phillips kim.phillips@freescale.com
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?

On Wed, 11 Aug 2010 11:44:22 +0200 Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
This udelay looks bogus and doesn't help my board.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
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:
Acked-by: Kim Phillips kim.phillips@freescale.com
thanks!
Kim
This one too?

On Wed, 11 Aug 2010 11:44:21 +0200 Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
uec_init() adds an udelay(100000) even though the PHY status read went well, don't do that.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
Acked-by: Kim Phillips kim.phillips@freescale.com
Kim

On Wed, 11 Aug 2010 11:44:21 +0200 Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
uec_init() adds an udelay(100000) even though the PHY status read went well, don't do that.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
Acked-by: Kim Phillips kim.phillips@freescale.com
Kim
hmm, who gets this into the tree?

Dear Joakim Tjernlund,
In message OFC346B6E4.325608D3-ONC1257783.0028D954-C1257783.00290C71@transmode.se you wrote:
Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
uec_init() adds an udelay(100000) even though the PHY status read went well, don't do that.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
Acked-by: Kim Phillips kim.phillips@freescale.com
hmm, who gets this into the tree?
This being a network driver I see it on Ben's plate...
Best regards,
Wolfgang Denk

Hi Joakim,
On Wednesday, August 18, 2010, Joakim Tjernlund joakim.tjernlund@transmode.se wrote:
On Wed, 11 Aug 2010 11:44:21 +0200 Joakim Tjernlund Joakim.Tjernlund@transmode.se wrote:
uec_init() adds an udelay(100000) even though the PHY status read went well, don't do that.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
Acked-by: Kim Phillips kim.phillips@freescale.com
Kim
hmm, who gets this into the tree?
I'm just getting caught up, and will take this.
Regards, Ben
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi Jocke,
On 8/11/2010 2:44 AM, Joakim Tjernlund wrote:
uec_init() adds an udelay(100000) even though the PHY status read went well, don't do that.
Signed-off-by: Joakim TjernlundJoakim.Tjernlund@transmode.se
drivers/qe/uec.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c index ccbf27d..758151f 100644 --- a/drivers/qe/uec.c +++ b/drivers/qe/uec.c @@ -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);
Parts 1 & 2 applied to net/next. Sorry for taking so long.
regards, Ben
participants (5)
-
Ben Warren
-
Joakim Tjernlund
-
Joakim Tjernlund
-
Kim Phillips
-
Wolfgang Denk