public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete
@ 2009-08-24 19:32 Kim Phillips
  2009-08-24 22:48 ` Andy Fleming
  2009-08-25 20:34 ` Ben Warren
  0 siblings, 2 replies; 5+ messages in thread
From: Kim Phillips @ 2009-08-24 19:32 UTC (permalink / raw)
  To: u-boot

if you don't have firmware installed for the PHY to come to life, this
wait can be painful - let's give the option to avoid it if we want.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
 drivers/net/tsec.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 9c9fd37..5c3d261 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -17,6 +17,7 @@
 #include <net.h>
 #include <command.h>
 #include <tsec.h>
+#include <asm/errno.h>
 
 #include "miiphy.h"
 
@@ -380,6 +381,12 @@ uint mii_parse_sr(uint mii_reg, struct tsec_private * priv)
 				return 0;
 			}
 
+			if (ctrlc()) {
+				puts("user interrupt!\n");
+				priv->link = 0;
+				return -EINTR;
+			}
+
 			if ((i++ % 1000) == 0) {
 				putc('.');
 			}
-- 
1.6.4

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

* [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete
  2009-08-24 19:32 [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete Kim Phillips
@ 2009-08-24 22:48 ` Andy Fleming
  2009-08-24 23:10   ` Scott Wood
  2009-08-25 20:34 ` Ben Warren
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Fleming @ 2009-08-24 22:48 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 24, 2009 at 2:32 PM, Kim Phillips <kim.phillips@freescale.com>wrote:

> if you don't have firmware installed for the PHY to come to life, this
> wait can be painful - let's give the option to avoid it if we want.
>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>


Acked-by: Andy Fleming <afleming@freescale.com>

I've always wanted this change, but never looked into how to implement it.

However, it should be noted that this change is somewhat lessened in impact
by the proposal to change the timeout to be only 2 seconds, instead of
...whatever it is now.

But even with 2 seconds, it's annoying to wait for N ports to be tried when
you know none of them are hooked up.  Or that you forgot to properly set the
ipaddr, anyway.

Andy

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

* [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete
  2009-08-24 22:48 ` Andy Fleming
@ 2009-08-24 23:10   ` Scott Wood
  2009-08-25  3:09     ` Peter Tyser
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2009-08-24 23:10 UTC (permalink / raw)
  To: u-boot

Andy Fleming wrote:
> On Mon, Aug 24, 2009 at 2:32 PM, Kim Phillips <kim.phillips@freescale.com>wrote:
> 
>> if you don't have firmware installed for the PHY to come to life, this
>> wait can be painful - let's give the option to avoid it if we want.
>>
>> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> 
> 
> Acked-by: Andy Fleming <afleming@freescale.com>
> 
> I've always wanted this change, but never looked into how to implement it.
> 
> However, it should be noted that this change is somewhat lessened in impact
> by the proposal to change the timeout to be only 2 seconds, instead of
> ...whatever it is now.

I thought it was established that that wasn't long enough for some 
configurations?

> But even with 2 seconds, it's annoying to wait for N ports to be tried when
> you know none of them are hooked up.  Or that you forgot to properly set the
> ipaddr, anyway.

ethrotate is annoying in general...

-Scott

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

* [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete
  2009-08-24 23:10   ` Scott Wood
@ 2009-08-25  3:09     ` Peter Tyser
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Tyser @ 2009-08-25  3:09 UTC (permalink / raw)
  To: u-boot

On Mon, 2009-08-24 at 18:10 -0500, Scott Wood wrote:
> Andy Fleming wrote:
> > On Mon, Aug 24, 2009 at 2:32 PM, Kim Phillips <kim.phillips@freescale.com>wrote:
> > 
> >> if you don't have firmware installed for the PHY to come to life, this
> >> wait can be painful - let's give the option to avoid it if we want.
> >>
> >> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> > 
> > 
> > Acked-by: Andy Fleming <afleming@freescale.com>
> > 
> > I've always wanted this change, but never looked into how to implement it.
> > 
> > However, it should be noted that this change is somewhat lessened in impact
> > by the proposal to change the timeout to be only 2 seconds, instead of
> > ...whatever it is now.
> 
> I thought it was established that that wasn't long enough for some 
> configurations?

It looks like 3.5 seconds was agreed upon to be safe:

http://lists.denx.de/pipermail/u-boot/2009-February/047233.html

The current timeout is set to 5 seconds.

We could set a default timeout value of 3.5 seconds, but allow boards to
override this by defining something like CONFIG_SYS_PHY_AUTONEG_TIMEOUT
to tweak the timeout if they wanted.

> > But even with 2 seconds, it's annoying to wait for N ports to be tried when
> > you know none of them are hooked up.  Or that you forgot to properly set the
> > ipaddr, anyway.

Setting ethprime should work for the common case where you know which
ports are connected.

> ethrotate is annoying in general...

Agreed.  For a project a while back we replaced ethact, ethprime and
ethrotate with an "ethorder" variable.  If defined, the interfaces in
ethorder would be tried in order.  So to only use 1 interface you could
set ethorder to "eTSEC1", to cycle between 2 non-contiguous ports it
could be set to "eTSEC1, eTSEC3", to only use PCI ports it could be set
to "e1000#0, e1000#1", etc.  ethorder was more flexible and a bit more
straightforward in my opinion.  Anyone have any interest in the patches?

Best,
Peter

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

* [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete
  2009-08-24 19:32 [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete Kim Phillips
  2009-08-24 22:48 ` Andy Fleming
@ 2009-08-25 20:34 ` Ben Warren
  1 sibling, 0 replies; 5+ messages in thread
From: Ben Warren @ 2009-08-25 20:34 UTC (permalink / raw)
  To: u-boot

Kim Phillips wrote:
> if you don't have firmware installed for the PHY to come to life, this
> wait can be painful - let's give the option to avoid it if we want.
>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
>  drivers/net/tsec.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index 9c9fd37..5c3d261 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -17,6 +17,7 @@
>  #include <net.h>
>  #include <command.h>
>  #include <tsec.h>
> +#include <asm/errno.h>
>  
>  #include "miiphy.h"
>  
> @@ -380,6 +381,12 @@ uint mii_parse_sr(uint mii_reg, struct tsec_private * priv)
>  				return 0;
>  			}
>  
> +			if (ctrlc()) {
> +				puts("user interrupt!\n");
> +				priv->link = 0;
> +				return -EINTR;
> +			}
> +
>  			if ((i++ % 1000) == 0) {
>  				putc('.');
>  			}
>   
Applied to net/next

regards,
Ben

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

end of thread, other threads:[~2009-08-25 20:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-24 19:32 [U-Boot] [PATCH] net: tsec - handle user interrupt while waiting for PHY auto negotiation to complete Kim Phillips
2009-08-24 22:48 ` Andy Fleming
2009-08-24 23:10   ` Scott Wood
2009-08-25  3:09     ` Peter Tyser
2009-08-25 20:34 ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox