All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][KS8695] Mark network interface as running on ifconfig up
@ 2010-02-11  9:05 Yegor Yefremov
  2010-02-11 10:56 ` Uwe Kleine-König
  0 siblings, 1 reply; 10+ messages in thread
From: Yegor Yefremov @ 2010-02-11  9:05 UTC (permalink / raw)
  To: linux-arm-kernel

[KS8695] Mark network interface as running on ifconfig up

Without netif_carrier_on() network interface will not transmit any packets
after ifconfig down and subsequent ifconfig up.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
===================================================================
--- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
+++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
@@ -1371,6 +1371,7 @@ ks8695_open(struct net_device *ndev)
 
 	napi_enable(&ksp->napi);
 	netif_start_queue(ndev);
+	netif_carrier_on(ndev);
 
 	return 0;
 }

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

* [PATCH][KS8695] Mark network interface as running on ifconfig up
  2010-02-11  9:05 [PATCH][KS8695] Mark network interface as running on ifconfig up Yegor Yefremov
@ 2010-02-11 10:56 ` Uwe Kleine-König
  0 siblings, 0 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2010-02-11 10:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Yegor,

I recommend to resend your patch with a Cc: to netdev at vger.kernel.org.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH][KS8695] Mark network interface as running on ifconfig up
  2010-02-22 15:47     ` Yegor Yefremov
@ 2010-02-26  9:20       ` David Miller
  -1 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-02-26  9:20 UTC (permalink / raw)
  To: yegor_sub1; +Cc: linux-arm-kernel, avictor.za, netdev

From: Yegor Yefremov <yegor_sub1@visionsystems.de>
Date: Mon, 22 Feb 2010 16:47:58 +0100

> [KS8695] Don't call netif_carrier_off() from ndo_stop()
> 
> netif_carrier_on() and netif_carrier_off() should be called from
> link status interrupt handler
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Looks good, applied.

Please do not put text you want to make it into the
commit message header line in brackets "[]", those
get removed by automated tools that apply patches
because patches are usually posted as:

Subject: [PATCH N/M] xxxx

and the GIT tools kill all the text inside of the brackets
so that the commit header properly reads "xxx"

Thanks.

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

* [PATCH][KS8695] Mark network interface as running on ifconfig up
@ 2010-02-26  9:20       ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-02-26  9:20 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yegor Yefremov <yegor_sub1@visionsystems.de>
Date: Mon, 22 Feb 2010 16:47:58 +0100

> [KS8695] Don't call netif_carrier_off() from ndo_stop()
> 
> netif_carrier_on() and netif_carrier_off() should be called from
> link status interrupt handler
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Looks good, applied.

Please do not put text you want to make it into the
commit message header line in brackets "[]", those
get removed by automated tools that apply patches
because patches are usually posted as:

Subject: [PATCH N/M] xxxx

and the GIT tools kill all the text inside of the brackets
so that the commit header properly reads "xxx"

Thanks.

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

* Re: [PATCH][KS8695] Mark network interface as running on ifconfig up
  2010-02-17  0:06   ` David Miller
@ 2010-02-22 15:47     ` Yegor Yefremov
  -1 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2010-02-22 15:47 UTC (permalink / raw)
  To: David Miller; +Cc: linux-arm-kernel, avictor.za, netdev

David Miller schrieb:
> From: Yegor Yefremov <yegor_sub1@visionsystems.de>
> Date: Thu, 11 Feb 2010 12:12:43 +0100
> 
>> [KS8695] Mark network interface as running on ifconfig up
>>
>> Without netif_carrier_on() network interface will not transmit any packets
>> after ifconfig down and subsequent ifconfig up.
>>
>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>>
>> Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
>> ===================================================================
>> --- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
>> +++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
>> @@ -1371,6 +1371,7 @@ ks8695_open(struct net_device *ndev)
>>  
>>  	napi_enable(&ksp->napi);
>>  	netif_start_queue(ndev);
>> +	netif_carrier_on(ndev);
>>  
>>  	return 0;
>>  }
>>
> 
> Only ks8695_link_irq() should be setting the carrier state.
> 
> If necessary, reset the PHY on device open so that the link up
> interrupt arrives and the code handling that event can set the carrier
> status properly.
> 
> This is how every other driver handles this situation.

According to this guideline is it also wrong to call netif_carrier_on(ndev) within ndo_stop() routine? I removed this call and the ifconfig up/down is functioning properly. So the resulting patch could look like this:


[KS8695] Don't call netif_carrier_off() from ndo_stop()

netif_carrier_on() and netif_carrier_off() should be called from
link status interrupt handler

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
===================================================================
--- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
+++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
@@ -1335,7 +1335,6 @@ ks8695_stop(struct net_device *ndev)
 
 	netif_stop_queue(ndev);
 	napi_disable(&ksp->napi);
-	netif_carrier_off(ndev);
 
 	ks8695_shutdown(ksp);
 


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

* [PATCH][KS8695] Mark network interface as running on ifconfig up
@ 2010-02-22 15:47     ` Yegor Yefremov
  0 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2010-02-22 15:47 UTC (permalink / raw)
  To: linux-arm-kernel

David Miller schrieb:
> From: Yegor Yefremov <yegor_sub1@visionsystems.de>
> Date: Thu, 11 Feb 2010 12:12:43 +0100
> 
>> [KS8695] Mark network interface as running on ifconfig up
>>
>> Without netif_carrier_on() network interface will not transmit any packets
>> after ifconfig down and subsequent ifconfig up.
>>
>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>>
>> Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
>> ===================================================================
>> --- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
>> +++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
>> @@ -1371,6 +1371,7 @@ ks8695_open(struct net_device *ndev)
>>  
>>  	napi_enable(&ksp->napi);
>>  	netif_start_queue(ndev);
>> +	netif_carrier_on(ndev);
>>  
>>  	return 0;
>>  }
>>
> 
> Only ks8695_link_irq() should be setting the carrier state.
> 
> If necessary, reset the PHY on device open so that the link up
> interrupt arrives and the code handling that event can set the carrier
> status properly.
> 
> This is how every other driver handles this situation.

According to this guideline is it also wrong to call netif_carrier_on(ndev) within ndo_stop() routine? I removed this call and the ifconfig up/down is functioning properly. So the resulting patch could look like this:


[KS8695] Don't call netif_carrier_off() from ndo_stop()

netif_carrier_on() and netif_carrier_off() should be called from
link status interrupt handler

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
===================================================================
--- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
+++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
@@ -1335,7 +1335,6 @@ ks8695_stop(struct net_device *ndev)
 
 	netif_stop_queue(ndev);
 	napi_disable(&ksp->napi);
-	netif_carrier_off(ndev);
 
 	ks8695_shutdown(ksp);
 

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

* Re: [PATCH][KS8695] Mark network interface as running on ifconfig up
  2010-02-11 11:12 ` Yegor Yefremov
@ 2010-02-17  0:06   ` David Miller
  -1 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-02-17  0:06 UTC (permalink / raw)
  To: yegor_sub1; +Cc: linux-arm-kernel, avictor.za, netdev

From: Yegor Yefremov <yegor_sub1@visionsystems.de>
Date: Thu, 11 Feb 2010 12:12:43 +0100

> [KS8695] Mark network interface as running on ifconfig up
> 
> Without netif_carrier_on() network interface will not transmit any packets
> after ifconfig down and subsequent ifconfig up.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
> ===================================================================
> --- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
> +++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
> @@ -1371,6 +1371,7 @@ ks8695_open(struct net_device *ndev)
>  
>  	napi_enable(&ksp->napi);
>  	netif_start_queue(ndev);
> +	netif_carrier_on(ndev);
>  
>  	return 0;
>  }
> 

Only ks8695_link_irq() should be setting the carrier state.

If necessary, reset the PHY on device open so that the link up
interrupt arrives and the code handling that event can set the carrier
status properly.

This is how every other driver handles this situation.


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

* [PATCH][KS8695] Mark network interface as running on ifconfig up
@ 2010-02-17  0:06   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-02-17  0:06 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yegor Yefremov <yegor_sub1@visionsystems.de>
Date: Thu, 11 Feb 2010 12:12:43 +0100

> [KS8695] Mark network interface as running on ifconfig up
> 
> Without netif_carrier_on() network interface will not transmit any packets
> after ifconfig down and subsequent ifconfig up.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
> ===================================================================
> --- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
> +++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
> @@ -1371,6 +1371,7 @@ ks8695_open(struct net_device *ndev)
>  
>  	napi_enable(&ksp->napi);
>  	netif_start_queue(ndev);
> +	netif_carrier_on(ndev);
>  
>  	return 0;
>  }
> 

Only ks8695_link_irq() should be setting the carrier state.

If necessary, reset the PHY on device open so that the link up
interrupt arrives and the code handling that event can set the carrier
status properly.

This is how every other driver handles this situation.

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

* [PATCH][KS8695] Mark network interface as running on ifconfig up
@ 2010-02-11 11:12 ` Yegor Yefremov
  0 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2010-02-11 11:12 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: netdev, Andrew Victor

[KS8695] Mark network interface as running on ifconfig up

Without netif_carrier_on() network interface will not transmit any packets
after ifconfig down and subsequent ifconfig up.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
===================================================================
--- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
+++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
@@ -1371,6 +1371,7 @@ ks8695_open(struct net_device *ndev)
 
 	napi_enable(&ksp->napi);
 	netif_start_queue(ndev);
+	netif_carrier_on(ndev);
 
 	return 0;
 }

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

* [PATCH][KS8695] Mark network interface as running on ifconfig up
@ 2010-02-11 11:12 ` Yegor Yefremov
  0 siblings, 0 replies; 10+ messages in thread
From: Yegor Yefremov @ 2010-02-11 11:12 UTC (permalink / raw)
  To: linux-arm-kernel

[KS8695] Mark network interface as running on ifconfig up

Without netif_carrier_on() network interface will not transmit any packets
after ifconfig down and subsequent ifconfig up.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Index: linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
===================================================================
--- linux-2.6.33-rc7.orig/drivers/net/arm/ks8695net.c
+++ linux-2.6.33-rc7/drivers/net/arm/ks8695net.c
@@ -1371,6 +1371,7 @@ ks8695_open(struct net_device *ndev)
 
 	napi_enable(&ksp->napi);
 	netif_start_queue(ndev);
+	netif_carrier_on(ndev);
 
 	return 0;
 }

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

end of thread, other threads:[~2010-02-26  9:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-11  9:05 [PATCH][KS8695] Mark network interface as running on ifconfig up Yegor Yefremov
2010-02-11 10:56 ` Uwe Kleine-König
2010-02-11 11:12 Yegor Yefremov
2010-02-11 11:12 ` Yegor Yefremov
2010-02-17  0:06 ` David Miller
2010-02-17  0:06   ` David Miller
2010-02-22 15:47   ` Yegor Yefremov
2010-02-22 15:47     ` Yegor Yefremov
2010-02-26  9:20     ` David Miller
2010-02-26  9:20       ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.