All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][PPC32] 2.4.27: fixes for 8xx fec.c
@ 2004-08-10  7:58 Harald Küthe
  2004-08-10  8:42 ` Florian Schirmer
  0 siblings, 1 reply; 3+ messages in thread
From: Harald Küthe @ 2004-08-10  7:58 UTC (permalink / raw)
  To: linuxppc-embedded, linux-kernel

Hi

I found two problems concerning the fast ethernet driver 
for ppc 8xx processors (fec.c) in linux kernel version 2.4.26/27 
and I think in the 2.6 series as well (not confirmed).

First problem is only when CONFIG_USE_MDIO is __not__ set.
How to reproduce:
start the system with fec ethernet, everything works, 
issue a ifconfig ethX down and ifconfig ethX up and ethernet is not working anymore.
Fix (or at least a workaround). In fec_enet_open() add a fec_restart() at the end 
if CONFIG_USE_MDIO is not set.

2nd problem is with CONFIG_USE_MDIO set: 
The promiscuous mode/multicast settings are getting lost if link status changes occurs 
How to reproduce:
build a bridge with the fec device. Then simply unplug and replug the ethernet cable. 
fec_restart() is called which idles all promiscuous mode/multicast settings.
The bridge will then only forward broadcast frames because the promiscuous setting is lost.
Fix: call set_multicast_list(dev) at the end of fec_restart() before ethernet is reenabled.

If there are more questions please write back.

Please CC me as I'm not subscribed to the lists

Regards
Harald


Here are the fixes:

diff -urN linux-2.4.27.orig/arch/ppc/8xx_io/fec.c linux-2.4.27/arch/ppc/8xx_io/fec.c
--- linux-2.4.27.orig/arch/ppc/8xx_io/fec.c	2003-11-28 19:26:18.000000000 +0100
+++ linux-2.4.27/arch/ppc/8xx_io/fec.c	2004-08-10 09:16:00.000000000 +0200
@@ -1466,6 +1466,11 @@
 	return -ENODEV;		/* No PHY we understand */
 #else
 	fep->link = 1;
+
+#ifndef	CONFIG_USE_MDIO
+	fec_restart (dev, 0);
+#endif
+
 	netif_start_queue(dev);
 	return 0;	/* Success */
 #endif	/* CONFIG_USE_MDIO */
@@ -2049,6 +2054,9 @@
 	fecp->fec_imask = ( FEC_ENET_TXF | FEC_ENET_TXB |
 			    FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII );
 
+	/* set old promiscuous/multicast settings which are lost above */
+	set_multicast_list(dev);
+
 	/* And last, enable the transmit and receive processing.
 	*/
 	fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN; 


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

* Re: [PATCH][PPC32] 2.4.27: fixes for 8xx fec.c
  2004-08-10  7:58 Harald Küthe
@ 2004-08-10  8:42 ` Florian Schirmer
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Schirmer @ 2004-08-10  8:42 UTC (permalink / raw)
  To: Harald Küthe; +Cc: linuxppc-embedded, linux-kernel

Hi,

>+
>+#ifndef	CONFIG_USE_MDIO
>+	fec_restart (dev, 0);
>+#endif
>+
> 	netif_start_queue(dev);
> 	return 0;	/* Success */
> #endif	/* CONFIG_USE_MDIO */
>  
>

Just a minor hint: you don't need the #ifndef CONFIG_USE_MDIO guard 
since you're already in the non MDIO branch (see #endif comment).

Greetings,
  Florian

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

* [PATCH][PPC32] 2.4.27: fixes for 8xx fec.c
@ 2004-10-06  6:26 Harald Küthe
  0 siblings, 0 replies; 3+ messages in thread
From: Harald Küthe @ 2004-10-06  6:26 UTC (permalink / raw)
  To: linuxppc-embedded

Hello, I sent this one some time ago.

I found two problems concerning the fast ethernet driver=20
for ppc 8xx processors (fec.c) in linux kernel version 2.4.26/27=20
and I think in the 2.6 series as well (not confirmed).

First problem is only when CONFIG_USE_MDIO is __not__ set.
How to reproduce:
start the system with fec ethernet, everything works,=20
issue a ifconfig ethX down and ifconfig ethX up and ethernet is not =
working anymore.
Fix (or at least a workaround). In fec_enet_open() add a fec_restart() at =
the end=20
if CONFIG_USE_MDIO is not set.

2nd problem is with CONFIG_USE_MDIO set:=20
The promiscuous mode/multicast settings are getting lost if link status =
changes occurs=20
How to reproduce:
build a bridge with the fec device. Then simply unplug and replug the =
ethernet cable.=20
fec_restart() is called which idles all promiscuous mode/multicast =
settings.
The bridge will then only forward broadcast frames because the promiscuous =
setting is lost.
Fix: call set_multicast_list(dev) at the end of fec_restart() before =
ethernet is reenabled.

If there are more questions please write back.

Reagrds
Harald

diff -urN linux-2.4.27.orig/arch/ppc/8xx_io/fec.c linux-2.4.27/arch/ppc/8xx=
_io/fec.c
--- linux-2.4.27.orig/arch/ppc/8xx_io/fec.c	2003-11-28 19:26:18.0000000=
00 +0100
+++ linux-2.4.27/arch/ppc/8xx_io/fec.c	2004-08-10 13:54:06.000000000 =
+0200
@@ -1466,6 +1466,8 @@
 	return -ENODEV;		/* No PHY we understand */
 #else
 	fep->link =3D 1;
+	/* after ifconfig down and up fec will not start -> restart it */
+	fec_restart (dev, 0);
 	netif_start_queue(dev);
 	return 0;	/* Success */
 #endif	/* CONFIG_USE_MDIO */
@@ -2049,6 +2051,9 @@
 	fecp->fec_imask =3D ( FEC_ENET_TXF | FEC_ENET_TXB |
 			    FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII );
=20
+	/* set old promiscuous/multicast settings which are lost above */
+	set_multicast_list(dev);
+
 	/* And last, enable the transmit and receive processing.
 	*/
 	fecp->fec_ecntrl =3D FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN;

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

end of thread, other threads:[~2004-10-06  6:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-06  6:26 [PATCH][PPC32] 2.4.27: fixes for 8xx fec.c Harald Küthe
  -- strict thread matches above, loose matches on Subject: below --
2004-08-10  7:58 Harald Küthe
2004-08-10  8:42 ` Florian Schirmer

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.